Prop Firm Equity Guard: Daily Loss and Max Drawdown Protector
Info
The Prop Firm Equity Guard: Daily Loss and Max Drawdown Protector is a Expert Advisor for MetaTrader 5 that prop firm equity guard ensures your trading challenge or funded account adheres to firm rules. It monitors your account's live equity, including floating profits and losses, against your firm's specified daily loss and maximum drawdown limits.
Usage
This tool is typically used for automated trading on major forex pairs and gold.
Platform
This Expert Advisor works exclusively on MetaTrader 5 (both build 600+ and newer versions).
Setup
Place the downloaded file in MQL5/Experts folder via File ? Open Data Folder in MetaTrader 5.
How to Install and Use Prop Firm Equity Guard: Daily Loss and Max Drawdown Protector
1. Installation: Open the "File" menu, select "Open Data Folder," navigate to MQL/Experts, paste your file, and restart the terminal.
2. Activation: Drag the EA from the Navigator onto a chart, ensure "Allow live trading" is checked in the Common tab, and verify the AutoTrading button is green.
3. Optimization: Right-click your chart, choose "Expert List," click "Properties" to adjust inputs, and save your preferred setup as a set file for future use.
4. Maintenance: Regularly check the "Experts" tab in the terminal window to monitor trade logs and potential execution errors.
Frequently Asked Questions
Q: Why is my EA not opening trades? A: Check the "AutoTrading" button, ensure "Allow live trading" is enabled, and verify your broker allows automated trading on your account type.
Q: Can I run multiple EAs on one chart? A: No, each chart can only host one active EA; however, you can open multiple charts for different currency pairs to run several EAs.
Q: What does the "smiley face" icon mean? A: A smiley face in the top-right corner of the chart indicates the EA is successfully running; a frowny face means it is disabled.
What this tool does
Prop Firm Equity Guard ensures your trading challenge or funded account adheres to firm rules.
Typical Use Case
This Expert Advisor excels in automated trading and technical analysis on MetaTrader 5.
Compatible Platform & Setup
This Expert Advisor works on MetaTrader 5. Place the file in the MQL5/Experts folder and restart the terminal.
Description & Settings
Related: Prop Firm Guard - Protect Your Funded Account - another powerful expert for MetaTrader 5 traders.
Prop Firm Equity Guard ensures your trading challenge or funded account adheres to firm rules.Also recommended: Prop Firm Daily Profit Lock - similar expert with strong performance on MetaTrader 5.
It monitors your account's live equity, including floating profits and losses, against your firm's specified daily loss and maximum drawdown limits.
When nearing these limits, the tool automatically closes all open positions, removes pending orders, and disables further trading before the firm's threshold is breached.
This utility is compatible with all trading styles, whether manual trading, other Expert Advisors (EAs), or trades initiated from mobile devices.
Prop Firm Equity Guard does not open any trades itself.
FEATURES
- Daily Loss Protection: Configurable as a percentage of the starting balance, a percentage of the day's starting equity, or a fixed monetary amount.
Day-Start Reference Options: Can use balance, equity, or the higher of the two values at the time of the daily reset.
- Maximum Drawdown Protection: Supports static drawdown limits, trailing protection based on the equity high-water mark, or trailing based on the balance high-water mark. An option is available to cap the trailing drawdown at the initial starting balance.
- Safety Buffer: Activates pre-emptively (e.g., at 90% of the limit) to account for potential slippage and spread fluctuations.
- Hard Lock Mechanism: Any trades opened while the account is locked are immediately closed.
Daily loss locks are reset at the next trading day's start; maximum drawdown locks are permanent by default.
- Optional Profit Target Lock and Daily Profit Cap features are available.
- Early Warning System: Provides alerts via pop-up messages, sounds, and push notifications.
- State Persistence: Retains lock information, day-start balance, and high-water marks across terminal restarts.
- Mid-Day Attachment: If attached during the trading day, the day-start balance is reconstructed using the day's trading history.
- Monitoring Frequency: Checks account status every 250 milliseconds and upon every trade event, independent of chart price ticks.
- On-Chart Dashboard: Displays real-time usage bars, remaining buffer, guard levels relative to firm limits, and a countdown to the next reset.
HOW TO USE
1. Attach the EA to ONE chart of the account you wish to protect. The symbol on the chart does not matter.
2. Ensure Algo Trading is enabled in your MetaTrader platform. A warning will appear on the panel if it is not.
3. Input your account size, daily loss limit, maximum drawdown limit, and the broker's server reset time (in server time) to accurately reflect your prop firm's rules.
4. If starting a new challenge on the same trading account login, set the 'Wipe saved state' option to true once to ensure a clean start.
HOW IT WORKS
Daily Guard Level = (DayStartReference - DailyLossLimit) + (DailyLossLimit * BufferPercentage)
Drawdown Guard Level = Floor + (MaxDrawdown * BufferPercentage)
The 'Floor' is calculated as StartingBalance - MaxDrawdown for static limits, or HighWaterMark - MaxDrawdown for trailing limits. The trailing limit can optionally be capped at the StartingBalance.
When the account equity reaches a calculated guard level, the EA will flatten the account using the CTrade function, save the lock status in the terminal's global variables, and continuously close any new trades opened via OnTradeTransaction until the lock period expires.
NOTES
- The MetaTrader terminal must be running for the EA to operate. A Virtual Private Server (VPS) is highly recommended for continuous protection.
- MetaTrader's order execution system does not prevent an order from being sent. The EA closes such orders within milliseconds, but spread and commission costs may still apply.
- Significant price gaps can potentially exceed the guard level before the EA can react. For highly volatile instruments such as gold or indices, it is advisable to use a larger buffer percentage.
- Always verify the EA's settings against your prop firm's most current trading rules. All settings were last updated in 2026.
You may also like: Prop Firm Equity Guard: Protect Your Challenge - excellent alternative for expert users on MetaTrader 5.
Source Code
#property copyright "RobotFX"
#property version "1.00"
#property description "This code is educational. Feel free to use, modify and upgrade as you wish. Visit ROBOTFX.ORG for professional trading tools"
#include <Trade\Trade.mqh>
enum ENUM_LIMIT_MODE
{
LIMIT_PERCENT = 0,
LIMIT_MONEY = 1
};
enum ENUM_PCT_BASE
.......
⚠ Limitations & Risk Warning
- This tool is provided for educational and testing purposes only.
- Past performance does not guarantee future results.
- Trading involves substantial risk of loss. Use on a demo account first.
- Results may vary depending on market conditions, broker, and settings.
- We recommend thorough backtesting and forward testing before using with real funds.