Prop Firm Equity Guard: Daily Loss and Maximum Drawdown Protection
Info
The Prop Firm Equity Guard: Daily Loss and Maximum Drawdown Protection is a Expert Advisor for MetaTrader 5 that prop firm equity guard is designed to prevent traders from violating common proprietary trading firm rules. This tool monitors account equity in real-time.
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 Maximum Drawdown Protection
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 is designed to prevent traders from violating common proprietary trading 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 Guard Lite: Daily and Max Loss Protection for Prop Firm Accounts - another powerful expert for MetaTrader 5 traders.
Prop Firm Equity Guard is designed to prevent traders from violating common proprietary trading firm rules.Also recommended: Prop Firm Guard: Daily Loss and Max Drawdown Protection - similar expert with strong performance on MetaTrader 5.
This tool monitors account equity in real-time. Upon reaching a predefined limit, it automatically closes all open positions and deletes pending orders. It will continue to block new trades until the enforced lockout period expires.
The EA functions alongside manual trading and other Expert Advisors on the same account. It does not initiate trades on a live chart.
Rules Enforced
Daily Loss Limit
This limit is measured against the account balance, equity, or the higher of the two at the beginning of the trading day. If the equity drops below this threshold minus the specified limit, all trading activity is halted until the next daily reset.
Maximum Loss
This is calculated based on the initial account balance. Once this limit is breached, trading is permanently blocked until the EA is reset.
Profit Target (Optional)
This feature automatically closes all trades once the equity reaches the specified profit target, helping to secure a passed challenge.
Early Warnings
Receive alerts and push notifications when a set percentage (default 80%) of any limit has been approached.
Features
Status Panel on Chart: Displays lock status, current equity, daily loss utilized, maximum loss utilized, profit target, and the starting value for the day.
Persistent State Saving: The EA saves its state in global terminal variables. This ensures that restarting the terminal or the EA does not reset the daily starting value or an active lock.
Configurable Daily Reset Hour: Set the daily reset time to align with your firm's server time.
Trade Filtering: Manage all trades on the account, trades associated with a specific magic number, or only trades on the current chart symbol.
Real-time Monitoring: Checks trades on every tick for the chart symbol and uses a timer for checks once per second, ensuring trades on other symbols are also monitored.
Input Parameters
InpDailyLossPct
- The daily loss limit as a percentage (default is 5%).
InpDailyBase
- Determines the basis for measuring the daily loss: Balance, Equity, or the Higher of both at the day's start.
InpMaxLossPct
- The maximum overall loss allowed, expressed as a percentage of the initial balance. Setting this to 0 disables the feature.
InpInitialBalance
- The initial balance of the trading challenge. Set to 0 to use the balance when the EA is first attached.
InpProfitTargetPct
- The profit target in percent. Setting this to 0 disables the feature.
InpResetHour
- The hour for the daily reset, based on server time.
InpWarnLevel
- The percentage of a limit at which a warning alert is triggered.
InpMagic
- Filters trades by magic number. Set to -1 to manage all trades on the account.
InpAllSymbols
- Choose to manage all symbols or only the symbol of the current chart.
InpPushAlerts
- Enable sending push notifications to your MT5 device.
InpTesterDemo
- In the Strategy Tester only, this option opens one sample trade per day to allow observation of the guard's locking and releasing behavior. It has no impact on live trading charts.
Important Considerations
The guard closes trades at the first available price update after a limit is breached. During volatile market conditions, such as at the weekly open or during news events, the final realized loss may exceed the set limit due to slippage and market gaps. It is advisable to set your limits slightly below your firm's official requirements (e.g., 4.5% for a 5% daily rule). Ensure AutoTrading remains enabled in your terminal for the EA to execute trade closures effectively. Always verify the precise definitions of your trading firm's rules.
Performance in Strategy Tester:
Tested on EURUSD H1 from January to February 2026, with a 2% daily limit and a 10% maximum loss. The test resulted in 10 daily locks with automatic release at the next reset, one permanent maximum loss lock, and no trade closure failures.
You may also like: Advanced Prop-Firm Trade Panel with Support/Resistance Finder for MT5 - 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_DAILY_BASE
{
DAILY_BASE_BALANCE,
DAILY_BASE_EQUITY,
DAILY_BASE_HIGHER
};
.......
⚠ 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.