This article presents reusable MQL5 checks intended to catch invalid trading requests before they reach the broker. It covers validating and normalizing lot sizes against symbol minimums, maximums, and volume steps; checking stop-loss and take-profit…
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
4,613 documents
The article presents a MetaTrader 5 framework that models validated swing highs and lows as nodes in a graph. It connects those nodes with weighted edges, with costs incorporating ATR-normalized distance, spread, and a noise penalty. On each new bar, an A*…
The article proposes running two versions of an automated strategy at once: one trades its original signals, while the other trades in the opposite direction. Each version is optimized separately, including its stop-loss settings, and the author argues that…
This article explains how to apply agglomerative hierarchical classification (AHC) and dendrograms to historical price bar ranges. It treats each range as an observation, groups similar observations into clusters, and uses their hierarchical relationships to…
This example describes a Forex Expert Advisor that combines a model predictive control decision routine with technical indicators and account-level risk adjustments. The routine estimates drift and volatility, adapts its forecast horizon, and searches…
This collection of interviews presents varied views from participants in an automated trading championship. The traders discuss how they develop Expert Advisors, what they monitor in testing, and how they think about rule-based trading, strategy design,…
This beginner tutorial explains how to build a Heikin Ashi indicator in MQL5, calculate a moving average from its candle data, and use both indicators in an Expert Advisor. It outlines the Heikin Ashi formulas: average the period’s open, high, low, and close…
The article describes an interactive semi-automatic Expert Advisor for planning and placing manual trades from a MetaTrader chart. Users can set an equity-risk percentage and a risk-to-reward ratio, adjust them while the EA is running, and drag a stop-loss…
In this championship interview, Matúš German describes a multicurrency Expert Advisor built around trend following. It derives trading channels from the Average True Range indicator, enters when price breaks a channel, and holds positions until price crosses…
The document presents a fluent builder pattern for constructing MQL5 trade requests. Instead of assigning fields in an MqlTradeRequest directly, a developer chains methods for symbol, volume, direction, order type, price, and stop levels. The builder tracks…
This article describes an object-oriented MQL5 Expert Advisor designed to help traders place pending orders from chart-selected prices. Its examples cover adjusting prices to an instrument’s tick size, calculating contract volume and monetary take-profit and…
This introductory article explains how a risk-management class for MetaTrader 5 could track daily, weekly, total, and per-trade losses, as well as profits. It describes setting thresholds, checking account conditions during operation, and stopping or closing…
The article describes an include-file risk manager for MetaTrader 5 expert advisors. It outlines conservative, moderate, aggressive, and custom modes, with limits for daily, total, and per-trade risk. It also compares balance-based and equity-based drawdown…
In this championship interview, developer Vladimir Tsyrulnik describes an automated USD/JPY approach that interprets market state at selected points in a bar’s lifetime. Its directional forecast is based on an index derived from Bulls/Bears Power, with other…
This article outlines an intraday Expert Advisor built around pullbacks to an exponential moving average. Trend direction is inferred from price relative to the average, while an interaction is identified when a candle crosses the line and closes back on the…
The article turns Larry Williams’ smash day reversal idea into objective rules for an Expert Advisor. A bullish setup begins when a bar closes below a configurable number of earlier lows; a bearish setup closes above earlier highs. Outside bars are excluded,…
This article presents a constrained, restartable grid Expert Advisor informed by Aldo Taranto’s research on bidirectional grid processes. It contrasts the grid’s accumulating losses across traversed levels with the faster loss growth of martingale doubling,…
This article shows how to model withdrawals during MetaTrader 5 strategy testing and explains how they affect account balance, equity, and drawdown reporting. It proposes configurable withdrawal schedules and amounts, with withdrawals calculated either as a…
The article starts with a manual hourly trading strategy built from ADX, the Relative Vigor Index, and the Accelerator Oscillator. It specifies directional entry conditions requiring agreement among all three indicators, then uses fixed position size,…
This article develops a pending-order strategy based on unusually high tick volume during a candle. It compares current volume with the average from a chosen number of closed candles, then scales the threshold according to a base deviation and an additional…
The article discusses account-model differences that matter when adding automation to a MetaTrader Expert Advisor. Netting accounts combine trades in a symbol into one position with an average price, while hedging accounts keep positions separate and can…
This article compares trailing stops, partial position reductions, and opening several positions with the same stop but staggered profit targets. Its main example uses five entries with reward-to-risk targets from 1.3 to 1.7. It calculates basket outcomes by…
The article presents a way to preserve an Expert Advisor’s internal state across terminal restarts by serializing a fixed-size structure to a binary file. Examples of state worth saving include trade counts, win and loss streaks, lot multipliers, equity…
The article applies category-theory naturality squares to classify price-change data across three linked currency pairs. USDJPY forms the source series, while EURJPY and EURUSD form the paired destination series. The proposed construction connects their…