OPENSTRATS

FX daily Donchian breakout

Research

Enters 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.

SYM AUDUSD,EURGBP,EURUSD,GBPJPY,GBPUSD,USDJPYTF D1TEST 2020-01-01 → 2026-10-31UPDATED VIEWS 0DOWNLOADS 0#breakout

BACKTESTS · 12

6 of 12
NET PROFIT · USD
-364
from 100,000 USD
RETURN
-0.4%
CAGR
-0.1%
6.8 yrs
PROFIT FACTOR
0.95
SHARPE
-0.06
MAX DD
-2.5%
equity, relative
RECOVERY
-0.15
TRADES
73
42.5% win

EQUITY · BALANCE (USD)

FX_ChannelBreakout · EURUSD Daily · quality 99% real ticks · drag to zoom, double-click to reset

MONTHLY RETURNS

% of balance at month start
YearJanFebMarAprMayJunJulAugSepOctNovDecYear
20200.0%0.2%-0.4%·0.0%0.2%0.0%·0.3%-0.3%-0.4%·-0.4%
20210.2%-0.2%0.0%0.2%·0.3%0.3%-0.2%-0.2%0.0%0.0%0.2%+0.6%
2022-0.2%-0.2%0.1%-0.2%0.3%-0.3%0.0%-0.2%-0.2%-0.1%-0.2%·-1.3%
20230.3%-0.0%-0.2%·0.1%0.2%0.3%0.0%·0.2%0.0%0.1%+0.9%
2024-0.2%-0.1%-0.1%0.1%-0.1%-0.2%-0.1%-0.2%-0.1%0.0%0.1%·-0.8%
20250.5%-0.3%0.1%-0.2%-0.3%0.0%0.1%-0.2%-0.2%0.0%0.0%0.0%-0.3%
2026-0.1%-0.2%0.0%0.0%-0.1%·0.3%·-0.0%1.0%··+0.8%

TRADE STATS

Gross profit6,282.52Gross loss-6,646.11
Expected payoff-4.98Total deals146
Long trades39 (33.3%)Short trades34 (52.9%)
Largest win972.04Largest loss-289.33
Average win202.66Average loss-158.24
Max consec. wins4Max consec. losses5
Balance DD max1,983.62 (2.0%)Equity DD max2,485.52 (2.5%)
Leverage1:100Brokerafx Markets Ltd
All report fields (46)
History Quality99% real ticks
Bars2135
Ticks169824714
Symbols1
Total Net Profit-363.59
Balance Drawdown Absolute1 605.70
Equity Drawdown Absolute1 724.05
Gross Profit6 282.52
Balance Drawdown Maximal1 983.62 (1.98%)
Equity Drawdown Maximal2 485.52 (2.47%)
Gross Loss-6 646.11
Balance Drawdown Relative1.98% (1 983.62)
Equity Drawdown Relative2.47% (2 485.52)
Profit Factor0.95
Expected Payoff-4.98
Margin Level33853.05%
Recovery Factor-0.15
Sharpe Ratio-0.06
Z-Score2.13 (96.68%)
AHPR1.0000 (-0.00%)
LR Correlation-0.81
OnTester result0
GHPR1.0000 (-0.00%)
LR Standard Error290.24
Total Trades73
Short Trades (won %)34 (52.94%)
Long Trades (won %)39 (33.33%)
Total Deals146
Profit Trades (% of total)31 (42.47%)
Loss Trades (% of total)42 (57.53%)
Largest profit trade972.04
Largest loss trade-289.33
Average profit trade202.66
Average loss trade-158.24
Maximum consecutive wins ($)4 (965.02)
Maximum consecutive losses ($)5 (-749.82)
Maximal consecutive profit (count)972.04 (1)
Maximal consecutive loss (count)-749.82 (5)
Average consecutive wins1
Average consecutive losses2
Correlation (Profits,MFE)0.89
Correlation (Profits,MAE)0.74
Correlation (MFE,MAE)0.6126
Minimal position holding time13:30:11
Maximal position holding time1272:00:00
Average position holding time419:44:19

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.

InputValueOptimise (start / step / stop)Section
TesterOnlytrue
EntryDays20
ExitDays10
RangeDays20
StopRanges2.0
RiskPercent0.20
MaxNotionalTimesEquity0.30
Magic8301520
FX_ChannelBreakout.mq5144 lines · 5.5 KB · 2026-11-29 ↓ download
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
TypeFileNotesSizeDLSHA-256Uploaded
BACKTESTFX_ChannelBreakout_GBPUSD_2025-01-01_2026-11-01_holdout_MT5.html latestreal-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 KB0b7a6998b90a22026-11-29 08:14
BACKTESTFX_ChannelBreakout_GBPUSD_2020-01-01_2026-11-01_full_MT5.html latestreal-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 KB0f0b5369b6aea2026-11-29 08:14
BACKTESTFX_ChannelBreakout_AUDUSD_2025-01-01_2026-11-01_holdout_MT5.html latestreal-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 KB0c3ed0a073f532026-11-29 08:14
BACKTESTFX_ChannelBreakout_AUDUSD_2020-01-01_2026-11-01_full_MT5.html latestreal-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 KB0050637121aa52026-11-29 08:14
BACKTESTFX_ChannelBreakout_EURGBP_2025-01-01_2026-11-01_holdout_MT5.html latestreal-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 KB084b1cb6329022026-11-29 08:14
BACKTESTFX_ChannelBreakout_EURGBP_2020-01-01_2026-11-01_full_MT5.html latestreal-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 KB0cce3b7366a222026-11-29 08:14
BACKTESTFX_ChannelBreakout_GBPJPY_2025-01-01_2026-11-01_holdout_MT5.html latestreal-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 KB0b6db5513a8d92026-11-29 08:14
BACKTESTFX_ChannelBreakout_GBPJPY_2020-01-01_2026-11-01_full_MT5.html latestreal-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 KB0f7235b8ccb632026-11-29 08:14
BACKTESTFX_ChannelBreakout_EURUSD_2025-01-01_2026-11-01_holdout_MT5.html latestreal-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 KB0940ab66c54ef2026-11-29 08:14
BACKTESTFX_ChannelBreakout_EURUSD_2020-01-01_2026-11-01_full_MT5.html latestreal-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 KB0478f5e4360852026-11-29 08:14
BACKTESTFX_ChannelBreakout_USDJPY_2025-01-01_to_2026-11-01_holdout.html latestFX_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 KB0b942fb85d7b42026-11-29 01:22
BACKTESTFX_ChannelBreakout_USDJPY_2020-01-01_to_2026-11-01_full.html latestFX_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 KB022a832fd83362026-11-29 01:22
FILEdonchian-breakout-test-windows.csv latestAll 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 KB081862f2556d82026-11-29 01:22
PARAMSFX_ChannelBreakout.set latestTest inputs from the matching source. The public preset uses tester mode and a neutral journal token where supported.274 B0253dfcf9585b2026-11-29 01:22
SOURCEFX_ChannelBreakout.mq5 latestOriginal MQL5 source, matched to the frozen SHA-256.5.5 KB0a0825b70b7782026-11-29 01:22

MORE FX STRATEGIES

all FX →