Prop Firm Risk Guard PRO is an Expert Advisor for MetaTrader 5 that watches the whole account against the limits you set, the same kind of limits found in evaluation and challenge rules: daily loss limit, maximum drawdown (static or trailing) and profit targets. When a limit is reached it closes every position, deletes every pending order and keeps the account flat until the next trading day (or until you reset it). It does not open trades of its own outside the Strategy Tester.
What it does
- Watches the balance and the equity of the whole account: every symbol, manual trades and trades of other Expert Advisors.
- Daily loss limit, measured from the balance at the start of the trading day (or the higher of balance and equity).
- Maximum drawdown: static (from the initial balance) or trailing (from the highest balance or the highest equity).
- Total profit target and daily profit target, which lock the result once reached.
- Warning by pop-up, sound or push notification when a part of a limit is used (80% by default).
- While the account is locked, closes at once any new trade or pending order, manual or from another Expert Advisor.
- Panel with the account state, a bar for each limit and the time left until the next trading day.
- Keeps its state per account: the day start, the highest balance or equity and the locks survive a terminal restart.
How to add it to the chart
- Open the Navigator (Ctrl+N), expand Expert Advisors and drag Prop Firm Risk Guard PRO onto any chart. One chart is enough: it guards the whole account, whatever the symbol of the chart.
- In the Common tab, tick Allow Algo Trading, and keep the Algo Trading button of the toolbar on. Without it the guard cannot close trades and the panel says "Algo Trading is off: the guard cannot close trades."
- In the Inputs tab, type the limits of the rules you follow (all inputs are described below), then click OK.
- The guard only acts while the terminal is open and connected. If the computer is switched off, nothing is watched; a VPS keeps it running.
- Only one chart guards an account. A second copy on the same account shows "PASSIVE: guarded from another chart" and takes over by itself a few seconds after the first one is removed.
- Test it first on a demo account, with small limits, to see each lock happen.
The rules it watches
Each limit is typed as a % of the initial balance or as an amount in the account currency (input Limits expressed in). A limit of 0 is off.
- Daily loss limit: how much the account may lose in one trading day. The loss is counted from the reference of the day (the balance at the start of the day, or the higher of balance and equity at that moment) down to the current equity, so open losses count too (unless the input Include open (floating) profit and loss is false). The trading day starts at the server hour you choose.
- Maximum drawdown, static: the equity may not fall more than the limit below the initial balance. The floor never moves.
- Maximum drawdown, trailing from the highest balance or from the highest equity: the floor follows the highest balance (or equity) reached while the guard runs. The amount of the limit stays the same, so each new high raises the floor.
- Profit target, total: gain over the initial balance that, once reached, closes everything and locks the result.
- Profit target, daily: gain over the start of the day that, once reached, closes everything until the next trading day.
Example on a demo account
Demo account with an initial balance of 100,000 USD, limits in % (defaults: daily loss 5%, maximum drawdown 10%, warning at 80%):
- Daily loss limit 5% = 5,000 USD. If the day starts with a balance of 101,000 USD, the account is locked for the day when the equity falls to 96,000 USD. The warning comes at 4,000 USD of loss (equity 97,000 USD).
- Static drawdown 10% = 10,000 USD: the equity must stay above 90,000 USD at all times.
- Trailing drawdown from the highest equity, 10%: if the equity reaches 104,000 USD, the floor moves to 94,000 USD.
- Profit target 8% = 8,000 USD (input set to 8): when the equity reaches 108,000 USD, everything is closed and the account stays locked.
When a limit is reached
The guard closes every open position and deletes every pending order on the account, shows the reason in red on the panel and sends the alert. What happens next depends on the limit:
| Limit reached | Panel | Trading allowed again |
|---|---|---|
| Daily loss limit | LOCKED until hh:mm (daily loss limit) | At the start of the next trading day |
| Daily profit target | LOCKED until hh:mm (daily target reached) | At the start of the next trading day |
| Maximum drawdown | LOCKED (maximum drawdown reached) | Only after a reset (see Clear a drawdown or target lock on start) |
| Total profit target | LOCKED (profit target reached) | Only after a reset |
While locked, with While locked, close any new trade at once on (default), any trade or pending order opened on the account is closed within about a second and the message "Trading is locked: the new trade was closed." is sent. At the start of a new trading day the daily locks are cleared and the message "New trading day: trading allowed again." is sent.
Warnings and alerts
- When the daily loss or the drawdown reaches the % set in Warn when this % of a limit is used (80%), a warning is sent once per limit and per day, for example "Warning: 82% of the daily loss limit used (4100.00 of 5000.00)."; the state bar turns yellow.
- Lock messages state the figures and the time of the next trading day, for example "Daily loss limit reached (5000.00 of 5000.00). Positions closed until 2026.11.15 00:00."
- Alerts can be a pop-up window, a push notification to the phone (set your MetaQuotes ID in Tools > Options > Notifications) and a sound. The sound plays when the pop-up is off, because the pop-up has its own sound.
- Every message is also written to the Experts tab of the terminal.
The panel
The panel is drawn at the top left of the chart and follows the Windows display scale. From top to bottom:
- Title "Prop Firm Risk Guard PRO". The - button collapses the panel; + opens it again.
- State bar: green "TRADING ALLOWED", yellow "WARNING: close to a limit", red "LOCKED ..." with the reason, or grey "PASSIVE: guarded from another chart".
- Balance | Equity in the account currency.
- Three bars: Daily loss, Drawdown and Profit target (or Daily target when only the daily target is on), each with the current value, the limit and what is left. A limit set to 0 shows "off". The bar is green, yellow from the warning level and red at 100%.
- Day start | Initial | New day in hh:mm: the reference of the day, the initial balance and the time left until the next trading day.
- CLOSE ALL NOW: closes every position and deletes every pending order on the account at once, at any time, even without a lock.
- Status line: "Watching the whole account." or the last message.
The panel has no keyboard shortcuts: everything is done with the mouse.
Inputs
ACCOUNT
- Initial balance (0 = balance when first attached) (0): the starting balance of the evaluation, the base of the % limits and of the static drawdown. With 0, the balance at the first start is used and remembered.
- Limits expressed in ("% of the initial balance"): or "Account currency" to type the limits as amounts.
DAILY LOSS
- Daily loss limit (0 = off) (5.0).
- Daily loss measured from ("Balance at the start of the day"): or "Higher of balance and equity at the start of the day", as your rules state.
- Trading day starts at (server hour) (0): the hour of the trading server (0 to 23) when a new trading day begins.
MAXIMUM DRAWDOWN
- Maximum drawdown (0 = off) (10.0).
- Drawdown type ("Static (from the initial balance)"): or "Trailing (from the highest balance)" or "Trailing (from the highest equity)".
PROFIT TARGETS
- Profit target, total (0 = off) (0).
- Profit target, daily (0 = off) (0).
PROTECTION
- Warn when this % of a limit is used (80): level of the warning and of the yellow color.
- Include open (floating) profit and loss (true): with true the limits use the equity; with false only the balance (closed trades) counts.
- While locked, close any new trade at once (true).
- Clear a drawdown or target lock on start (false): set it to true once to remove a drawdown or total target lock when the Expert Advisor starts, then set it back to false.
ALERTS
- Pop-up alert (true), Push notification to the phone (false), Sound (true).
PANEL
- Panel X (pixels at 100% scale) (20), Panel Y (pixels at 100% scale) (60), Font size (9).
Invalid values (negative limits, % limits of 100 or more, a server hour outside 0 to 23, a warning % of 0 or above 100) stop the Expert Advisor from starting, with a message in the Experts tab.
State kept after a restart
- The initial balance, the reference of the day, the highest balance or equity and the current lock are stored in the terminal global variables, per account number. Closing the terminal or changing the inputs does not clear a lock.
- To start a new evaluation on the same demo account, type the new Initial balance and, if a drawdown or target lock is active, use Clear a drawdown or target lock on start. The stored values can also be seen and deleted in Tools > Global Variables (F3): their names start with "JPG." followed by the account number.
Strategy Tester
In the Strategy Tester the guard opens sample trades on the tested symbol (one at a time, closed after 12 bars) so that the bars, the warnings and the locks can be seen working in visual mode. Alerts are not sent in the tester. On a chart, the guard never opens trades.
Tips and frequent questions
- Copy the rules exactly. Check in your rules whether limits are in % or money, from which reference the daily loss is counted, whether the drawdown is static or trailing, and at what time the day changes (in server time).
- Leave a margin. Closing takes a moment and prices can move or gap, so the final loss can be a little larger than the limit. Setting the guard slightly tighter than the rule (for example 4.5% for a 5% rule) gives room.
- The bar does not move. Check that the limit is not 0 ("off") and that this chart is not PASSIVE.
- Locked, but trades stay open. Algo Trading is off or the input While locked, close any new trade at once is false.
- Does it replace the rules of the evaluation? No. It helps you respect the limits you type; the official account statement of your provider is what counts.
Download
Questions and suggestions: send me a private message through my MQL5 profile.
Trading involves risk of loss. The tool executes and manages orders as configured (it closes positions and deletes orders when a limit is reached); test it first on a demo account. Results are not guaranteed, and losses can exceed a limit when prices move fast or gap.


