Strategy Tester: Equity Drawdown Maximal/Relative seems to undersample equity in "every tick real ticks" mode — OnTick captures dips the report misses

 
Hi all,

Looking for a sanity check on Strategy Tester behavior — specifically how the
HTM report's "Equity Drawdown Maximal" and "Equity Drawdown Relative" are
sampled. In a deterministic deal-replay EA I'm running, the per-tick
ACCOUNT_EQUITY values read from OnTick() show drawdowns substantially larger
than what the Strategy Tester report ends up displaying, even with model
"Every tick based on real ticks". Wondering whether this is documented behavior
that I missed, or something worth filing on Service Desk.


─── SETUP ───
- Symbol: XAUUSD+
- Period: M1
- Model: 4 (Every tick based on real ticks)
- Deposit: $10,000   Leverage: 1:500
- EA: deterministic deal replayer — reads a CSV of pre-recorded
  (open_time, side, lot, close_time) per fill and reproduces them deal-by-deal
- Test window: 2020.11.01 → 2025.11.22
- Strategy: high-frequency DCA basket strategy, many fills per basket


─── INSTRUMENTATION ───
In OnTick() the EA does:

   double eq = AccountInfoDouble(ACCOUNT_EQUITY);
   if(eq > g_peak_equity) g_peak_equity = eq;
   double dd_pct = (g_peak_equity > 0) ? (g_peak_equity - eq) / g_peak_equity * 100.0 : 0.0;
   double dd_usd = g_peak_equity - eq;

   // Per-M1-bar accumulator: max DD seen during the bar
   if(dd_pct > g_bar_max_dd_pct) g_bar_max_dd_pct = dd_pct;
   if(dd_usd > g_bar_max_dd_usd) g_bar_max_dd_usd = dd_usd;

At each M1 boundary I dump the per-bar max to a JSONL file via FILE_COMMON.
Standard stuff.


─── STRATEGY TESTER REPORT ───
   Total Net Profit:           304,343.09
   Equity Drawdown Maximal:    38,712.66  (12.44%)
   Equity Drawdown Relative:   14.99%     (9,344.60)
   Balance Drawdown Maximal:   11,353.42  (3.66%)
   Total Deals:                7,804


─── WHAT THE EA SAW PER TICK ───
Bars where OnTick() observed eq_dd_pct ≥ 14% during the same run:

   timestamp              equity      peak       dd_pct    dd_usd
   2024.03.26 13:56:00    53,012      62,360     15.44%    9,629
   2024.03.26 13:57:00    54,401      62,360     15.69%    9,787
   2024.03.26 14:13:00    54,106      62,360     14.12%    8,806
   2024.03.26 14:14:00    54,030      62,360     14.03%    8,749
   2025.10.22 03:13:00    211,701     249,505    15.55%    38,802
   2025.11.20 04:20:00    278,789     311,279    19.43%    60,477   ← max
   2025.11.20 04:21:00    272,583     311,279    17.77%    55,305

The 14.99% / $9,344 from the report appears to match the early 2024-03-26 event
(within spread/rounding). The later 19.43% / $60,477 event on 2025-11-20 is
nowhere in the report's headline stats.


─── SMOKING GUN: 2025.11.20 basket on cand_0076 ───
This basket opens at 04:04:59 and is a 10-fill DCA basket that closes
profitably at 04:32:00. The fills (DCAs) happen on these timestamps:

   ts                   event   fill   lot    price       eq           dd_pct
   2025.11.20 04:04:59  open      1   3.38   4071.26    309,922      0.44%
   2025.11.20 04:05:58  dca       2   3.38   4067.35    308,560      0.87%
   2025.11.20 04:06:58  dca       3   3.38   4067.24    308,459      0.91%
   2025.11.20 04:06:59  dca       4   3.38   4066.03    307,198      1.31%
   2025.11.20 04:07:58  dca       5   3.38   4061.06    300,428      3.49%
   2025.11.20 04:16:58  dca       6   3.38   4059.99    298,602      4.07%
   2025.11.20 04:17:58  dca       7   3.38   4053.83    286,052      8.10%
   2025.11.20 04:18:58  dca       8   3.38   4051.61    280,763      9.80%
   2025.11.20 04:18:59  dca       9   3.38   4051.04    279,184     10.31%
   2025.11.20 04:20:58  dca      10   3.38   4049.46    274,375     11.86%
   2025.11.20 04:32:00  close   (×10 fills closed at price 4059.97)

Note the ~2 minute gap between dca #9 at 04:18:59 and dca #10 at 04:20:58.

During that gap, OnTick() fires repeatedly (real ticks are streaming). The
intra-bar max DD captured by the EA during the 04:20 bar:

   2025.11.20 04:20:00   eq=$250,802   peak=$311,279   dd=19.43% / $60,477

The trough at $250,802 is between trade events. Each individual ACCOUNT_EQUITY
read at that tick agrees: balance ($309,864) + basket floating PnL (~-$59K)
= equity ~$250K. The math is self-consistent.

The report's max equity DD for the same run is $38,712 (12.44%), which roughly
matches what equity looked like at the DCA #10 trade event itself
($274,375 → 11.86%). The intra-bar dip down to $250K never enters the
report's drawdown stats.

The basket closes profitably so there's never a realized loss large enough to
hit the report — but a live trader on this strategy would have seen $60K of
floating loss on a $310K account during that ~2-minute window.


─── QUESTIONS ───
1. Is the Strategy Tester report's "Equity Drawdown Maximal/Relative" computed
   per-tick in real-tick mode, or sampled at trade events (or some other
   cadence)?

2. If sampling is coarser than per-tick, is that documented somewhere? I
   couldn't find it on mql5.com/docs.

3. Are the TesterStatistics() fields (STAT_EQUITY_DD, STAT_EQUITYDD_PERCENT,
   STAT_EQUITY_DDREL_PERCENT) computed from the same sampling, or do they
   reflect true per-tick excursions?

4. Is there a flag or input we can set (config .ini, TesterStatistics(),
   anything) to enable per-tick equity drawdown sampling in the report?

5. If this is not the expected behavior, should I file it on Service Desk
   with a minimal reproducer EA? Happy to provide that and the .htm + .jsonl
   from this run.

Thanks — would appreciate any pointers from people who've looked at this

before, or confirmation from the MQ team if anyone's around.

You can imagine these numbers, especially the relative equity drawdown is crucial to know how to configure both sizing and equity protection on the EA, i always add wiggle room but still i wanna do so based on actual and this has left if a little shook.