A trade result tells you what happened at the end. It does not tell you how the trade got there. Two numbers fill the gap:
With them you can ask: how much drawdown do my winners really need (is my stop too tight)? How far did my losers go my way before they turned (did I give profit back)? How much of the best move did my winners keep?
Files
What the script shows
Inputs: days of history, one symbol (empty = all), one magic number (-1 = all, 0 = manual trades), rows in the table, CSV on/off, summary on the chart on/off.
How the numbers are made
Use in your own code
#include "TradeExcursion.mqh" CTradeExcursion ex; ex.Load(TimeCurrent() - 90 * 86400, TimeCurrent(), "", -1); // from, to, symbol ("" = all), magic (-1 = all) STradeEx t; for(int i = 0; i < ex.Total(); i++) if(ex.Get(i, t)) Print(t.id, " MAE ", t.mae / t.point, " MFE ", t.mfe / t.point);
Also: Count(), Stat(winners, which, percentile), LosersReachedOneR(), WinnersCapture(), StillOpen(), SkippedNoBars().
How it was tested
Spread Heatmap - typical spread for every hour and weekday, in server time or New York time
A table on the chart: the typical spread of the symbol for every hour and weekday, read from the history of your broker. Green is cheap, red is expensive. Hours in server time, UTC or a city with the right summer time. Read-only.
Awesome Oscillator Pullback EA for EURUSD, +209 Percent in a 2021-2026 Backtest
EURUSD EA that trades both directions: when the Awesome Oscillator turns against a weighted moving average filter, it places a stop order at the daily low or high of three days ago, with an ATR stop. Self-contained, no custom indicators. Backtest on EURUSD H1, October 2021 to October 2026: +209% on a 1,000 USD deposit with a fixed 20 USD risk per trade, 15.55% maximum equity drawdown.
MeanReversion: Ornstein-Uhlenbeck fit and optimal trading bands
Exact maximum likelihood of an Ornstein-Uhlenbeck spread and Bertram's optimal entry and exit levels for a given cost, with the expected length of a trade cycle.
ChangePoint: Bayesian online change point detection
Online detection of changes in the mean or volatility (Adams-MacKay): probability of a change in the last k bars, current segment length, forecast, and an indicator.