Prop Rules Guard MT5
- Utilitaires
-
Allan Aparece Ninal
Je développe des indicateurs et des Expert Advisors pour MetaTrader 5.
Ma façon de travailler :
- Chaque indicateur est vérifié contre le repaint : les signaux sont décidés uniquement sur des barres clôturées, et un test sur chaque tick confirme qu'ils ne changent plus ensuite. - Version: 1.4
- Mise à jour: 26 novembre 2026
- Activations: 10
Prop Rules Guard MT5 is a utility (Expert Advisor) for MetaTrader 5 that keeps a prop-firm account inside its daily loss limit and max loss. It measures both on equity, the way the firm does. At a safety buffer before a limit, it closes your trades and keeps the account flat until the reset. Run the free demo in the Strategy Tester's visual mode before you decide.
It never opens a trade. It works with manual trading and with other Expert Advisors on the same account.
In plain words
A prop firm lets you trade its money under strict rules. Two limits matter most. The daily loss limit says how far your account may fall in one day. The max loss says how far it may fall in total. Break either one and the account is usually closed.
The firm measures them on equity, which is your balance plus the open profit or loss. Open trades can use up your room fast, and a manual trade or an EA will not stop by itself.
The Guard watches your equity against the firm's limits. It does not wait for the floor. At a safety buffer before it, 90% of the limit by default, it deletes pending orders and closes your positions. Then it keeps the account flat until the firm's next daily reset.
It also tracks consistency rules, news windows and a profit target. It shows the largest lot a new trade can take inside the room that is left.
The buffer lowers the chance of touching a limit. It cannot remove it. A fast market or a gap can fill a close beyond the floor.
What it does, step by step
- You pick your firm in Firm preset, or enter the rules yourself. The Guard works out the day start at the firm's reset time, the daily floor and the max loss floor.
- On every tick, and every half second, it compares your equity with both floors. The panel shows the room left and the share of each limit used.
- At the warning level (75% by default) it sends a pop-up and a push notification.
- At the safety buffer (90% by default) it locks. It deletes pending orders and closes every position in scope. Anything opened while locked is closed at once.
- A daily lock ends at the firm's reset. A max-loss lock stays until you press Reset twice within 5 seconds. The lock is stored in the terminal, so a restart does not lift it.
It never opens a trade on a live or demo account and never sets or changes a stop loss or take profit.
Worked example
Strategy Tester, XAUUSD H1, 1 September 2026, deposit 10,000 USD, default rules (5% daily limit, 10% static max loss), warning at 75%, lock at 90%. The tester's demo trade (0.5 lot) is the only trade, so there is something to guard.
| Server time | What happened |
|---|---|
| 04:00 | The demo trade buys 0.5 lot at 4453.80. Day start 10,000.00, floor 9,500.00, lock level 9,550.00 (90% of the 500.00 limit). |
| 04:10 | Warning: 85% of the loss limit used, 26.00 left before the lock. |
| 04:15 | Equity is 9,512.00 (98% used). The Guard locks and closes the trade at 4444.04. The lock lasts until 01:00 the next day, the Prague reset. |
| 08:00 to 20:00 | The tester forces four more demo trades through the lock. The Guard closes each at once, and each costs the spread (6.50 to 10.50). |
| Day end | Lowest equity 9,475.00, which is 25.00 below the daily floor. |
The Guard also shows a limit of closing. At 04:15 the price had already moved past the lock level, and the four forced trades each cost a spread. A lock lowers the risk. It cannot guarantee the floor.
At 01:00 the next day the log shows "new trading day - unlocked".
Key facts
| Type | Utility (Expert Advisor) with a panel on the chart, for MetaTrader 5. Needs Algo Trading on, to close trades. |
| What it changes | It closes positions at market and deletes pending orders in its scope. It never opens a trade. It never sets or changes a stop loss or take profit. |
| Lot size | None, because it does not trade. In the Strategy Tester only, it opens demo trades at the minimum lot, or the lot you set. |
| Scope | Every position, this chart's symbol only, or listed magic numbers (0 = manual trades). |
| When it acts | On every tick (at most every 250 ms) and on a 500 ms timer. A closing that fails is tried again. |
| Reload and restart | The lock and the day start are kept in the terminal, so a restart or re-attaching does not lift a lock. Attach only one Guard per account. A second copy stays inactive. |
| Alerts | Pop-up and push are on. A warning, a lock, an unlock and a switched-off Algo Trading each send one. |
| Other products needed | None. No DLL, no network, no files. |
| Symbols and timeframes | Any chart. It reads the whole account, not the chart. |
| Tested on | Strategy Tester runs on XAUUSD H1 and EURUSD H1 in 2026, with demo trades. Tester results are not live results. |
Quick start
- Attach the Guard to one chart and turn Algo Trading on.
- Pick your firm in "Firm preset", or leave Custom and enter the rules.
- Check the lock level (default 90% of a limit used) and what it closes: every position, this chart's symbol, or listed magic numbers.
- Set the news mode and the warning level, then watch the panel.
- Check the panel's day start and floors against your firm's own dashboard once.
Who it is for
For traders and EA users on a prop-firm account. It closes the account's trades and keeps it flat at a safety buffer before a limit, whatever opened them.
Not for you if you expect a guarantee. It never opens a trade, and a fast market or a gap can fill a close beyond the limit. It does not replace reading your firm's rules.
How it works under the hood
Daily and max loss
- Daily loss limit: measured on equity from the balance, the equity or the higher of the two at the reset. It is a % of the account size or of the day start. The floor is that reference minus the limit.
- Reset: the firm's time and time zone, such as 00:00 Prague, 17:00 New York, 00:00 UTC+3 or server midnight. Daylight saving is handled.
- Max loss: static, or trailing from the highest equity, the highest closed balance or the highest end-of-day balance. It can stop at the account size. A two-stage type is also available.
- Used: the share of the limit already lost. The lock fires at the buffer, 90% by default, or when the floor is reached.
Lock, consistency and news
- Lock: at 90% of a limit (adjustable), it deletes pending orders, closes positions and closes anything opened while locked. A restart or re-attaching does not lift a lock. A daily lock ends at the reset. A max-loss lock ends when you press Reset twice within 5 seconds.
- Consistency: tracks your biggest profit day as a share of total profit. It shows today's profit cap that keeps you within the rule, with an optional stop for the day at the cap.
- News: alerts before high-impact releases from the MetaTrader economic calendar. It can also delete pendings or close positions before the firm's window opens. Inside the window it only warns, because at most firms a close inside the window is itself the violation.
- Flat time: some firms want you flat at a weekend or a daily cut-off. The Guard closes 10 minutes before that time by default.
Risk caps and targets
- Next trade: the room left before the Guard locks, minus what your open trades lose at their stops. Below it, the largest lot a new trade on the chart's symbol can take inside that room. The stop distance comes from the Risk Position Tool lines on the same chart, or a multiple of ATR(14). It respects the firm's lot caps and risk per trade idea. It only shows a number: it never places or blocks an order. A thin bar shows how much of the room is left, and the lot is shown large.
- Caps: floating-loss caps for all trades or per symbol, open risk at your stop losses against the room left, and positions without a stop loss.
- More rules: maximum lots per position and in total, and a maximum number of open positions and orders. Also a maximum loss per trade idea, a daily profit cap and a profit cap per position. Each is off until you or the preset sets it.
- Targets and tracking: profit target and trading days on the panel, with an optional lock when the target is reached. Profitable days and inactivity are shown and alerted, never enforced.
- Scope: every position, this chart's symbol, or listed magic numbers (0 = manual trades).
Firm presets
There are 22 presets, checked against each firm's own rule pages on 2026-10-16. FTMO: 2-Step, 1-Step, Instant. FundedNext Stellar: 2-Step, 1-Step, Lite, Instant. FundingPips: 2-Step, 2-Step Pro, 1-Step, Zero. E8: One, Signature. Alpha Capital: Pro 6%, 8%, 10%. Blue Guardian: 2-Step, 1-Step, Instant. Funded Trading Plus: 2-Step Classic. Instant Funding: Two-Phase, One-Phase Pro. The Custom preset takes any other rule set. Firms change their rules. The panel shows the date each preset was checked, so compare it with your firm's current rules.
Your firm is not listed? Send me a private message here on MQL5 with these details.
- Your firm and programme.
- The daily loss limit (% and what it is measured from).
- The daily reset time and time zone.
- The max loss and its type (static or trailing).
- Any consistency or news rule.
I will add it as a preset in the next update. Until then, the Custom preset takes the same settings.
Inputs
| Input | Default | What it does |
|---|---|---|
| Firm preset | Custom | The rules below, or one of the 22 presets. |
| Account size | 0 | 0 takes the first deposit. |
| Profit target of this phase | 10% | Shown on the panel. Locks only if the target lock is on. |
| Custom rules | daily 5%, max loss 10% static, reset 00:00 Prague | Daily %, measured from, reset zone and hour, max % and type, consistency, trading days, news window. |
| Lock at % of a limit used | 90 | The safety buffer. |
| Lock for the day / at max loss / at target / at the consistency cap | on / on / off / off | Which events lock the account. |
| Close and block | All positions | Or this chart's symbol, or listed magic numbers. |
| News mode | Alerts only | Or delete pendings, or close and delete, before the window. Acts 2 minutes before it. Always watches USD. |
| Warn at % of a limit used | 75 | Pop-up on; push on. |
| Show the largest lot the room still allows | true | Stop distance 1.5 x ATR(14) when no Risk Position Tool lines. |
| Panel position, margins, font size, light colours | left, 10, 26, 9, off | Look and place of the panel. |
| Broker server clock | auto | Or a fixed offset from UTC. |
| Strategy Tester only: demo trades | on | Demo lot 0 (the minimum); demo trades ignore the lock: off. |
| Debug log for bug reports | false | See Found a problem? |
Strategy Tester
In the tester only, the Guard opens small demo trades so you can watch it lock and release in visual mode. On a live or demo account it never opens a trade. In the tester the news filter uses a built-in list of high-impact USD releases, because the economic calendar is not available there.
How it was checked
- Reset times: the code that finds each day's reset was compared with an independent Python calculation (zoneinfo). It covered every hour from 2020 to 2026 on each broker clock and reset zone: 5,891,328 checks, 0 mismatches. The flat-time window passed 3,927,552 checks, 0 mismatches.
- Tracking: the totals the Guard keeps were recounted from the raw deals of 5 Strategy Tester runs. They include the best trade, profitable days and trading days. There were 0 mismatches in 9 totals in each run.
- Lock test: in the tester on XAUUSD H1, January to October 2026, a $1,000 account used large demo trades that ignored the lock. There were 196 days, 1,070 deals and 8 locks. On 5 days the lowest equity still went below the daily floor, by $2.45 at most. This is a test result, not a promise: a gap can fill beyond the floor.
- Next trade lot: in the tester the lot shown stayed inside the room to the lock. That held on 502 of 502 bars on XAUUSD and 114 of 114 on EURUSD, also with the lot cap and risk per idea on.
- Build: compiled with 0 errors and 0 warnings.
Not covered: a live account and each firm preset in the tester. The Risk Position Tool lines as the stop source were not tested either, because the tester has no lines. Tester results are not live results.
Limits
- No guarantee. The buffer lowers the chance of touching a limit. It cannot remove it. In a fast market, a gap or a closed market, a close can fill beyond the lock level, even beyond the floor.
- Check your firm's policy on Expert Advisors. Some firms allow risk-management EAs, some need approval, some forbid any purchased EA. The Guard only closes trades, but it is still an EA.
- Algo Trading must be on. Otherwise the Guard can only warn. The panel turns red when it is off.
- One chart. Attach it to one chart only. A second copy on the same account stays inactive.
- It cannot close a position while that symbol's market is closed. It tries again when the market opens.
- Nothing runs while the terminal is off. A VPS keeps it running.
- Firms measure in different ways and change their rules. It does not replace reading your firm's rules.
FAQ
Does it stop rule breaks? It closes and blocks trading before a limit, but fills in fast markets can go further. It lowers the risk. It cannot ensure a pass.
Will my firm accept it? That depends on the firm's EA policy. Ask the firm if you are unsure.
Does it work with other EAs? Yes. It closes their trades too, unless you limit the scope by magic number.
What happens after a restart? The lock and the day start are kept in the terminal, so a restart or re-attaching does not lift a lock.
How do I unlock after a max-loss lock? Press Reset on the panel twice within 5 seconds. If you are still beyond the buffer, it locks again.
Does it open trades? No. In the Strategy Tester only, it opens demo trades so there is something to guard.
What if the terminal is off? Nothing runs while the terminal is off. A VPS keeps it running.
Is there a MetaTrader 4 version? Yes, Prop Rules Guard MT4, with the same rules, presets and lock.
Try it first
Download the free demo from this page and run it in the Strategy Tester's visual mode. The demo trades let you watch a warning, a lock and the unlock at the next reset.
The free Prop Rules Monitor shows the same limits on a chart without closing anything. You do not need it to use the Guard.
Works well with
These are workflow suggestions. I have not found that any pair gives better trading results. You do not need any of them.
| Product | How to use them together | Why |
|---|---|---|
| Prop Rules Monitor | Attach the Monitor to see the numbers. Use the Guard when you want the account closed at your buffer. | The Monitor watches and the Guard acts. The Monitor keeps its own stored values, so it does not disturb a Guard on the same account. |
| Prior Day Breakout Pro, Signal Trader Pro or Risk Trade Manager MT5 | Leave "Prop Rules Guard lock" on in the EA (default on). | They read the Guard's lock and stop opening trades while it is on. This is read from the code; the pairs were not run together live. |
An EA that does not read the lock is still closed at the limit. Check that EA's own limits.
Keep one Guard per account.
Related products
- Prop Rules Guard MT4: the same Expert Advisor for MetaTrader 4.
- All my products on MQL5
Custom work
Want a custom version of this tool, several of my indicators or EAs combined into one, an EA that trades another indicator you use (mine or another developer's), or a new indicator or EA of your own? Order it through MQL5 Freelance and choose me as the developer: order through Freelance. Send your requirements, rules and the flow or algorithm you want. The whole order, payment and delivery stay inside MQL5 Freelance.
Found a problem?
- In the inputs, set "Debug log for bug reports" to true.
- Repeat what went wrong.
- Open the Experts tab in the Toolbox. Copy the lines that start with "DBG" and paste them in a comment on this page, with the symbol and timeframe.
- Set the debug log back to false.
The debug lines never contain your account number, name, server, balance or equity.
If you find it useful, a short review on this page helps other traders find it.
Questions: use the comments on this page or send me a message on MQL5.
Trading involves risk. The Guard enforces limits you set; it does not predict the market and does not ensure that an account passes or stays funded.
