A tool for your own risk rules · EA for MetaTrader 5

RBR Risk Guard watches your challenge limits

RBR Risk Guard tracks the daily and max loss limits on equity, the way the prop firm does, and warns you before a limit. The PRO version closes positions before you breach a limit — as far as the market allows — and watches news windows and the weekend. Its trade panel opens a position only when you click Buy or Sell, with the lot from your risk and only after checking the rules. Pre-trade blocking applies only to orders from the panel: manual orders from the MT5 window and orders of other EAs are closed by the guard after they open. EAs with source code can be connected with the GuardBridge.mqh file. No strategy, no signals, no automatic entries.

We are refining this version — the file will be back after testing.

€49 one-time · 12 months · up to 3 MT5 accounts

Lifetime licence: €129 once, no expiry date · Renewal for another 12 months: €34, counted from the end of your current licence

Purchase opens after approval by the payment provider.

Try the free version before buying – no time limit. After the key is delivered, refunds only for defects. Terms of sale and licence · Refund policy

What it tracks and what it does

Daily limit

The daily floor is the equity level at which the firm treats the daily limit as breached. It is the reset balance (or the higher of balance and equity) minus a percentage of the account size or balance. You set the reset in the firm's time zone: server time, UTC, Central Europe or New York; the EA handles EU and US clock changes itself.

Max loss limit

Four types: static, trailing at end of day, trailing intraday, and trailing until it reaches the starting balance. The EA counts both limits on equity, including open positions — the way firms do. The room is the gap between equity and the floor.

Panel with the stage rules

Room to both limits, target and progress, trading days, profitable days, best day as a share of profit, time to the reset, the next news window and the time to the market's weekend close. The state is saved to a file and survives a terminal restart.

Alerts

When the room drops to a threshold, 2% of the account by default, you get a terminal alert and a push notification. Push works once your MetaQuotes ID is in the terminal settings (Tools → Options → Notifications).

Closing before a limit (PRO)

The buffer is a margin before the limit, 0.5% of the account by default. When the room drops to the buffer, the EA closes every position on the account and deletes pending orders. Then it blocks trading: after the daily limit until the reset, after the max loss limit until you switch on “Remove a max-loss/target block”.

Trade panel (PRO)

You enter the risk as a percentage of the account size (“Panel: risk per trade, % of account size”), the SL in points and the TP in R. The panel rounds the lot down to the broker's step; if the risk isn't enough for the minimum lot, it refuses — it never rounds up. The order goes out only after you click Buy or Sell and the rules are checked in this order: block or buffer, readiness (connection, Algo Trading), stop loss (at least the broker's stop level), max risk per trade (“Max risk per trade, %”), an open position without SL, room to the limit including the risk of all open positions and pending orders on the account to their SL, minus the buffer, news window, weekend. The first time, you confirm a notice that pre-trade blocking applies only to orders from the panel. Next to each position the panel shows its status: “protected (panel)”, “under control (bridge)” or “after the fact only”. The “Close panel positions” button closes panel positions on all symbols and always needs a second click within 5 s; inside a news window it also warns, because firms count closes in the window too. On a netting account the panel doesn't add to an existing position on the symbol, because its SL and risk would change.

News windows (PRO)

Off by default (“News windows”). The calendar comes from your MT5 terminal; the EA works out its time zone itself from US releases at 08:30 New York. A window of ±N minutes around the release (2 before and 2 after by default), high impact or high and medium, the symbol's currencies or your own list (the list applies to ALL symbols). “Alerts only” mode: a warning 5 minutes before the window. Block mode: panel and bridge orders inside the window are rejected, a position opened during a window by hand or by an EA without the bridge is closed at once, pending orders are deleted before the window (one minute before by default), and optionally positions are closed M minutes before it. If the calendar's time zone can't be established reliably (fewer than 5 releases or agreement below 90%), entries are blocked but nothing is closed — the EA then sends the alert “News-window protection not active” and retries every 2 minutes. The calendar isn't available in the strategy tester.

Weekend (PRO)

Off by default. The input “Block panel/bridge orders this many minutes before the market's weekend close (0 = off)” blocks panel and bridge orders before that market's weekly close. The EA takes the closing time from the symbol's sessions in the terminal (a break of at least 24 h), so indices, gold and currencies each close at their own time; 24/7 markets such as crypto have no weekend. Holidays and shortened sessions outside the weekly schedule aren't visible; for a symbol without a weekend break in its sessions the EA alerts you that it won't close it. The option “... and close positions and pending orders at that moment” then also closes positions and pending orders.

Bridge for EAs with source code (PRO)

An EA whose source code you have is connected with one line, #include <RBR\GuardBridge.mqh> — the first in the file, before <Trade\Trade.mqh> — and a recompile. Its risk-increasing orders (new position, adding, reversing, pending order) then pass the same rules before they are sent; the bridge never blocks closing, reducing, deleting orders or changing SL/TP — it only rejects removing the stop loss when the guard requires one. It counts risk for the whole account: open positions, pending orders and orders the EA has just sent. A rejection is code 10006 with the comment “RBR Guard: …” in the EA's journal. If the guard isn't running in the same terminal, the bridge rejects such orders (fail-closed; turn this off with #define RBR_BRIDGE_FAIL_OPEN before the #include). In the strategy tester the bridge is inactive, and with a guard without a PRO key it doesn't block. The input “Bridged EAs: reject orders without a stop loss” rejects EA orders without an SL and removing the SL.

Stage passed (PRO, optional)

When equity is above the target by the buffer and the required days are met, the EA can close everything and block trading. If the balance doesn't confirm the target afterwards, it lifts the block. The option is off by default.

Readiness check (PRO)

Every minute the EA checks that it could close at all: connection, Algo Trading, EA permission, investor password, broker-side EA block. If something is missing, it warns you right away — not at the limit.

What it doesn't do

  • It doesn't open positions by itself: only when you click Buy or Sell in the panel. It doesn't change the SL or TP of existing positions.
  • It doesn't block orders from the MT5 window or from EAs without the bridge before they open — it closes them after they open.
  • It gives no trading signals or advice, has no strategy and doesn't tell you what to buy or sell.
  • It doesn't predict the market or rate your strategy.
  • It doesn't protect you from price moves on economic data: the window enforces the firm's rule, not the price.
  • It doesn't promise any result: after a price gap or heavy slippage, a loss can go past the limit.
  • It doesn't send your trades or account data to our server.
  • It doesn't replace the firm's rules or dashboard — the firm decides the outcome of the stage.

Free version and PRO

FeatureFreePRO
Room to the daily and max loss limits✓✓
Target, trading and profitable days, best day, time to reset✓✓
Terminal alert and push notification✓✓
Rules from the challenge calculator's .set file✓✓
Trade panel: lot from your riskvisible, buttons inactive (“BUY (PRO)”)order after your click and the rule check
News windows from the terminal's calendarwarning 5 min before the windowpanel and bridge orders blocked, closing after the fact
Weekend: panel and bridge orders blocked before the market closes—✓ (optionally closing positions)
GuardBridge.mqh bridge for EAs with source code—✓
Closing all positions and pending orders before a limit—✓
Block on new positions—until the daily reset or until you remove it
“Stage passed” option at the target—✓
Warning when the EA couldn't close—✓
Pricefree€49 · 12 months · up to 3 accounts

Installation

  1. Download the .ex5 file. In MetaTrader choose File → Open Data Folder and copy the file into MQL5\Experts.
  2. Right-click in the Navigator window and choose Refresh. RBR_RiskGuard appears under Expert Advisors.
  3. Drag the EA onto the chart of the symbol you want to trade from the panel. One chart covers the limits of the whole account.
  4. On the Common tab tick “Allow Algo Trading”, and switch on the Algo Trading button in the toolbar. The free version works without it; PRO can neither close positions nor send panel orders without it.
  5. On the Inputs tab click Load and choose the .set file from the challenge calculator. You can also type the rules in yourself — the inputs are in English, the panel and messages follow the terminal language. News windows and the weekend guard are off by default: switch them on in the “News windows (PRO)” and “Weekend (PRO)” sections.
  6. Enter your licence key in the “Licence key” field and click OK. Without a key the EA runs as the free version.
  7. The first time you use the panel, read the notice and click “I understand”: pre-trade blocking applies only to orders from the panel. Until then, Buy and Sell send no orders.
  8. Compare the EA panel with the firm's dashboard: daily floor, max loss and days. If the EA starts mid-stage, fill in the “Start values” section.
  9. Optional, the bridge for EAs with source code: download GuardBridge.mqh, copy it into MQL5\Include\RBR\, add #include <RBR\GuardBridge.mqh> as the first line of your EA and compile it in MetaEditor.

Limitations

Before entry, the panel protects only its own orders

Pre-trade blocking applies only to orders from the panel. An order from the MT5 window or from an EA without the bridge opens first, and only then does the guard close it — the spread, commission and slippage until then are yours. The panel's lot counts the loss from a price worse by the allowed slippage and adds the commission from the input “Panel: commission per 1 lot, round turn…”; in a fast market slippage can be larger — the EA warns you when the risk from the fill price exceeds your maximum.

Bridge: line order and a missing guard

The #include line must come before <Trade\Trade.mqh> — otherwise orders sent through the CTrade class skip the check. If the guard isn't running on the account (no heartbeat for 15 s), the bridge rejects risk-increasing orders. Your EA has to handle a failed OrderSend, as with any broker rejection.

EAs without source code

An EA that comes only as an .ex5 file can't be connected — MetaTrader doesn't let one program stop another program's orders. Such EAs get after-the-fact supervision only. Have an EA without source code and want protection before entry? Let us know: [email protected].

Works only while the terminal runs

The EA watches the limits only while the terminal with the EA is on and connected to the server. Protection starts about 5 seconds after connecting, once the account has synchronised. A switched-off computer means nothing is watching — that's why we recommend a virtual private server (VPS).

Gaps, closed markets, slippage

After a price gap, on a closed market or with heavy slippage, a loss can go past the buffer and even the limit. The EA limits the risk but doesn't promise any result. Equity also includes the spread, so a wider spread, for example at the broker's daily rollover, shrinks the room.

Closing at once, but not instantly

The EA sends the closes of all positions at once, and on a hedging account it closes pairs of opposite positions with one CloseBy order. On a demo account 20 positions on 3 symbols were closed in 0.03–0.3 s. The price still moves in that time.

The block doesn't disable MetaTrader's buttons

During a block the panel won't send an order, but you can still open a position from the MT5 window or another EA. The EA closes it right after it opens, but the spread and commission stay on the account.

The calendar and sessions come from the broker

News windows are based on your terminal's calendar, and the weekend on the symbol's sessions. Shifted or missing entries at the broker shift the window too; holidays and shortened sessions outside the weekly schedule aren't visible.

Firms' rules differ and change

Check the values in your firm's dashboard and rules. Compare the EA with the dashboard in the first days — what the firm shows is what counts.

Not every firm allows EAs

Some prop firms ban EAs, and others allow only certain ones — sometimes not bought ones. The panel is technically an EA too. Check your firm's rules before you use it. The challenge calculator warns you when it sees a ban in a program's description.

One instance, MT5 only

Run one copy of the EA per account — a second copy in the same terminal goes passive. The EA works only in MetaTrader 5, not in MT4, cTrader or other platforms.

How we test the EA

The limit and daily-reset logic was compared with an independent implementation on tens of thousands of cases, including the EU and US clock changes. The new functions of version 2.0 — the calendar's time zone and calibration, news windows, the lot from risk, the order of the panel rules and the weekly close — were compared with an independent implementation on 23,005 cases in real MQL5, with no difference at all. The calendar time zone conversion matches the IANA time zone database at every clock change from 2020 to 2039, and the calibration matches the engine of our “Payout check” tool on 500 calendars. Closing was checked in the MT5 strategy tester and on a demo account, including after a terminal restart and crash. We check the panel, news windows and bridge on a demo account before release. The tester can't reproduce everything — so compare the EA with your firm's dashboard in the first days.

Questions

Is the panel an automated system?

No. The panel sends an order only when you click Buy or Sell, on the chart's symbol, with the lot from your risk. There's no strategy, no signals and no entry without your decision. Pre-trade blocking applies only to orders from the panel.

Does it work on a challenge demo account?

Yes. Challenge accounts are usually demo accounts at the firm's broker, and the EA works on them just as on live ones. The PRO key is tied to the account number, not to the account type.

What happens if I close the terminal?

Monitoring stops, and open positions are left without the EA. The state is saved to a file and comes back on the next start. After a longer break the EA asks you to compare the counters with the firm's dashboard.

Can I run other EAs on the account?

Yes. At a limit PRO closes every position on the account by default, including manual ones and those of other EAs, because the firm counts the limit for the whole account. Before entry, only orders from the panel are checked — the guard sees other EAs' orders only after they open. If you have an EA's source code, connect it with the GuardBridge.mqh bridge: its orders then pass the same rules before they are sent. The “Positions to close” input with a magic number, an EA's ID on its orders, narrows closing to one EA (panel positions are always included). The limit still covers the whole account, so the other positions can still breach it.

How do I link the licence to an account, and what about a new challenge?

You enter your MT5 account number before paying and get the key right after. A new challenge usually means a new account — you add it yourself through the link in your purchase e-mail, up to 3 accounts within 12 months. Each account gets its own key.

Does the licence need the internet?

No. The key is checked inside the terminal, without contacting our server. Only the terminal needs the internet, to connect to the broker.

What happens when the licence expires?

The key expires, and the licence doesn't renew automatically. The EA shows a warning a week before. After that it runs like the free version: the limit panel and alerts stay, closing and panel orders stop.

How do refunds work?

You get the key right away, so we do not give refunds without a reason after purchase – try the free version first, with no time limit. You get your money back if the key does not arrive or the EA does not work as described and we do not fix it. Refunds are handled by Paddle, our reseller. Details: Refund policy.

Do you collect my trades?

No. The EA sends nothing to our server and keeps its state only in a file on your computer. The bridge talks to the guard through the terminal's global variables, without the internet. Push notifications, if you turn them on, go through MetaTrader's notification service — just the alert text.

The seller (Merchant of Record) is Paddle.com, our reseller, which issues the receipt and handles the tax; details: Terms of sale and licence, Refund policy, Privacy policy.