Prop Firm Equity Guard: Protect Your Challenge
Info
The Prop Firm Equity Guard: Protect Your Challenge is a Expert Advisor for MetaTrader 5 that most prop firm challenges are not failed by a flawed strategy. They are often lost due to exceeding the daily loss limit by a small margin – perhaps from a single trade left open too long, a spread spike during rollover, or an impulsive “revenge” trade.
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: Protect Your Challenge
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
Most prop firm challenges are not failed by a flawed strategy.
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.
Most prop firm challenges are not failed by a flawed strategy. They are often lost due to exceeding the daily loss limit by a small margin – perhaps from a single trade left open too long, a spread spike during rollover, or an impulsive “revenge” trade. Prop Firm Equity Guard monitors your account equity four times per second, closing all positions before any limit is breached.Also recommended: Prop Firm Daily Profit Lock - similar expert with strong performance on MetaTrader 5.
This Expert Advisor (EA) does not initiate trades. It operates alongside your manual trading activities or other EAs on the same account.
Configurable Limits (all based on equity, including floating profit and loss):
- Daily Loss Limit (%): Calculated from the balance at the daily reset, or the higher of balance and equity (configurable to match your firm's specific rule).
- Maximum Loss Limit (%): Can be set as a static value (based on the initial account size) or a trailing value (based on the highest equity reached, but not dropping below the initial account size).
- Profit Target (%): An optional setting to close all trades and lock the account once the profit target is achieved, preventing you from giving back gains.
- Safety Buffer (%): A small margin set slightly before the actual limit to account for potential slippage and spread fluctuations (default is 0.5%).
Actions When a Limit is Reached:
- All open positions are immediately closed, and all pending orders are deleted.
- The account is locked: any new trade initiated while locked will be instantly closed (this feature can be disabled).
- Daily loss locks are automatically released at the next daily reset. Maximum loss and profit target locks remain active until manually cleared.
- Lock statuses and trading statistics are persistently saved in the terminal's global variables, ensuring they are retained even if the terminal or your VPS restarts.
- If an immediate closure fails (e.g., due to market conditions), the EA will repeatedly attempt the closure and display the reason on the panel.
Alerts:
- Receive popup and push notifications when 50% and 80% of the daily loss limit are approached (these thresholds are adjustable), and also when a lock is triggered.
On-Screen Panel:
- Status Display: Indicates whether the EA is active or locked (including the reason for the lock).
- Equity and Balance: Shows current equity and balance figures.
- Progress Indicators: Displays daily loss usage, maximum loss usage, and profit target progress. Each shows the amount used, percentage achieved, and a color-coded bar (teal, amber from 50%, red from 80%).
- Floor Levels: Shows the daily floor equity level and the maximum floor equity level.
- Time to Reset: Displays the time remaining until the next daily account reset.
Input Parameters:
- Account Rules: Initial account size (set to 0 to use the balance when the EA is first attached), daily loss percentage, daily loss calculation base (balance at reset or equity), maximum loss percentage, maximum loss mode (static or trailing), profit target percentage, and safety buffer percentage.
- Daily Reset: Specifies the hour and minute of the daily reset in server time (configure this to match your prop firm's reset time).
- Actions: Options to close all trades or trades associated with a specific magic number, close new trades while locked, lock the account upon reaching the profit target, and clear saved locks upon starting the EA.
- Alerts: Enable or disable popup and push notifications, and set the first and second warning levels.
- Panel: Control the visibility of the panel and set its X and Y position on the chart.
Usage Instructions:
1. Attach the EA to any chart within your account. Only one instance of the EA should be run per account.
2. Input your prop firm's specific rules: account size, daily loss percentage, maximum loss percentage, profit target percentage, and the daily reset time.
3. Ensure Algo Trading is enabled. The on-screen panel will display the calculated floor levels; verify that these accurately correspond to your firm's stated rules.
4. Keep your MetaTrader terminal running continuously (using a VPS is highly recommended) as the guard can only function when the terminal is online.
Important Notes:
- Prop firm limit calculations can vary slightly. Always cross-reference the floor levels shown on the panel with your firm's official rules and maintain a reasonable safety buffer.
- While this EA significantly reduces risk, it cannot prevent losses due to market gaps or slippage exceeding the defined limits, nor can it operate if the terminal is offline.
- To initiate a new challenge using the same account number, set the 'Clear saved locks and statistics on start' option to true once, then revert it to false for subsequent trading sessions.
This EA has been tested on demo accounts (both hedging and netting modes) in MetaTrader 5, supporting manual trades and other Expert Advisors running concurrently on the same account.
Last updated: 2026
You may also like: Prop Firm Equity Guard: Daily Loss and Max Drawdown Protector - excellent alternative for expert users on MetaTrader 5.
Source Code
#property copyright "RobotFX"
#property link "https://robotfx.org"
#property version "1.10"
#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_BALANCE = 0,
DAILY_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.