Most prop firm challenges are not failed by a bad strategy. They are failed by breaking the daily loss rule by a few dollars - one trade left open too long, a spread spike at rollover, or one more "revenge" trade. Prop Firm Equity Guard watches your equity 4 times per second and closes everything before the limit is reached.
The EA does not open trades. It works next to your manual trading or any other Expert Advisor on the same account.
LIMITS (all based on equity, including floating profit and loss)
- Daily loss limit in % - base is the balance at the daily reset, or the higher of balance and equity (choose the rule of your firm)
- Maximum loss limit in % - static (from the initial account size) or trailing (from the highest equity, stopping at the initial size)
- Profit target in % - optional: close all and lock when the target is reached, so you do not give it back
- Safety buffer - acts a little before the real limit (default 0.5%) to allow for slippage and spread
WHAT HAPPENS AT A LIMIT
- All positions are closed and all pending orders are deleted
- The account is locked: any new trade opened while locked is closed at once (can be switched off)
- Daily lock is released automatically at the next daily reset; maximum loss and target locks stay until you clear them
- Locks and statistics are saved in terminal global variables, so they survive a terminal restart or VPS reboot
- If closing fails (for example, the market is closed), the EA keeps retrying and shows the reason on the panel
ALERTS
- Popup and push notification at 50% and 80% of the daily limit used (adjustable), and when a lock is triggered
PANEL
- Status: active or locked (with the reason)
- Equity and balance
- Daily loss used, maximum loss used and profit target progress, each with an amount, a percentage and a colour bar (teal, amber from 50%, red from 80%)
- Daily floor and maximum floor equity levels
- Time to the next daily reset
Inputs:
- Account rules: initial account size (0 = balance when first attached), daily loss %, daily loss base, maximum loss %, maximum loss mode (static / trailing), profit target %, safety buffer %
- Daily reset: hour and minute in server time (set this to your firm's reset time)
- Actions: all trades or one magic number, close new trades while locked, lock on target, clear saved locks on start
- Alerts: popup, push, first and second warning levels
- Panel: show, X and Y position
How to use:
1. Attach the EA to any one chart of the account (only one copy per account).
2. Enter the rules of your firm: account size, daily %, maximum %, target %, and the daily reset time.
3. Enable Algo Trading. The panel shows the floors - check that they match your firm's dashboard.
4. Keep the terminal running (a VPS is recommended): the guard can only act while the terminal is online.
Notes:
- Every firm calculates limits a little differently. Always compare the floors on the panel with your firm's rules and keep a safety buffer.
- The guard reduces risk but cannot prevent gaps or slippage beyond the limit, and it cannot act while the terminal is offline.
- To start a new challenge on the same account number, set "Clear saved locks and statistics on start" = true once, then back to false.
Tested on demo accounts (hedging and netting) in MetaTrader 5, with manual trades and with other Expert Advisors on the same account.
