This article outlines a Python and MQL5 workflow for allocating positions across a basket of five U.S. stocks. It retrieves one-minute price data, converts closes to percentage returns, and examines correlations, distributions, pairwise relationships, and…
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
This article outlines a rule-based approach to trading after Non-Farm Payroll releases. It anchors Fibonacci retracement levels between the pre-spike price and the first post-release spike extreme, then waits for price to pull back into a chosen zone and…
This article describes adding breakeven and trailing-stop automation to an MQL5 Expert Advisor managing OCO-style protection. Breakeven is triggered when a position's profit reaches a configured threshold, then the stop is moved to the opening price. After…
This guide presents a stepwise process for finding and evaluating third-party trading signals. It starts with practical filters such as platform, broker, drawdown, provider history, trading frequency, deposit, and subscription cost. It then recommends…
This article describes modular programming for trading robots: divide an expert advisor into independent components with clear inputs and outputs so one component can be replaced without rewriting the rest. It recommends keeping core trading functions in a…
This article presents an architecture for running multiple trading models across instruments and timeframes within one MetaTrader 5 expert advisor. It frames the configuration problem as a set of model, timeframe, and instrument combinations, each of which…
In this interview, Antonio Morillas discusses developing an Expert Advisor for the 2011 Automated Trading Championship. He describes a long-term trend strategy based on a moving-average slope, with buy, sell, or wait signals and a broad trailing stop. When…
This installment describes connecting a trained classifier to MetaTrader 5 for live order execution. Predictions above or below a threshold trigger long or short trades with preset stop-loss and take-profit levels, while a cap on open positions limits new…
This article describes a graphical workflow for assembling MetaTrader 5 Expert Advisors from connected trading blocks, then generating MQL5 code. Its worked example encodes a moving average rule: buy when the shorter average is above the longer one and sell…
The article develops a floating grid that places buy-stop orders above the current price and sell-stop orders below it, then updates the pending orders as price moves. Each position has its own take profit, while orders far from the market are removed and…
The article examines whether trading outcomes can be modeled as independent Bernoulli trials, with each trade classified as a win or loss. It defines clusters as consecutive outcomes of the same kind and uses probability theory to reason about how often long…
The document introduces the Martingale staking rule: begin with a small wager, increase the stake after each loss enough to recover prior losses plus a gain, and reset after a win. It relates this idea to a coin toss and roulette, then suggests a trading…
This tutorial explains how to define and call user-written functions in MQL5, covering return types, arguments, functions without arguments, default parameter values, and passing parameters by value or by reference. It also introduces void functions and…
This article explains why a daily trading-volume cap can fail when an automated expert advisor (EA) mixes market orders with pending orders. The manager checks current and requested volume before allowing another order, but a pending order can remain…
The article presents a modular way to set partial-exit levels from a strategy's own trade history. For each open position, a tracker records maximum favorable excursion in R, where R is the entry-to-initial-stop distance. When a trade closes, the system…
The article presents Ralph Vince’s optimal-f approach to money management. It explains how compounding makes the path of account equity depend on the fraction of capital risked, and why maximizing the stake does not necessarily maximize long-run growth. For…
The article describes an MQL5 Expert Advisor for managing positions after entry. Its three configurable functions move a stop to break-even after a profit trigger, trail the stop as price advances, and close a chosen fraction of a position after a specified…
This article presents a reusable MQL5 Expert Advisor framework for a single symbol and timeframe. Its purpose is to separate strategy rules from recurring platform tasks, including loading price history, detecting new bars, checking spreads, sizing…
This article outlines core functions for an automated trading system: submitting pending orders, placing market orders, changing order prices, and explicitly closing positions. It explains that position handling depends on account mode. On netting accounts,…
This article outlines an automated MQL5 system that combines Envelopes and RSI signals with zone recovery. It describes entering around a trend bounce when price reaches an Envelopes boundary with supporting momentum, then opening counter-trades if price…
This article extends a MetaTrader 5 toolkit for manual trading beyond order entry. It describes organizing the interface into tabs for trading, open positions, and pending orders, with tables and controls for editing or closing individual items. Position…
This article describes an Expert Advisor that represents market conditions as vertices in a state-transition graph. It discretizes normalized trend, volatility, and momentum measures, counts transitions between states, smooths and decays those counts, then…
This article proposes an account-level risk service for MetaTrader 5 accounts running multiple Expert Advisors. When each EA sizes trades and enforces loss limits independently, their combined positions can create concentrated currency exposure, correlated…
This article explains a breakeven mechanism that moves a trade’s stop loss toward or beyond its entry after price advances a set distance. Its first installment outlines a reusable MQL5 base class and a fixed-points version, with trade tickets, trigger…