Many multi-EA traders and prop-firm challengers get surprised when their daily loss limit triggers even though closed trades for the day are flat or slightly positive.
In practice, two mechanics cause almost all unexpected daily drawdown breaches in MetaTrader 5:
1. At the 00:00 server reset, most evaluation rules anchor the new daily reference on Max(Balance, Floating Equity) rather than closed Balance alone. Carrying open unrealized profit across midnight raises the daily high-water mark, so a normal pullback the next morning counts directly against the daily allowance.
2. Between 23:00 and 00:15 server time, raw ECN spreads routinely widen 5x to 35x, creating brief floating equity dips (plus overnight swaps) that never show up in M1 OHLC Strategy Tester runs.
What This Indicator Does (100% Read-Only, Zero Orders, Zero DLLs):
Attach Azimuth_Midnight_Drawdown_HUD.mq5 to any MetaTrader 5 chart. It updates once per second and on every incoming tick without placing or modifying any trades:
- Exact Midnight Anchor Tracking: supports Max(Balance, Equity) at reset (default), Balance Only, or Equity Only, at any configurable server reset hour/minute.
- Restart-Safe Persistence: stores today's midnight anchor and worst intraday floating drawdown peak in account-scoped GlobalVariables so restarting MT5 mid-session does not erase the true 00:00 reference (automatically isolated inside Strategy Tester).
- Remaining Daily Buffer: displays live Daily DD (% and account currency), Today's Peak DD, and exact remaining distance before your configured limit (default 5.0%, warning state at 80% of limit).
- Per-Magic-Number Attribution: aggregates closed deals since reset + open floating P&L + swaps by Magic Number (sorted worst-first) so you can immediately see which EA is consuming your daily drawdown budget.
- Live & 23:00-00:15 Rollover Spread Tracker: displays current spread in pips alongside today's max spread and the 23:00-00:15 rollover peak.
Inputs:
- InpAnchorMode: Max(Balance, Equity) at Reset | Balance Only | Equity Only
- InpResetHour / InpResetMinute: Broker server reset time (default 00:00)
- InpMaxDailyLossPct: Daily drawdown limit in percent (default 5.0)
- InpWarnRatioPct: Warning color threshold as % of limit (default 80.0)
- InpRolloverSpikePips: Spread highlight threshold in pips (default 3.0)
- InpCornerX / InpCornerY: Chart pixel coordinates for the HUD panel