How daily drawdown is actually counted (and why your EA misses it)
Disclosure: some pages on this site contain affiliate links.
Two accounts, the same trades, the same firm-style rules. One passes, one is disqualified. The difference is not the market. It is which hour the day starts, whether the baseline is balance or equity, and what happens to trades you carry overnight.
1. The reset hour is not your broker's midnight
Most rulebooks reset the daily limit at a fixed hour in a stated time zone. Your MT4 terminal reports the broker's server time, which is usually GMT+2 or GMT+3 and shifts with daylight saving.
If your EA compares dates using TimeCurrent() without converting, its "day" starts at the wrong hour. In one system I audited, the offset let the account lose the equivalent of −5.9% inside a single rule day while the limit was −5%. Nothing in the backtest report showed it.
Check: what time zone does the rulebook name, what is your server's offset today, and does your EA convert between them? US and EU daylight saving start on different dates — in 2026 they are 28 days apart.
2. Balance or equity decides a different number
Some firms measure the day from the balance at the reset, some from equity. If you hold a losing position through the reset, the two baselines differ by exactly that floating loss, and so does the room you have left.
This is a reading task, not a coding preference: take the sentence from the rulebook, then make the EA count the same way.
3. Blocking new trades does not stop the day
A guard that stops opening new positions still lets yesterday's positions hit their stop loss today. On my own demo account, on a day where new entries were already blocked, the account still went to −3.11%.
To hold a daily limit you have to count what is already on the table:
// MQL4: how much is still at risk if every open stop is hit
double OpenRisk() {
double risk = 0;
for (int i = OrdersTotal() - 1; i >= 0; i--) {
if (!OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) continue;
if (OrderStopLoss() == 0) continue; // no stop = report it, do not ignore it
double d = MathAbs(OrderOpenPrice() - OrderStopLoss());
risk += d / MarketInfo(OrderSymbol(), MODE_TICKSIZE)
* MarketInfo(OrderSymbol(), MODE_TICKVALUE) * OrderLots();
}
return risk;
}
bool CanTrade() {
double used = DayStartEquity - AccountEquity();
double limit = DayStartEquity * 0.05; // your rulebook's number
return (used + OpenRisk() + NextTradeRisk()) < limit;
}
4. Two EAs, one account
Each EA can respect the limit inside itself and still break it together. In one combination I measured, the total stop-loss exposure of two "compliant" systems reached 3.75% against a 3% cap, because neither counted the other's positions.
If you run more than one system, the limit check has to read the whole account, not MagicNumber.
5. What the backtest will never tell you
- The tester does not restart, so it never reproduces the duplicate order that appears after a VPS reboot
- The tester runs one EA, so it never shows the combined exposure of two
- The tester uses its own clock, so a wrong GMT offset can stay invisible
- Higher-timeframe data that your terminal never opened can be weeks old — a live order of mine sized its stop from a 15-minute candle that was a month stale
Check your own account in 10 minutes
- Write down the reset hour and time zone from the rulebook, and today's server offset
- Decide, from the same rulebook, whether the baseline is balance or equity
- Open a demo, hold a position, close and reopen the terminal — count the positions
- Run the numbers: lot size and the stop line for the day (free, no sign-up)
None of this makes a strategy profitable. It decides whether a normal losing streak ends your challenge.
よくある質問
Does daily drawdown reset at midnight?
It resets at the hour named in the rulebook, in the time zone named there, which is often not your broker's midnight. Broker server time is usually GMT+2 or GMT+3 and changes with daylight saving, so an EA that compares dates using server time can count a different day.
Is daily drawdown measured from balance or equity?
Both exist. Read the sentence in your rulebook and make the EA count the same way. If you carry a losing position through the reset, the two baselines differ by that floating loss.
If my EA stops opening new trades, is the daily limit safe?
No. Positions carried from the previous day can still hit their stops and count against today. On a demo account where new entries were blocked, the day still reached -3.11%.