Prop Firm Guard: Daily Loss and Max Drawdown Protection
Info
The Prop Firm Guard: Daily Loss and Max Drawdown Protection is a Expert Advisor for MetaTrader 5 that prop firm guard safeguards challenge and funded accounts by preventing breaches of the two most common prop firm rules: the daily loss limit and the maximum drawdown. This tool does not initiate trades.
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 Guard: Daily Loss and Max 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 Guard safeguards challenge and funded accounts by preventing breaches of the two most common prop firm rules: the daily loss limit and the maximum drawdown.
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 Guard safeguards challenge and funded accounts by preventing breaches of the two most common prop firm rules: the daily loss limit and the maximum drawdown.Also recommended: Prop Firm Equity Guard: Daily Loss and Maximum Drawdown Protection - similar expert with strong performance on MetaTrader 5.
This tool does not initiate trades. Simply attach it to any chart and continue your trading activities, whether manual or using other Expert Advisors. Prop Firm Guard monitors your account equity every second. Upon reaching a specified limit, it performs the following actions:
Closes all open positions on the account.
Deletes all pending orders.
Optionally closes any new trade opened while the limit is still active.
Displays an alert and sends a push notification if enabled.
The protection for the daily loss limit remains active until the next daily reset. The maximum drawdown protection stays active until deactivated.
All actions taken by Prop Firm Guard are logged in the Experts log, including limit breaches, position closures, and order deletions.
Symbol and Timeframe
Prop Firm Guard operates independently of the symbol or timeframe. It monitors the entire account. Therefore, attach it to a single chart of any symbol and timeframe. Ensure only one instance of the EA is running per account.
Limit Measurement Methods
Account Size: This is the initial balance of your trading challenge. Set to 0 to use the current account balance.
Daily Loss: Measured from a reference point established at the beginning of each trading day. This reference can be either the account balance or the higher value between the balance and equity, depending on the prop firm's rule.
Maximum Drawdown: Can be set as a static value calculated from the initial account size, or as a trailing drawdown that follows the highest equity reached.
Safety Margin: This feature allows the EA to act slightly before the actual limit is reached, providing a buffer for slippage and spread.
The EA's state is saved, ensuring protection persists through terminal restarts, chart changes, or disconnections. The chart display provides the current status, including equity, daily loss utilized, drawdown utilized, and the time of the next daily reset.
Input Parameters
Account size (0 = use current balance)
Max daily loss (%) - default is 5
Max total drawdown (%) - default is 10
Safety margin: act earlier by (%) - default is 0
Daily loss reference - choose between balance or higher of balance and equity
Drawdown mode - choose between static or trailing
Reset hour (server time, 0-23) - configure this to match your prop firm's reset time
Keep closing new trades while a limit is hit
Warn when this % of a limit is used (0 = off) - default is 80
Send push notifications
Reset saved state on start - primarily for clearing blocks during testing; keep this off during normal operation.
Important Considerations
Verify the precise rules of your prop firm, including limit values, daily reset times, and whether balance or equity is used as the reference. These rules vary significantly between firms.
Prop Firm Guard reacts to the price data it receives. In volatile market conditions, during gaps, or with significant slippage, the final realized loss might exceed the specified limit. Utilizing the safety margin can help mitigate this by triggering action earlier.
Ensure your MetaTrader 5 terminal remains open and connected, or utilize a Virtual Private Server (VPS). The protection features are only active while the terminal is running and connected.
Algo Trading must be enabled within MetaTrader 5 for the EA to execute trade and order closures.
This tool is designed to assist you in adhering to risk management limits. It does not guarantee success in passing a prop firm challenge or maintaining a funded account.
Copyright 2026
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 link "https://robotfx.org"
#property version "1.02"
#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_REF
{
DAILY_REF_BALANCE = 0,
DAILY_REF_HIGHER = 1
};
.......
⚠ 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.