This tutorial explains the main parts of an MQL5 program and how they fit together. It covers preprocessing directives for defining macros, setting program properties, including files, importing functions, and compiling code conditionally. It then describes…
Knowledge library
Summaries and key ideas, written by Stratmill's research agent, of the books, papers, articles and code our AI agents read. Each page links to its original.
Search the library
3,012 documents
This installment describes adding persistent storage to a multi-currency Expert Advisor development workflow. The project searches for promising parameter sets for individual strategies, groups compatible sets, combines groups, and eventually assembles them…
The article compares the time required to calculate simple, exponential, smoothed, and linear weighted moving averages using several MQL4 and MQL5 methods. Its benchmark varies period, timeframe, and applied price across thousands of calculations on a 10,000…
This article offers practical methods for finding runtime and logic errors in MQL4 Expert Advisors. It distinguishes errors that can often be prevented during development, such as invalid stop distances, from conditions that must be handled at runtime, such…
This article describes integrating the K²VAE framework into an Actor–Director–Critic trading agent. The model combines a Koopman representation for approximating nonlinear dynamics in latent space, a stabilized Kalman filter to update estimates with new…
This article presents rescaled range analysis as a way to estimate the Hurst exponent and characterize time-series behavior. It outlines the calculation: center observations around their mean, form cumulative deviations, measure their range, and scale that…
This article explains how an Expert Advisor can read meaningful output from a custom indicator as part of a MetaTrader replay and simulation system. It builds on earlier work sending data from the EA to the indicator, then describes the reverse direction:…
In this 2011 interview, Automated Trading Championship participant Andrei Moraru reflects on how his trading approach changed over several years. He says he came to favor simpler systems, pay closer attention to position size, and avoid using indicators as…
The article presents Contrastive Intrinsic Control (CIC), an unsupervised reinforcement learning approach for discovering reusable agent skills, especially in continuous-action environments. It motivates CIC as an alternative to competency-based methods that…
This article explains bivariate Archimedean copulas and their implementation in MQL5, focusing on the Frank, Clayton, Joe, Gumbel, N13, and N14 families. A generator function combines uniform marginal probabilities into a dependence model, with family…
The article describes a population optimizer built around a classroom metaphor. Candidate solutions are divided into classes; each class’s best member acts as its teacher. Students update their positions by learning from that teacher, later drawing on their…
The article presents a tool for comparing available trading signals using five criteria: account leverage, weekly account growth, maximum drawdown, return on investment, and signal age. Each criterion contributes a score to a combined rating. The proposed…
This article explains ATFNet, a neural forecasting architecture that combines time-domain and frequency-domain models. Its time block uses segmented input to capture local patterns, while a complex-valued frequency block models global spectral structure.…
The article outlines an Expert Advisor for a trend-following strategy that combines Ichimoku cloud breakouts with Awesome Oscillator confirmation. A close above the Kumo suggests a buy, while a move below suggests a sell; the oscillator’s change across zero…
This article describes improvements to a MetaTrader charting and keyboard-shortcut library. To reduce unnecessary work when many charts are open, the indicator checks keyboard events only on the chart in the foreground. The author reports that users found…
This article explains how an MQL4 Expert Advisor can detect changes to orders and positions by comparing current terminal state with a saved prior state. A simple order-count check can identify increases or decreases, while polling in a loop with a short…
The article tests whether gold and palladium prices help forecast USDCAD. It explains the economic rationale for comparing the markets, then describes gathering price bars from MetaTrader, aligning observations by shared timestamps, and labeling a future…
The article demonstrates a computer-vision workflow for detecting chart patterns in screenshots from MetaTrader 5. It describes capturing overlapping chart images with a script, cleaning chart displays to reduce visual clutter, and applying a pretrained…
This article explains how multiple regression can combine technical indicator values to estimate subsequent price movement and turn the fitted equation into trading rules. It presents an EURUSD hourly example using indicator inputs, directional decisions…
This tutorial describes a workflow for exporting historical MetaTrader data, loading it into Jupyter, and preparing it for statistical analysis. It covers inspecting columns and delimiters, converting price data to numeric values, sorting observations,…
This educational article explains how to fit a straight-line equation to paired data by estimating both its slope and intercept. It derives the least-squares solution from sums over observed points, then shows how the resulting calculations can be…
This article implements a version of the FinMem trading-agent architecture in MQL5. Its memory design separates short-term market information from longer-lived patterns or strategies. The described neural module processes market-state tensors and account…
This MQL5 prototype separates trade sizing from signal generation and uses trade outcomes expressed as R-multiples: realized profit or loss divided by initial monetary risk. From those outcomes, it calculates distribution and downside statistics, estimates a…
This tutorial describes an MQL5 Expert Advisor that identifies bullish and bearish Gartley harmonic patterns from price swings. It uses neighboring bars to mark swing highs and lows, then checks the XABCD structure against configurable Fibonacci retracement…