Risk Control Panel MT4 - User Guide (Part 2 of 2)

17 November 2026, 16:13
Claudio Hernan Ibarrola Diaz
0
16

Part 2 of 2. Part 1 covers installing, the five minutes that matter and the panel field by field.

4. Automatic protection

RCP watches the positions it manages and, when they go your way, moves their stop forward to protect what they have made. It only ever brings a stop closer to the price, never further away.

The states a position goes through. Always in this order, and never back:

State What it means
INITIAL The position has its original stop. Protection waits.
BE The stop has moved to break even: the entry plus BE OFFSET PTS, to cover spread and commission. From here the position can no longer close at a loss, save a gap or slippage past the stop.
TRAIL The stop follows the price, at a fixed distance in points (FIXED) or a multiple of the ATR (ATR).
CLOSED The position has closed.

Each position's state is shown in the protection column of the MANAGER tab.

Which steps are taken is PROTECTION's choice, in SETTINGS › PROTECT: NONE does nothing; BE ONLY only break even; TRAIL ONLY only trailing; BE+TRAIL both, break even first.

Everything is measured in R. R is the distance from the entry to your original stop, and it is stored when the position opens: however the stop moves later, R does not. So 1.0 R always means "as much as you risked".

An example with the defaults. A buy of EURUSD at 1.10000 with the stop at 1.09800 — 20 pips, so 1 R is 20 pips:

The price reaches Profit What protection does
1.10200 +1.0 R BE TRIGGER R (1.0) is reached: the stop moves to 1.10020, the entry plus the 20 points of BE OFFSET PTS (20 points are 2 pips on EURUSD, so the stop sits 2 pips above the entry, not above the price)
1.10300 +1.5 R TRAIL START R (1.5) is reached and trailing starts. With an ATR of 10 pips and ATR MULTIPLIER at 1.5, the stop sits 15 pips behind the price: 1.10150
1.10400 +2.0 R The stop rises to 1.10250. It only moves when it can advance at least TRAIL STEP ATR, 0.20 × 10 = 2 pips
1.10350 +1.75 R The price pulls back and the stop stays at 1.10250: it never goes down

Worth knowing:

  • It is stored on disk. Each position's state and R are kept in protection_<login>.csv , so a restart mid-trade still knows where each one stood. A partial close does not lose them: the position keeps its R under its new ticket (section 6).
  • The broker has the last word. A stop has to sit behind the price and at the broker's minimum distance. A step that cannot be taken yet is tried again on the next refresh; if the broker refuses the request (the market is closed, for instance), protection waits before asking again.
  • A stop you move by hand. Protection never moves a stop backward, so a stop you bring closer to the current price — more protection — is kept, and protection carries on from there. A stop you move further from the price is not: at its next step, the break-even trigger or the next trailing move, protection brings it forward again. TRAIL on the MANAGER tab switches trailing off for one position; break even, if not yet applied, still happens. To switch all protection off, set PROTECTION to NONE in SETTINGS › PROTECT (or Protection mode in the Inputs tab of the EA's parameters).
  • A position opened without a stop has no R, so it gets neither break even nor trailing. If you add a stop later, R is taken from that stop.
  • Only while the EA is running. The stop sits on the broker's server and protects you even with MetaTrader closed. But moving it to break even and trailing it is the EA's work: with MetaTrader closed, offline, or the EA removed from the chart, the stop stays where it was until it runs again.
  • Where, and which positions. Protection runs only on the primary chart (section 5), with AutoTrading on, and only for the positions SETTINGS › EXEC › MANAGE covers.

5. Several charts, one account

You can put RCP on as many charts as you like. One of them manages the account: the primary chart. Once RCP runs on more than one chart, the primary's title reads (primary) and the others' (secondary), a second or two after the change. On a single chart the title carries neither, and that chart is the primary one.

  • The primary chart runs automatic protection, limit actions and settings changes.
  • Every secondary chart can still plan, size, trade and close. An action that belongs to the primary chart is refused on a secondary one, with an explanation.
  • If the primary chart's EA goes away, a secondary chart takes over and becomes the primary: at once if you remove the EA, and within ten seconds if it stopped unexpectedly (MetaTrader closed abruptly, for instance).

Settings are per account, not per chart: change the daily loss limit on one chart and the others pick it up within a couple of seconds.


6. How MetaTrader 4 handles your trades

The sections above describe the panel. This one is about MetaTrader 4 itself — how it keeps trades and history — and what RCP does about it, so nothing here surprises you.

Every trade is its own ticket. There are no netting accounts on MetaTrader 4: each order opens a position of its own, and nothing is refused because the symbol already has one open. Some brokers do not allow opposite positions on the same symbol; they refuse the order, and the status strip says This account does not allow opposite positions on the same symbol.

A partial close gives the rest a new ticket. When you close 25% or 50% of a position, MetaTrader 4 closes the part taken off under the original ticket and reopens the rest under a new ticket number, with the same open time and price. RCP keeps following it as the same position: its original stop and R, its protection state, the row selected on MANAGER and a click waiting for its confirmation all carry over. The link is recorded in tickets_<login>.txt (section 7), so it survives a restart. The rest is not counted as a new trade in TRADES.

The comment is lost on the rest; the magic number is not. MetaTrader 4 writes from #<ticket> over the comment of what remains after a partial close, so the text of the input Trade comment is gone from it. RCP does not rely on the comment: it recognises its own trades by their magic number (SETTINGS › EXEC › MAGIC NUMBER), which the rest keeps.

Stops on market-execution brokers. On a symbol with market execution, MetaTrader 4 does not accept a stop loss or take profit on the order that opens the position. RCP opens it without them, attaches them immediately after and reads them back. If the broker refuses them, the status strip and the journal say so loudly, starting Position opened but its stop loss was rejected, and the position shows NO SL until you set one. With instant execution, and for pending orders, the stops go with the order itself.

Oldest first. CLOSE ALL, FLATTEN ALL and LIMIT: CLOSE close positions oldest first, which is the order brokers under FIFO rules (US accounts) require. On such a broker, closing a newer position while an older one on the same symbol is still open — with CLOSE LAST, or CLOSE, 25% or 50% on it — is refused by the broker, and the status strip says The broker's FIFO rule requires the oldest position on this symbol to be closed first.

The history is what the Account History tab shows. An Expert Advisor on MetaTrader 4 sees only the closed trades the terminal's Account History tab has loaded. RCP takes from there what today has closed — CLOSED, the closed part of DAY P/L, TRADES and LOSERS — and the commission estimate, which reads the last 30 days. If the tab shows a period that does not include today, the day's closed loss is invisible to the panel and DAILY RISK reads lower than it is; if it shows only a few days, the commission may not be found. Right-click the tab, choose Last 3 Months or All History, and leave it.

Commission on open tickets. MetaTrader 4 shows the commission on a ticket from the moment it opens, and on most accounts it is the whole round turn. RCP counts what the ticket already carries, and adds at the stop only what the round turn has not yet charged, so the commission is never counted twice.

The Strategy Tester has no timer. In MetaTrader 4's tester the panel refreshes on the ticks of the test instead of every Refresh interval: at most once per second of test time, or once per refresh interval of real time. In visual mode the demonstration runs as described in section 9; without visual mode there is no chart, so no panel and no demonstration.


7. What it writes to disk

Everything lives under MQL4\Files\RCP\ , inside the terminal's sandbox. Nothing is sent anywhere.

File Contents
settings_<login>.txt Your settings, the panel position, the open tab, the plan per symbol
protection_<login>.csv The original stop and R behind every protected position
lock_<login>.txt The daily lock, so it survives a restart
tickets_<login>.txt Which ticket each remainder of a partial close came from, so a position keeps its identity — and its R — across partial closes and restarts

Removing the EA leaves these files: they are yours, and losing them mid-trade would lose the R behind every position. Delete the folder if you want a clean slate.

Uninstalling removes every object the panel drew and leaves the chart as it was found.


8. Inputs reference (the Inputs tab)

MetaTrader 4 has no input groups, so the headings below appear in the dialog as separator rows — === General === , === Risk === and so on — with an empty value; they change nothing. The inputs follow them in this order. The On the panel column says where the same setting is changed from the panel: change it there and the panel wins (see "Two rules govern settings" in section 3). Only here means the setting exists only on the Inputs tab.

General

Input Default On the panel
Journal detail Info Only here; see the levels below
Refresh interval (ms) 250 Only here. 50 to 5000. In the Strategy Tester the panel refreshes on ticks instead (section 6)

Risk

Input Default On the panel
Risk mode % of balance SETTINGS › RISK › RISK MODE
Risk (% / money / lots, per mode) 1.0 SETTINGS › RISK › RISK PER TRADE
Commission per lot, round turn (0 = from history) 0.0 SETTINGS › EXEC › RT COMM/LOT

Limits (0 = off)

Input Default On the panel
Maximum lot per trade (0 = off) 0.0 SETTINGS › RISK › MAX LOT
Maximum daily loss % 2.0 SETTINGS › RISK › MAX DAILY LOSS
Maximum trades per day 0 SETTINGS › DAILY › TRADES/DAY
Maximum losing trades per day 0 SETTINGS › DAILY › LOSERS/DAY
Block new trades while a position has no SL true SETTINGS › RISK › BLOCK IF NO SL
Trading day starts at (server hour, 0-23) 0 SETTINGS › DAILY › DAY STARTS (H)

When a daily limit is reached

Input Default On the panel
Block new trades true SETTINGS › DAILY › LIMIT: BLOCK
Delete RCP's pending orders true SETTINGS › DAILY › LIMIT: DEL PEND
Close RCP's positions (daily loss limit only) false SETTINGS › DAILY › LIMIT: CLOSE

Protection (RCP's positions)

Input Default On the panel
Protection mode Break even, then trailing SETTINGS › PROTECT › PROTECTION
Break even trigger (R) 1.0 SETTINGS › PROTECT › BE TRIGGER R
Break even offset (points past entry) 20 SETTINGS › PROTECT › BE OFFSET PTS
Trailing activation (R) 1.5 SETTINGS › PROTECT › TRAIL START R
Trailing method ATR multiple SETTINGS › PROTECT › TRAIL METHOD
ATR timeframe H1 SETTINGS › PROTECT › ATR TIMEFRAME
ATR period 14 SETTINGS › PROTECT › ATR PERIOD
ATR multiplier 1.5 SETTINGS › PROTECT › ATR MULTIPLIER
ATR trailing step (ATR multiples) 0.2 SETTINGS › PROTECT › TRAIL STEP ATR
Fixed trailing distance (points) 200 SETTINGS › PROTECT › TRAIL DIST PTS
Fixed trailing step (points) 40 SETTINGS › PROTECT › TRAIL STEP PTS

Execution

Input Default On the panel
Magic number 770101 SETTINGS › EXEC › MAGIC NUMBER
Seconds to confirm a click 3 SETTINGS › EXEC › CONFIRM SECS
Maximum slippage (points) 20 SETTINGS › EXEC › SLIPPAGE PTS
Trade comment (up to 31 characters) RCP Only here. Written on every order; plain characters only. MetaTrader 4 replaces it on what remains after a partial close (section 6)
Trades RCP may modify and close This EA only SETTINGS › EXEC › MANAGE
Magic number to manage (mode "One magic number") 0 SETTINGS › EXEC › MAGIC ONLY
Symbol to manage (mode "One symbol") (empty) SETTINGS › EXEC › SYMBOL ONLY

Initial plan

Input Default On the panel
Stop distance (points) 300 The starting SL on the TRADE tab
Target, in R (0 = none) 3.0 The starting TP on the TRADE tab
Dragging Entry moves Stop and Target true Only here
Show chart lines on start true The LINES ON / OFF button in the title bar

Panel

Input Default On the panel
Panel X 12 By dragging the title bar
Panel Y 20 By dragging the title bar
Panel scale % 100 Only here
Demonstration in the Strategy Tester (visual mode) true Only here; see section 9

Journal detail: each level includes everything in the levels below it.

Level What it writes to the Experts journal
Debug (everything) Everything Info writes, plus refresh timings, memory and object counts once a minute, and the time of each step when the EA is removed. For diagnosing a problem; too much for everyday use
Info The recommended level. The startup line with its build, every order sent, modified or closed, every refused trade with its reason, what protection did and every settings change
Warnings and errors Only warnings (such as no commission found) and errors
Errors only Only errors: an order the broker rejected, a file that could not be saved
Off Nothing. Not recommended: if something goes wrong, the journal has nothing to explain it with

An input outside its range is refused at startup, by name, rather than silently replaced by a default you did not choose.


9. If something looks wrong

  • The panel refuses a trade and you disagree. The reason is on the status strip and in the Experts journal. Every refusal is recorded there — it is your account of what the panel stopped.
  • "No commission found in history". The terminal publishes no commission before a trade, so the panel looks for it in the closed trades of the last 30 days. Check that the Account History tab shows Last 3 Months or All History and restart the EA; if you have no recent trades on that symbol, set it yourself in SETTINGS › EXEC if your broker charges one. Otherwise sizing assumes none.
  • CLOSED, TRADES or LOSERS miss a trade closed today. The Account History tab shows a period that does not include today. Choose Last 3 Months or All History (section 6).
  • "The previous run on this chart never left … and was stopped by the terminal". The last time the EA ran on this chart, MetaTrader had to stop it while it was at the step named — usually on removal. Once is nothing to act on; if it keeps happening, send the Experts journal.
  • "… took N ms (last step: …)". A refresh or a click took over a second, and the message names where. On CLOSE ALL, DELETE ALL or FLATTEN ALL with many trades it is expected: each one waits on the broker. Anything else that repeats is worth reporting, with the journal.
  • A new build does not seem to take effect. Remove the EA and drag it on again, then check the build stamp on the startup line.
  • Nothing is drawn. In the Strategy Tester without visual mode there is no chart to draw on; the panel runs headless by design.
  • The buttons do nothing in the Strategy Tester. Clicks do not reach an EA there, even in visual mode, and MetaTrader 4's tester has no timer, so the panel moves with the ticks of the test. In visual mode the panel runs a short demonstration by itself, every step named on the status strip with DEMO: : it plans a trade (the stop at 1.5 ATR, the target at 2 R), confirms it with two clicks, shows the RISK tab and, every other time, a trade refused for passing the daily limit, lets protection move the stop, closes with FLATTEN ALL if the trade is still open after 40 bars, minimises the panel and starts again 10 bars later. BUY and SELL take turns: it is a demonstration, not a strategy. It never runs on a live chart or in a test without visual mode, and the input Demonstration in the Strategy Tester (visual mode) switches it off. To try the panel with your own clicks, run it on a demo account.

Risk Control Panel MT4 does not give financial advice and does not decide what to trade. It makes the size, the exposure and the loss you are risking visible and deliberate before you act.