Daily Loss Guardian
- Utilitários
-
Felicien Badou Diouf
Professional MQL5 / MT5 Expert Advisor and indicator developer. I turn trading strategies into clean, reliable, well-documented automated systems, with a specialty in XAUUSD (Gold) and prop-firm-compliant risk management.
What I deliver: - Versão: 1.0
- Ativações: 5
An autonomous daily-loss and drawdown kill-switch for prop-firm challenges and live accounts. It locks trading the instant your equity loss crosses your limit, auto-closes every open position - even ones opened manually or by a different EA - and re-arms itself automatically the next trading day.
Most prop-firm breaches happen because a losing day gets away from you before you can react. This tool watches your account equity against the day's starting balance and enforces a hard stop the moment your limit is reached - no need to trust yourself, or any other EA, to pull the plug in time.
WHAT IT DOES
Tracks daily P&L against session-start balance (equity-based, matching how prop firms calculate drawdown).
Locks trading instantly when your daily loss limit is hit - closes ALL open positions, cancels ALL pending orders, regardless of which EA or manual trade opened them.
Optional daily profit kill-switch (lock in a good day and stop, disabled by default).
Warning alert plus sound at a configurable percentage of the limit before the hard stop (default 75%).
Reacts on every incoming trade event (OnTradeTransaction), not just on the next tick - an unauthorized position gets closed within milliseconds of opening while locked.
Smart spread-aware closing: waits briefly for spread to normalize before force-closing in fast markets.
Retry logic on close attempts (configurable attempts and delay) so a rejected close does not leave you exposed.
On-chart dashboard shows balance, equity, P&L, percent of limit used, and current protection state.
Automatically detects when you move the EA to a different account and resets the session cleanly.
Lock state and session data persist through terminal restarts (Global Variables) - protection does not reset just because the platform reopened.
INPUTS
Max daily loss % (of start balance) plus a safety margin (close a touch before the hard limit). Optional daily profit % kill-switch. Warning threshold %, dashboard on/off, alert sound files for warning/loss/profit events. Max spread (points) and wait time before forcing a close in wide-spread conditions. Retry attempts and delay for close operations. Monitoring interval while locked (default 100ms).
WHAT IT DOES NOT DO
It does not analyze the market or place trades - it is a protection layer only. It closes positions at market when triggered; it cannot guarantee zero slippage in fast-moving conditions.
WHO IT IS FOR
Prop-firm challenge traders (FTMO, Five Percent, Finotive, and similar) who want one account-wide safety net instead of relying on manual discipline or a single EA's own risk logic. Anyone running multiple EAs or trading manually who wants a single kill-switch across all of them.
