PropMarshal drawdown protection for algotrading
- Utilitaires
- Joscelyn Eugene Maurice Gainie
- Version: 1.0
The only drawdown guardian that stops your other EAs from digging you deeper.
PropMarshal monitors your account equity in real time and instantly closes all positions the moment a drawdown or profit target threshold is breached. But it doesn't stop there — it closes every chart on your platform too, cutting off any other Expert Advisors before they can open new trades and compound the damage.
The Problem PropMarshal Solves
Most prop firm traders run multiple EAs across multiple charts. When a drawdown limit is hit, the typical approach is to close all open positions — but that leaves the other EAs still running. They don't know the limit was hit. They just keep doing their job: scanning for setups and opening new trades. Each new trade is another loss you're absorbing while already over the line.
PropMarshal closes the charts, not just the trades.
When protection triggers:
- All open positions are closed immediately with market orders
- All pending orders are cancelled
- Every chart on the platform is closed — taking every running EA with it
- Each closed chart is saved as a template so your setup isn't lost
- A Restore Charts button appears on the PropMarshal panel so you can bring everything back with one click when you're ready
For daily drawdown breaches, PropMarshal automatically reopens your charts at the start of the next trading day — no manual action needed.
⚠️ Why this matters: If charts stay open, other EAs will keep opening positions. PropMarshal will catch and close those too, but each cycle creates a small additional loss. With enough EAs running, those micro-losses can push you further over the limit. Closing the charts eliminates the problem entirely.
Features
- Daily Drawdown Protection — tracks loss from the start of each trading day, resets automatically at your configured GMT offset
- Static (Max) Drawdown Protection — monitors total drawdown from initial balance; mirrors the absolute max loss rule common in most prop firm challenges
- Trailing Drawdown Protection — tracks the highest equity watermark achieved and protects a configurable percentage from the peak; directly replicates how many prop firms calculate trailing drawdown
- Profit Target Close-Out — optionally closes all trades when a profit goal is reached, locking in a passing result and preventing overtrading
- Recovery Buffer — applies a configurable safety margin before the hard limit, giving you an early-warning zone and reducing the chance of cutting too close
- Real-Time Dashboard — an on-chart panel shows live drawdown progress per module with colour-coded status (green → yellow → orange → red) so you always know where you stand
- Multi-Channel Alerts — configurable per module: pop-up alert, push notification, email, or all three at once
- State Persistence — daily baseline, peak equity, and last reset time are saved via global variables and survive platform restarts
How Protection Triggers
PropMarshal checks your account equity on every tick and every second via a timer. When any active threshold is breached, it fires in this priority order:
- Daily Drawdown
- Trailing Drawdown
- Static Drawdown
- Profit Target
Once triggered: positions closed → pending orders cancelled → alerts sent → charts closed (if enabled).
Compatibility
- MetaTrader 5 and MetaTrader 4
- Works alongside any other EA — PropMarshal never places trades of its own
- No DLL dependencies
Open Source
The source code is accessible on github here: https://github.com/joscelyn/PropMarshal
Feel free to check the code and add propose new features.
