FX daily Donchian breakout
ResearchEnters on the next daily session after a confirmed 20-day channel breakout and exits using the 10-day channel. MT5 fills with separately estimated exit commission.
EQUITY · BALANCE (USD)
FX_ChannelBreakout · AUDUSD Daily · quality 100% real ticks · drag to zoom, double-click to resetMONTHLY RETURNS
% of balance at month start| Year | Jan | Feb | Mar | Apr | May | Jun | Jul | Aug | Sep | Oct | Nov | Dec | Year |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2025 | -0.6% | -0.1% | -0.2% | -0.4% | · | 0.0% | -0.4% | -0.2% | -0.1% | -0.1% | -0.2% | -0.0% | -2.3% |
| 2026 | · | · | 0.5% | -0.2% | 0.0% | 0.0% | 0.1% | 0.0% | 0.1% | 0.1% | · | · | +0.6% |
TRADE STATS
| Gross profit | 906.94 | Gross loss | -2,530.27 |
| Expected payoff | -73.79 | Total deals | 44 |
| Long trades | 11 (36.4%) | Short trades | 11 (18.2%) |
| Largest win | 495.59 | Largest loss | -213.60 |
| Average win | 151.16 | Average loss | -158.14 |
| Max consec. wins | 4 | Max consec. losses | 7 |
| Balance DD max | 2,248.96 (2.3%) | Equity DD max | 2,365.01 (2.4%) |
| Leverage | 1:100 | Broker | afx Markets Ltd |
All report fields (46)
| History Quality | 100% real ticks |
| Bars | 576 |
| Ticks | 54162867 |
| Symbols | 1 |
| Total Net Profit | -1 623.33 |
| Balance Drawdown Absolute | 2 248.96 |
| Equity Drawdown Absolute | 2 361.81 |
| Gross Profit | 906.94 |
| Balance Drawdown Maximal | 2 248.96 (2.25%) |
| Equity Drawdown Maximal | 2 365.01 (2.36%) |
| Gross Loss | -2 530.27 |
| Balance Drawdown Relative | 2.25% (2 248.96) |
| Equity Drawdown Relative | 2.36% (2 365.01) |
| Profit Factor | 0.36 |
| Expected Payoff | -73.79 |
| Margin Level | 53270.93% |
| Recovery Factor | -0.69 |
| Sharpe Ratio | -0.80 |
| Z-Score | -1.24 (78.50%) |
| AHPR | 0.9993 (-0.07%) |
| LR Correlation | -0.81 |
| OnTester result | 0 |
| GHPR | 0.9993 (-0.07%) |
| LR Standard Error | 387.52 |
| Total Trades | 22 |
| Short Trades (won %) | 11 (18.18%) |
| Long Trades (won %) | 11 (36.36%) |
| Total Deals | 44 |
| Profit Trades (% of total) | 6 (27.27%) |
| Loss Trades (% of total) | 16 (72.73%) |
| Largest profit trade | 495.59 |
| Largest loss trade | -213.60 |
| Average profit trade | 151.16 |
| Average loss trade | -158.14 |
| Maximum consecutive wins ($) | 4 (390.65) |
| Maximum consecutive losses ($) | 7 (-1 269.22) |
| Maximal consecutive profit (count) | 495.59 (1) |
| Maximal consecutive loss (count) | -1 269.22 (7) |
| Average consecutive wins | 2 |
| Average consecutive losses | 4 |
| Correlation (Profits,MFE) | 0.92 |
| Correlation (Profits,MAE) | 0.58 |
| Correlation (MFE,MAE) | 0.3079 |
| Minimal position holding time | 44:59:59 |
| Maximal position holding time | 1608:00:00 |
| Average position holding time | 338:31:25 |
NOTES
Enters on the next daily session after a confirmed 20-day channel breakout and exits using the 10-day channel. The entry-risk setting is 0.20% with a 0.30× notional cap.
ChannelBreakout, Jan 2020–Oct 2026. Fixed-fill exit-fee estimates give +$374.94 on $100,000, +0.005% compounded monthly. The original MT5 statement booked +$389.59 with zero exit commission. Estimated maximum equity drawdown bounds are 2.96% to 2.98%.
ChannelBreakout, Jan 2025–Oct 2026. Fixed-fill exit-fee estimates give −$1,459.94 on $100,000, -0.067% compounded monthly. The original MT5 statement booked −$1,456.49 with zero exit commission. Estimated maximum equity drawdown bounds are 2.06% to 2.07%.
Only the USDJPY full period finished positive after the modeled fee. All six fresh later pair tests lost money.
PARAMETERS
↓ FX_ChannelBreakout.set| Input | Value | Optimise (start / step / stop) | Section |
|---|---|---|---|
| TesterOnly | true | ||
| EntryDays | 20 | ||
| ExitDays | 10 | ||
| RangeDays | 20 | ||
| StopRanges | 2.0 | ||
| RiskPercent | 0.20 | ||
| MaxNotionalTimesEquity | 0.30 | ||
| Magic | 8301520 |
View source
// Close-confirmed Donchian breakout, adapted from the breakout discussion in
// Kakushadze and Serur (2018), 151 Trading Strategies, section 3.15, p. 52.
// All channels exclude the signal day. Execute on the following D1 session.
#property strict
#property version "1.00"
#include <Trade/Trade.mqh>
input bool TesterOnly = true;
input int EntryDays = 20;
input int ExitDays = 10;
input int RangeDays = 20;
input double StopRanges = 2.0;
input double RiskPercent = 0.20;
input double MaxNotionalTimesEquity = 0.30;
input ulong Magic = 8301520;
CTrade trader;
datetime finishedBar = 0;
datetime nextAttempt = 0;
bool AllowedSymbol()
{
string base = SymbolInfoString(_Symbol, SYMBOL_CURRENCY_BASE);
string quote = SymbolInfoString(_Symbol, SYMBOL_CURRENCY_PROFIT);
string currencies = "|USD|EUR|JPY|GBP|CHF|AUD|NZD|CAD|";
string label = _Symbol;
StringToUpper(label);
return StringLen(base) == 3 && StringLen(quote) == 3 && base != quote &&
StringFind(currencies, "|" + base + "|") >= 0 &&
StringFind(currencies, "|" + quote + "|") >= 0 &&
StringFind(label, base + quote) >= 0;
}
int OnInit()
{
if((TesterOnly && !MQLInfoInteger(MQL_TESTER)) || !AllowedSymbol())
{
Print("Run in Strategy Tester on a major or minor FX pair.");
return INIT_FAILED;
}
if(EntryDays < 2 || ExitDays < 1 || ExitDays > EntryDays || RangeDays < 1 ||
StopRanges <= 0 || RiskPercent <= 0 || MaxNotionalTimesEquity <= 0)
return INIT_PARAMETERS_INCORRECT;
trader.SetExpertMagicNumber(Magic);
trader.SetAsyncMode(false);
trader.SetTypeFillingBySymbol(_Symbol);
return INIT_SUCCEEDED;
}
bool Accepted(bool sent)
{
uint code = trader.ResultRetcode();
if(sent && (code == TRADE_RETCODE_DONE || code == TRADE_RETCODE_DONE_PARTIAL))
return true;
PrintFormat("Trading operation failed: %u %s", code, trader.ResultRetcodeDescription());
return false;
}
bool OpenPosition(int side, double averageRange)
{
MqlTick tick;
if(!SymbolInfoTick(_Symbol, tick) || tick.ask <= 0 || tick.bid <= 0)
return false;
double increment = SymbolInfoDouble(_Symbol, SYMBOL_TRADE_TICK_SIZE);
if(increment <= 0) return false;
double minDistance = SymbolInfoInteger(_Symbol, SYMBOL_TRADE_STOPS_LEVEL) * _Point + increment;
double entry = side > 0 ? tick.ask : tick.bid;
double distance = StopRanges * averageRange;
double stop = side > 0
? MathFloor(MathMin(entry - distance, tick.bid - minDistance) / increment) * increment
: MathCeil(MathMax(entry + distance, tick.ask + minDistance) / increment) * increment;
stop = NormalizeDouble(stop, _Digits);
if(stop <= 0) return false;
// OrderCalcProfit converts both risk and notional into deposit currency.
ENUM_ORDER_TYPE order = side > 0 ? ORDER_TYPE_BUY : ORDER_TYPE_SELL;
double stopProfit, onePercentMove;
if(!OrderCalcProfit(order, _Symbol, 1.0, entry, stop, stopProfit) ||
!OrderCalcProfit(order, _Symbol, 1.0, entry, entry * (1.0 - side * 0.01), onePercentMove))
return false;
double equity = AccountInfoDouble(ACCOUNT_EQUITY);
if(equity <= 0 || stopProfit >= 0 || onePercentMove >= 0) return false;
double lots = MathMin(equity * RiskPercent / 100.0 / (-stopProfit),
equity * MaxNotionalTimesEquity / (-100.0 * onePercentMove));
double step = SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_STEP);
if(step <= 0) return false;
lots = MathMin(lots, SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_MAX));
lots = NormalizeDouble(MathFloor(lots / step + 1e-10) * step, 8);
if(lots < SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_MIN))
{
Print("Skipped signal: volume below minimum at the specified risk.");
return true;
}
bool sent = side > 0 ? trader.Buy(lots, _Symbol, 0, stop, 0, "Channel breakout")
: trader.Sell(lots, _Symbol, 0, stop, 0, "Channel breakout");
return Accepted(sent);
}
void OnTick()
{
datetime current = iTime(_Symbol, PERIOD_D1, 0);
if(current == 0 || current == finishedBar || TimeCurrent() < nextAttempt) return;
int count = MathMax(EntryDays + 1, RangeDays + 1);
MqlRates days[];
ArraySetAsSeries(days, true);
if(CopyRates(_Symbol, PERIOD_D1, 1, count, days) != count) return;
double upper = days[1].high, lower = days[1].low;
double exitUpper = days[1].high, exitLower = days[1].low;
for(int i = 1; i <= EntryDays; i++)
{
upper = MathMax(upper, days[i].high);
lower = MathMin(lower, days[i].low);
if(i <= ExitDays)
{
exitUpper = MathMax(exitUpper, days[i].high);
exitLower = MathMin(exitLower, days[i].low);
}
}
double rangeSum = 0;
for(int i = 0; i < RangeDays; i++)
rangeSum += MathMax(days[i].high, days[i+1].close) - MathMin(days[i].low, days[i+1].close);
if(rangeSum <= 0) return;
double lastClose = days[0].close;
int signal = lastClose > upper ? 1 : (lastClose < lower ? -1 : 0);
nextAttempt = TimeCurrent() + 60;
if(PositionSelect(_Symbol))
{
if((ulong)PositionGetInteger(POSITION_MAGIC) != Magic) return;
bool isLong = PositionGetInteger(POSITION_TYPE) == POSITION_TYPE_BUY;
bool close = isLong ? lastClose < exitLower : lastClose > exitUpper;
if(!close)
{
finishedBar = current;
return;
}
ulong ticket = (ulong)PositionGetInteger(POSITION_TICKET);
if(!Accepted(trader.PositionClose(ticket)) || PositionSelect(_Symbol)) return;
}
if(signal == 0 || OpenPosition(signal, rangeSum / RangeDays))
finishedBar = current;
}
FILES
every upload is kept| Type | File | Notes | Size | DL | SHA-256 | Uploaded |
|---|---|---|---|---|---|---|
| BACKTEST | FX_ChannelBreakout_GBPUSD_2025-01-01_2026-11-01_holdout_MT5.html latest | real-tick mode. 2025-01-01 through 2026-10-31. MT5 booked $-2,340.47 with zero commission. The fixed-fill replay of the 0.0014% exit fee estimates $-2,346.30 net without resizing. Every deal and 4 original chart images are included. Orders table omitted to reduce file size. | 117.7 KB | 0 | b7a6998b90a2 | 2026-11-29 08:14 |
| BACKTEST | FX_ChannelBreakout_GBPUSD_2020-01-01_2026-11-01_full_MT5.html latest | real-tick mode. 2020-01-01 through 2026-10-31. MT5 booked $-2,761.55 with zero commission. The fixed-fill replay of the 0.0014% exit fee estimates $-2,777.26 net without resizing. Every deal and 4 original chart images are included. Orders table omitted to reduce file size. | 147.4 KB | 0 | f0b5369b6aea | 2026-11-29 08:14 |
| BACKTEST | FX_ChannelBreakout_AUDUSD_2025-01-01_2026-11-01_holdout_MT5.html latest | real-tick mode. 2025-01-01 through 2026-10-31. MT5 booked $-1,623.33 with zero commission. The fixed-fill replay of the 0.0014% exit fee estimates $-1,627.44 net without resizing. Every deal and 4 original chart images are included. Orders table omitted to reduce file size. | 109.4 KB | 0 | c3ed0a073f53 | 2026-11-29 08:14 |
| BACKTEST | FX_ChannelBreakout_AUDUSD_2020-01-01_2026-11-01_full_MT5.html latest | real-tick mode. 2020-01-01 through 2026-10-31. MT5 booked $-469.09 with zero commission. The fixed-fill replay of the 0.0014% exit fee estimates $-480.60 net without resizing. Every deal and 4 original chart images are included. Orders table omitted to reduce file size. | 133.8 KB | 0 | 050637121aa5 | 2026-11-29 08:14 |
| BACKTEST | FX_ChannelBreakout_EURGBP_2025-01-01_2026-11-01_holdout_MT5.html latest | real-tick mode. 2025-01-01 through 2026-10-31. MT5 booked $-270.33 with zero commission. The fixed-fill replay of the 0.0014% exit fee estimates $-276.90 net without resizing. Every deal and 4 original chart images are included. Orders table omitted to reduce file size. | 109.3 KB | 0 | 84b1cb632902 | 2026-11-29 08:14 |
| BACKTEST | FX_ChannelBreakout_EURGBP_2020-01-01_2026-11-01_full_MT5.html latest | real-tick mode. 2020-01-01 through 2026-10-31. MT5 booked $-4,872.85 with zero commission. The fixed-fill replay of the 0.0014% exit fee estimates $-4,892.55 net without resizing. Every deal and 4 original chart images are included. Orders table omitted to reduce file size. | 143.3 KB | 0 | cce3b7366a22 | 2026-11-29 08:14 |
| BACKTEST | FX_ChannelBreakout_GBPJPY_2025-01-01_2026-11-01_holdout_MT5.html latest | real-tick mode. 2025-01-01 through 2026-10-31. MT5 booked $-1,789.23 with zero commission. The fixed-fill replay of the 0.0014% exit fee estimates $-1,793.48 net without resizing. Every deal and 4 original chart images are included. Orders table omitted to reduce file size. | 111.5 KB | 0 | b6db5513a8d9 | 2026-11-29 08:14 |
| BACKTEST | FX_ChannelBreakout_GBPJPY_2020-01-01_2026-11-01_full_MT5.html latest | real-tick mode. 2020-01-01 through 2026-10-31. MT5 booked $-3,906.64 with zero commission. The fixed-fill replay of the 0.0014% exit fee estimates $-3,919.97 net without resizing. Every deal and 4 original chart images are included. Orders table omitted to reduce file size. | 144.6 KB | 0 | f7235b8ccb63 | 2026-11-29 08:14 |
| BACKTEST | FX_ChannelBreakout_EURUSD_2025-01-01_2026-11-01_holdout_MT5.html latest | real-tick mode. 2025-01-01 through 2026-10-31. MT5 booked $-200.81 with zero commission. The fixed-fill replay of the 0.0014% exit fee estimates $-205.49 net without resizing. Every deal and 4 original chart images are included. Orders table omitted to reduce file size. | 110.0 KB | 0 | 940ab66c54ef | 2026-11-29 08:14 |
| BACKTEST | FX_ChannelBreakout_EURUSD_2020-01-01_2026-11-01_full_MT5.html latest | real-tick mode. 2020-01-01 through 2026-10-31. MT5 booked $-363.59 with zero commission. The fixed-fill replay of the 0.0014% exit fee estimates $-381.48 net without resizing. Every deal and 4 original chart images are included. Orders table omitted to reduce file size. | 144.6 KB | 0 | 478f5e436085 | 2026-11-29 08:14 |
| BACKTEST | FX_ChannelBreakout_USDJPY_2025-01-01_to_2026-11-01_holdout.html latest | FX_ChannelBreakout on USDJPY, Jan 2025–Oct 2026. The original MT5 statement booked −$1,456.49 with zero exit commission. Repricing the same fills for the 0.0014% exit fee gives −$1,459.94. Daily host, MT5 real-tick mode. Includes native settings, results and every deal. Order-request rows are omitted. | 110.1 KB | 0 | b942fb85d7b4 | 2026-11-29 01:22 |
| BACKTEST | FX_ChannelBreakout_USDJPY_2020-01-01_to_2026-11-01_full.html latest | FX_ChannelBreakout on USDJPY, Jan 2020–Oct 2026. The original MT5 statement booked +$389.59 with zero exit commission. Repricing the same fills for the 0.0014% exit fee gives +$374.94. Daily host, MT5 real-tick mode. Includes native settings, results and every deal. Order-request rows are omitted. | 137.4 KB | 0 | 22a832fd8336 | 2026-11-29 01:22 |
| FILE | donchian-breakout-test-windows.csv latest | All measured windows, separately reported by source, size, instrument, tick model and commission treatment. Native P&L and fixed-fill fee estimates have separate columns. | 5.9 KB | 0 | 81862f2556d8 | 2026-11-29 01:22 |
| PARAMS | FX_ChannelBreakout.set latest | Test inputs from the matching source. The public preset uses tester mode and a neutral journal token where supported. | 274 B | 0 | 253dfcf9585b | 2026-11-29 01:22 |
| SOURCE | FX_ChannelBreakout.mq5 latest | Original MQL5 source, matched to the frozen SHA-256. | 5.5 KB | 0 | a0825b70b778 | 2026-11-29 01:22 |