A risk-management panel for MetaTrader 5. It does not predict the market and it does not trade on its own: it sizes the position you are about to take, refuses the ones that would break your own limits, protects what is open, and tells you where you stand.
PLAN → EXECUTE → PROTECT → MONITOR
1. Installing
- Bought or rented on the MQL5 Market: MetaTrader installs it for you; it appears in the Navigator under Expert Advisors › Market. Installing by hand: copy RiskControlPanel.ex5 into MQL5\Experts\ inside your terminal's data folder (File → Open Data Folder in MetaTrader), then right-click Navigator → Refresh.
- Drag RiskControlPanel onto a chart.
- On the Common tab of the dialog, tick Allow Algo Trading, and make sure the Algo Trading button on the MetaTrader 5 toolbar is on.
The panel appears in the top-left corner of the chart. Drag its title bar to move it; where you leave it is where it comes back.
Minimising. The control at the right end of the title bar — a dash while the panel is maximised — minimises it to a small strip reading RCP (Risk Control Panel), and hides the plan lines, so the chart is clear for analysis. With RCP on more than one chart of the account, the strip reads RCP (primary) on the chart that manages it and RCP (secondary) on the others (section 5). While the panel is minimised the control is a hollow square; click it and the panel is maximised again. Minimised, the panel keeps protecting and monitoring exactly as before — only the body of the panel goes, and the Entry, Stop Loss and Take Profit lines if they were on — and a trade or close waiting for its second click is cancelled.
Updating to a new version: a Market copy is updated by MetaTrader when a new version is published (the terminal offers it); a copy installed by hand is updated by copying the new .ex5 over the old one. Either way, remove the EA from the chart and drag it on again. (Only pressing OK in the inputs dialog restarts the EA but does not re-read the file from disk, so a new build would not take effect.) Check the startup line in the Experts journal to confirm the new build is really running:
Risk Control Panel 1.00 (build 2026.09.17 20:07) started on EURUSD (refresh 250 ms)
2. The five minutes that matter
Everything else is detail; this is the loop.
- TRADE tab. Drag the Entry, Stop and Target lines on the chart, or type the distances. The panel shows the lot size that risks exactly what you asked, the money at risk, the reward-to-risk ratio and what it costs to open, between spread and commission.
- Press BUY or SELL. Press it again within the confirmation window to confirm (3 seconds by default, SETTINGS › EXEC › CONFIRM SECS). One click never sends an order.
- If the panel refuses, it says why, in words — never a greyed-out button with no explanation.
- MANAGER tab. The open positions, what each one still has at risk and its protection state; and, on its own list, the pending orders, with what each would risk and when it expires.
- RISK tab. What today has cost, what is at risk right now, and how much room is left.
3. The panel, field by field
Title bar and top bar — visible on every tab
| Item | Meaning |
|---|---|
| Risk Control Panel | The title. With RCP on more than one chart of the account it reads Risk Control Panel (primary) on the chart that manages the account and Risk Control Panel (secondary) on the others (see section 5). On a single chart it is just Risk Control Panel. |
| LINES ON / OFF | Shows or hides the plan's Entry, Stop and Target lines. With the lines hidden, BUY and SELL are refused: you would be trading a stop loss (SL) you cannot see. |
| – (the control at the right end) | Minimises the panel to a small strip; the same control, now a hollow square, restores it. See section 1. |
| BALANCE | Account balance. |
| EQUITY | Balance plus the floating profit or loss of every open position. |
| DAY P/L | Today's result: what was closed today plus what is floating now. The trading day starts at the hour set in SETTINGS › DAILY. |
| DAILY RISK 1.63% / 2.00% | What today would cost if every stop were hit — the same figure as on the RISK tab — against your MAX DAILY LOSS. The bar underneath fills towards the limit. no cap when no daily limit is set. |
| Status word | How close DAILY RISK is to MAX DAILY LOSS: SAFE below half of it, CAUTION from half, WARNING from three quarters, LIMIT when reached. NO SL: n replaces the word while n positions or orders have no stop loss — the more urgent news. |
| Status strip (bottom) | The last message: why a trade was refused, what a click did, what to do next. Every refusal is also written to the Experts journal. |
TRADE — plan and execute
Three rows plan the trade; each has a field you type in, a button that changes what the field means, and the result on the right.
| Row | Field | Button | Right-hand result |
|---|---|---|---|
| RISK | How much the trade may lose, in the unit of the button | % BAL → % EQ → MONEY → LOTS | The money this trade risks at the final lot: the loss at the stop plus commission |
| ENTRY | The entry price | MARKET (the entry follows the current price) / MANUAL (the price you type or drag stays put) | The order that will be sent: MARKET, BUY LIMIT, SELL LIMIT, BUY STOP or SELL STOP, worked out from where your entry sits against the price |
| SL | The distance to the stop loss | PTS → PIPS → PRICE | The stop price, in red |
| TP | The distance to the take profit | R → PTS → PIPS → PRICE → OFF | The target price, in green, or - when OFF |
- Risk modes.% BAL risks a percentage of the balance; % EQ a percentage of the equity, so it shrinks while open positions are losing; MONEY a fixed amount; LOTS a lot you choose, with the resulting risk shown on the right. The percentage you type is kept until you change it: between % BAL and % EQ only what it is measured on changes, so the lot and the money follow; stepping through MONEY and LOTS shows the money and the lot of the current trade, and coming back to a percentage brings back the one you chose.
- R is the distance from entry to stop. A target of 2.00 R sits twice as far from the entry as the stop.
- PIPS is only offered on symbols quoted with 3 or 5 digits, where a pip is 10 points. On indices, metals and crypto there are no pips, so SL cycles PTS → PRICE and TP cycles R → PTS → PRICE → OFF.
- TP OFF sends the trade with no take profit.
- Changing a unit never moves a line: the field just reads the same distance in the new unit.
- Dragging a line on the chart updates the fields, and typing in a field moves the line.
- Dragging the Entry line moves SL and TP with it, keeping their distances. The input Dragging Entry moves Stop and Target, on the Inputs tab, turns this off (section 7).
Below the plan, the result:
| Figure | Meaning |
|---|---|
| LOTS | The size that risks what you asked, rounded down to your broker's volume step — never up, which would risk more. It reads LOTS MAX in amber when it was cut to your maximum lot in SETTINGS › RISK › MAX LOT, or to the broker's. If even the broker's minimum lot risks more than you asked, that minimum lot is used as long as it is no more than 10% over, and RISK shows the real risk; beyond that the trade is refused with Minimum lot exceeds the requested risk. It is the only case where the panel can risk slightly more than you set. |
| R:R | Reward to risk: the distance to the target over the distance to the stop. 1:2.00 means the target is twice as far as the stop. Before costs; it only shows - with the target OFF. |
| MARGIN | The margin this position would tie up, as the broker computes it. |
| SPREAD | What the current spread costs at this lot size — paid the moment the trade opens. |
| COMM | The round-turn commission at this lot size: the value in SETTINGS › EXEC › RT COMM/LOT, or estimated from your recent trades when that is 0. 0.00 when none is known — a notice at startup says so. |
| EXPOSURE | The most this trade can cost if the stop is hit: the RISK figure plus the spread and, if there is one, the swap. |
| BUY / SELL | Show the lot they would send. The lines decide the side: a stop below the entry is a buy, above it a sell; the other button is dimmed and, if pressed, says how to turn the setup around. The first click turns the button into CONFIRM BUY 0.25; a second click within the confirmation window sends the order (set in SETTINGS › EXEC › CONFIRM SECS). |
| FLATTEN ALL | The panic button, below BUY and SELL: closes every position and deletes every pending order the panel manages (SETTINGS › EXEC › MANAGE decides which). The first click turns it into CONFIRM: 2 POS + 3 ORD; a second click within the confirmation window does it. It works on a locked day and on a secondary chart — it only ever takes risk away. Greyed out when there is nothing to flatten. |
On a netting account there is one position per symbol, and any order on that symbol changes it. So on a symbol that already has a position open, BUY and SELL are refused, with the reason on the status strip. The same side would join the open position and replace its SL and TP: "BUY refused: on a netting account it would join the open BUY 0.10 and replace its SL and TP." The other side would close or reverse it: "SELL refused: … would close or reverse the open BUY 0.10. Close it from MANAGER first." To reduce or close the position, use 25%, 50% or CLOSE on the MANAGER tab. On a hedging account each trade is its own position and nothing is refused.
RISK — how much is at risk on the whole account
The wide strip across the top of the tab, just under the tab buttons, is the banner: the state of the trading day in one word. LOCKED stops you; REACHED only warns you.
| Banner | Meaning |
|---|---|
| TRADING OPEN, in green | No daily limit has been reached today. You can trade. |
| LOCKED: on red | The limit named beside it was reached, and new trades are refused for the rest of the trading day. It reads daily loss limit , trade count limit or losing trades limit . |
| REACHED: on amber | The same limit was reached, but LIMIT: BLOCK is off in SETTINGS › DAILY, so you can keep trading. The other two actions do not depend on it: if they are on, LIMIT: DEL PEND has deleted the panel's pending orders and, when the limit reached is MAX DAILY LOSS, LIMIT: CLOSE has closed its positions. |
On the right, resets 00:00 is the time the trading day rolls over, when the lock lifts and the day starts from zero again: TRADES and LOSERS go back to 0, and so does CLOSED in DAILY RISK. It is broker server time, the hour set by DAY STARTS (H) in SETTINGS › DAILY, and it is shown whether the day is locked or not.
A lock outlives the terminal: it is stored per account and trading day, so closing MetaTrader and opening it again does not clear it. Only the day rolling over does.
Daily risk
| Figure | Meaning |
|---|---|
| DAILY RISK 1.63% / 2.00% | What today would cost if every stop of the open positions were hit and every pending order filled and hit its stop, plus the loss already closed today. Against your MAX DAILY LOSS, with a status word and a bar. This is the figure every new trade is checked against. |
Below it, the parts on the left, in % of your balance (or equity, per RISK MODE), and the rest of the day on the right:
| Figure | Meaning |
|---|---|
| CLOSED | Profit or loss closed today, with its sign. A loss counts in full. A profit is shown dimmed and counts as 0: a good morning is not room to spend in the afternoon. |
| OPEN | What the open positions would lose from their entries to their current stops. It stays still while the stops stay still. A position whose stop is at break even or beyond counts 0: it can no longer close at a loss. |
| PENDING | What the pending orders would lose if they were filled and then stopped out. |
| DAILY RISK | The three added up — the same figure as above. |
| FLOATING | Profit or loss of the open positions now, in money. It is not added: a floating loss is already inside OPEN, on its way to the stop. |
| LEFT | How much more the day can risk, in money: MAX DAILY LOSS minus DAILY RISK. The largest risk the next trade can take. Never below 0. |
| TRADES | Trades opened today, against the maximum per day: 2 / 5 , or 2 / - when no maximum is set. |
| LOSERS | Losing trades closed today, against the maximum per day: 1 / 3 , or 1 / - when no maximum is set. |
| FREE MRG | Free margin on the account. |
| MRG LEVEL | Margin level: equity over used margin, as a percentage. - with nothing open. |
An example: CLOSED -0.13% , OPEN 1.00% , PENDING 0.50% — DAILY RISK is 1.63% . The closed loss of 0.13% adds 0.13%; had the day closed at +0.13% , DAILY RISK would be 1.50% .
Why the three parts sometimes do not add up to DAILY RISK. The panel works in exact amounts and rounds to two decimals only to print them. DAILY RISK is the rounded exact sum, not the sum of what you see rounded, so it can differ by 0.01:
| Exact | On screen | |
|---|---|---|
| CLOSED | 0.124% | -0.12% |
| OPEN | 1.004% | 1.00% |
| PENDING | 0.504% | 0.50% |
| DAILY RISK | 1.632% | 1.63% |
What you see adds up to 1.62%, and the panel shows 1.63%, the rounded 1.632%. It is not an error: the figure measured against MAX DAILY LOSS, and the one a trade is accepted or refused on, is always the exact one.
Why each trade adds a little less than you asked. The lot is rounded down to the broker's volume step, so each trade risks what you asked or slightly less, never more. The smaller the lot, the more it shows: at 0.20% on BTCUSD, an exact lot of 0.052 becomes 0.05 and risks 0.19%. Four trades of 0.25%, 0.25%, 0.20% and 0.20% can add up to 0.88% instead of 0.90%. Each trade's real figure is RISK on the TRADE tab, before you press BUY or SELL.
DAILY RISK blocks a trade; the loss actually taken locks the day. Two different checks:
- A new trade is refused when DAILY RISK plus that trade's risk would go past MAX DAILY LOSS. An open position counts with its full distance to the stop, not with what it has lost so far. With 1% closed and a trade open that risks 0.5% to its stop but is only 0.3% down, DAILY RISK is 1.5%: against a 2% limit the next trade may risk 0.5%, not 0.7%.
- The day locks — the banner turns to LOCKED — when the loss already taken today reaches MAX DAILY LOSS. The loss taken is what closed at a loss plus what the open positions are losing right now. If the panel manages every position and order, that only happens once every stop is hit, and by then those positions are closed by the stops themselves. The lock acts before that when there are trades opened outside the panel, a stop moved further away or removed after opening, a gap or slippage past the stop, or swap adding up.
Four examples, all on a 10,000 balance with MAX DAILY LOSS at 2%, that is 200:
| Case | What happens |
|---|---|
| A trade opened outside the panel | 120 is closed and a panel position can lose at most 80 down to its stop. You open 1 lot from the terminal with no stop. With the panel's position 50 down, the moment the stopless one passes 30 the day locks — even though the panel's position still has 30 to go to its stop, because 120 + 50 + 30 = 200 |
| A stop moved by hand | You open with 100 at risk and the guard accepts it. Then you drag the stop twice as far: that position can now lose 200, double what was approved |
| A gap or slippage | Your stop sits at a 200 loss, but the market opens below it on Monday and it fills at 260. You have lost 60 more than planned |
| Swap adding up | You hold a position for days and the negative swap adds to the loss, with no stop having moved at all |
Why the lock does not watch DAILY RISK. With a 2% limit, two trades risking 1% each put DAILY RISK at 2% the moment they open, with nothing lost at all. Were the lock measured on that, the day would close without a cent lost, and stay closed even after both positions moved to break even, when they can no longer lose anything.
The list (ON ACCOUNT) — up to five rows, then +N more . The heading counts positions, orders and any without a stop. Positions and orders without a stop come first, marked NO SL in red; the rest follow, largest risk first. Each row shows the symbol, the kind (BUY, SELL, BUY LIMIT, SELL STOP…), and what it risks from its entry as a percentage and in money. A row the panel does not manage is dimmed: it counts towards your risk, but the panel will not modify or close it.
MANAGER — the positions and orders the panel manages
Two secondary tabs at the top choose the list: POSITIONS or ORDERS, each with how many there are, so an order waiting on the other list is never out of sight. The panel remembers which one you left open. Only the positions and orders the panel manages are listed, as set in SETTINGS › EXEC; the RISK tab counts every trade on the account.
POSITIONS
On the right, the positions' profit or loss added up. Below, the newest five positions (then +N older position(s) not shown ):
| Column | Meaning |
|---|---|
| Symbol | Click a row to select it. The highlight goes with that position, not with the row: when another opens and the list reorders, you still have the same one selected |
| Side and volume | BUY 0.25 |
| P/L | Floating profit or loss. From 1000 on without decimals ( +20724 ), and in millions from a million on ( +1.23M ), so it fits; the exact figure is on the selected position below |
| Protection state | INITIAL (original stop), BE (at break even), TRAIL (trailing), TRAIL OFF (trailing reached but switched off for this position), NO SL (no stop loss) |
The selected position
| Figure | Meaning |
|---|---|
| SL / TP | Current stop loss and take profit; none if not set |
| RISK | What the position risked when it opened: from its entry to its original stop, at the volume it was opened with. Fixed: it does not change as the price or the stop moves, nor with a partial close. What follows the stop is AT RISK, here, and OPEN on the RISK tab |
| AT RISK | What it would lose from the current price to its current stop (see below) |
| R NOW | How far the price has gone, in R: +1.00R means one stop-distance in profit |
| TRAIL | Whether trailing is ON or OFF for this position, or n/a when trailing is not part of the protection mode |
Why AT RISK moves while the stop does not. It measures what you would lose from here, not from the entry. A buy of 1 lot at 1.1000 with the stop at 1.0980 risks 200 from the entry:
| Price now | Floating | AT RISK | Why |
|---|---|---|---|
| 1.1000 | 0 | 200 | The full distance to the stop |
| 1.1010 | +100 | 300 | The 100 you are up, plus the 200 to the stop |
| 1.0990 | −100 | 100 | 100 already lost, 100 still to go |
So AT RISK grows when the trade goes your way — there is more to give back — and shrinks when it goes against you. Once the stop is past the entry, what remains at risk is only the profit between the price and the stop. It is a figure for managing the position.
Buttons
| Button | What it does |
|---|---|
| BE | Moves the stop to break even now, without waiting for the BE TRIGGER R. The stop still has to be a legal one: behind the current price and at the broker's minimum distance. With the price too close to the entry it is refused, the status strip says why, and you can press it again later |
| TRAIL | Switch trailing on or off for this position only |
| 25% / 50% | Close that part of it. When that part cannot be split off because what remained would be below the minimum lot, the confirmation says the whole position will close |
| CLOSE | Close it |
| BE ALL | Break even on every managed position that allows it |
| CLOSE LAST | Close the most recently opened position |
| CLOSE ALL | Closes every managed open position. Pending orders are left alone: they are deleted from the ORDERS list. (To close the positions and delete the orders in one go, use FLATTEN ALL on the TRADE tab.) |
Every closing action asks for a second click: the button first turns into OK? (25%, 50%, CLOSE) or CONFIRM (CLOSE LAST, CLOSE ALL).
ORDERS
To the right of the switches, what every pending order would lose added up, if it filled and was stopped out. When any of them has no stop loss it reads n NO SL in red instead: without a stop that risk cannot be worked out, and that is the news that matters.
Below, the newest five orders, then +N older order(s) not shown . Each row:
| Column | Meaning |
|---|---|
| Symbol | Click a row to select it. The highlight goes with that order, not with the row |
| Kind | BUY LIMIT, SELL STOP, BUY STP LMT…, in red when the order has no stop loss |
| Volume | The order's lots |
| Price | The price that would fill it |
The selected order
| Figure | Meaning |
|---|---|
| Title | Symbol, kind and volume; on the right what it would risk, as a %, or NO SL |
| ENTRY | The price that fills it |
| SL / TP | Its stop loss and take profit; none if not set |
| RISK | What it would lose if it filled and was stopped out, in money |
| DIST | How far the market is from the entry, in points |
| EXP | When it expires: GTC (until cancelled), day , or the date and time it lapses. The panel always places its own orders as GTC ; anything else comes from an order placed in the terminal, since the expiry cannot be chosen on the panel |
With ORDERS chosen, the position buttons give way to the order buttons in the same places:
| Button | What it does |
|---|---|
| DELETE | Delete the selected order |
| DELETE LAST | Delete the most recently placed order |
| DELETE ALL | Delete every managed pending order |
All three need a second click. Switching lists cancels a click still waiting for its second.
SETTINGS — four secondary tabs
Choose a secondary tab: RISK, DAILY, PROTECT or EXEC. Click a value to edit it or to step through its choices.
RISK holds the two limits a trader thinks in — per trade and per day — plus the maximum lot. DAILY holds the counts and what a reached limit does.
RISK
| Row | Meaning |
|---|---|
| RISK MODE | The default risk mode for the TRADE tab: % BALANCE, % EQUITY, MONEY or LOTS |
| RISK PER TRADE | The default risk of one trade. What the number means depends on RISK MODE, as explained just below this table |
| MAX DAILY LOSS | The most the account may lose in one trading day, as a %. A new trade is refused if it would take DAILY RISK past it; the day locks when the loss actually taken reaches it (see the RISK tab). Setting it to 0 (zero) turns it off |
| MAX LOT | Ceiling on any single trade. Setting it to 0 (zero) turns it off. The MAX LOT paragraph at the end of this section explains it |
| BLOCK IF NO SL | While any position has no stop loss, new trades are refused |
What RISK PER TRADE means in each mode. There is no fixed reference account. The panel reads your real balance and equity, and your account's currency (USD, EUR, GBP…), from your broker, and every amount it shows is in that currency. Taking a balance of 10,000 as an example:
| RISK MODE | RISK PER TRADE | The trade risks |
|---|---|---|
| % BALANCE | 1.00 | 1% of 10,000 = 100 |
| % EQUITY | 1.00 | 1% of the equity at that moment: with 200 of floating profit, 1% of 10,200 = 102 |
| MONEY | 150 | 150, whatever the balance |
| LOTS | 0.50 | 0.50 lots. What that risks depends on the stop; the TRADE tab shows it |
The percentages follow the account: when the balance grows to 12,000, that same 1% becomes 120.
What a percentage is measured against. Every percentage needs an amount to be a percentage of, and RISK MODE decides which:
- in % EQUITY, the equity — the balance plus or minus what the open positions are making or losing right now, so it moves with the market;
- in % BALANCE, MONEY and LOTS, the balance, which only changes when you close a trade.
It is the same amount for every percentage on the panel: RISK PER TRADE, MAX DAILY LOSS, and DAILY RISK with its CLOSED, OPEN and PENDING parts.
DAILY
| Row | Meaning |
|---|---|
| TRADES/DAY | Most trades opened in one trading day. Setting it to 0 (zero) turns it off |
| LOSERS/DAY | Most losing trades in one trading day. Setting it to 0 (zero) turns it off |
| DAY STARTS (H) | The server hour the trading day begins, 0–23 |
| LIMIT: BLOCK | When a limit is reached, refuse new trades for the rest of the day |
| LIMIT: DEL PEND | …and delete the panel's pending orders |
| LIMIT: CLOSE | …and close the panel's positions, but only when the limit reached is MAX DAILY LOSS; not on TRADES/DAY or LOSERS/DAY |
When LIMIT: CLOSE acts. It closes the panel's open positions at market, once, when the loss actually taken today — closed plus floating — reaches MAX DAILY LOSS. Not when TRADES/DAY (trades opened today) or LOSERS/DAY (losing trades closed today) is reached: those count trades, not money, and closing then would close the very trade that was just opened. It is off by default, because closing at market turns into a real loss what the stops might not have taken.
If every trade goes through the panel with a stop, it has nothing to do. The guard lets DAILY RISK reach MAX DAILY LOSS at most, so the day's loss only gets there when the last stop is hit, and the stops have already closed those positions. It is a safety net for losses the guard could not see coming, such as:
- a trade opened from the terminal or by another expert, which DAILY RISK counts but the guard cannot refuse;
- a stop moved further away, or removed, after the trade was opened;
- a gap or slippage past the stop, and swap and commission adding up.
An example, with a balance of 10,000 and MAX DAILY LOSS at 2% (200). 120 is already closed; the panel has a position that can lose at most 80 down to its stop, and a 1-lot trade opened from the terminal has no stop. With the panel's position 50 down, the moment the manual trade passes 30 the loss taken is 120 + 50 + 30 = 200: the day locks and LIMIT: CLOSE closes the panel's position, 30 before its stop. The manual trade is closed too only if the panel manages it — SETTINGS › EXEC › MANAGE on MANUAL or MANUAL+EA.
PROTECT
| Row | Meaning |
|---|---|
| PROTECTION | NONE, BE ONLY, TRAIL ONLY or BE+TRAIL |
| BE TRIGGER R | Profit, in R, at which the stop moves to break even |
| BE OFFSET PTS | Points past the entry the break-even stop is placed, so the trade covers its costs. It is measured in the symbol's points: 20 points are 2 pips on EURUSD but 0.20 dollars on BTCUSD. On indices, metals and crypto, raise it so it covers spread, commission and swap |
| TRAIL START R | Profit, in R, at which trailing starts. With BE+TRAIL it waits for the break-even stop to be in place, even if TRAIL START R is reached first |
| TRAIL METHOD | ATR (a multiple of the ATR) or FIXED (a distance in points) |
| ATR TIMEFRAME | The timeframe the ATR is read from. It is the ATR of the last closed bar, not of the bar still forming. ATR method only |
| ATR PERIOD | How many bars the ATR averages (14 by default). More bars give a steadier ATR that is slower to follow a change in volatility. ATR method only |
| ATR MULTIPLIER | How many ATRs behind the price the stop follows. At 1.5 with an ATR of 20 pips, the stop trails 30 pips behind the price. ATR method only |
| TRAIL STEP ATR | The stop only moves once it can move this much further, in ATR. ATR method only |
| TRAIL DIST PTS | How many points behind the price the stop follows (200 by default, that is 20 pips on a 5-digit pair). FIXED method only |
| TRAIL STEP PTS | The stop only moves once it can move at least this many points further (40 by default), so it is not modified on every tick. FIXED method only |
Break even and trailing are measured in R, so a position opened without a stop — which has no R — gets neither. See section 4.
EXEC
| Row | Meaning |
|---|---|
| MANAGE | Which trades the panel may modify and close: THIS EA, MANUAL+EA, ALL, MANUAL, MAGIC or SYMBOL. Risk always counts the whole account, whatever this says. Asks for a CONFIRM click |
| MAGIC ONLY / SYMBOL ONLY | The magic number or symbol for the MAGIC and SYMBOL modes. Shown only when MANAGE is in that mode |
| CONFIRM SECS | How long the second click of a confirmation stays valid |
| SLIPPAGE PTS | Maximum slippage accepted on a market order, in points |
| RT COMM/LOT | Commission per lot, round turn (RT). Setting it to 0 (zero) estimates it from your trade history |
| MAGIC NUMBER | The number the panel stamps on its own trades. Asks for a CONFIRM click |
Two rules govern settings:
- The panel wins over the inputs. What you set here survives restarts. The EA's inputs are only the starting point. The exception is an input you change on the Inputs tab of the EA's properties window (the one that opens when you drag it onto a chart, or with F7): that value then wins over the panel's.
- A looser limit waits for tomorrow. Raising a cap, switching one off, dropping an action on a reached limit, switching BLOCK IF NO SL off or moving DAY STARTS (H) is stored and applies from the next trading day. The row shows the new value, and beside it now … with the value that applies until then; the note at the bottom says so. A tighter limit applies at once. Raising your daily loss limit halfway through a bad day is exactly what this rule prevents.
RESET TO INPUTS puts everything back to the EA's inputs (two clicks).
MAX LOT is a ceiling on any single trade, whatever the risk asks for — a guard against a stop so tight that the lot explodes, or a fixed lot typed with a zero too many. Above it, the lot is cut to the ceiling, the figure reads LOTS MAX in amber for as long as it stays cut, and the status strip gives the risk the trade now carries:
Capped at your maximum lot, 0.30 - this trade risks 0.60%
A ceiling below the broker's minimum lot refuses the trade instead.
Whole account, not just this EA. The risk figures count every position on the account, whoever opened it. A trade you opened by hand on another chart still spends your daily budget. What the panel may modify or close is the MANAGE setting.
When a limit is reached, the trading day locks, and what that does is what the three LIMIT rows say. The lock survives a restart and releases when the trading day rolls over — not when you restart the terminal. A limit blocks a trade before it is sent, and says which figure blocked it:
BUY blocked. Daily loss limit: DAILY RISK 1.00% + this trade 0.50% > 1.30%
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.
- 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.
- 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 Algo Trading 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. What it writes to disk
Everything lives under MQL5\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 |
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.
7. Inputs reference (the Inputs tab)
The dialog groups the inputs under these headings, 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 |
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 |
| 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 |
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.
8. 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. Set it yourself in SETTINGS › EXEC if your broker charges one; otherwise sizing assumes none.
- "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.
- The arrows and dotted lines of past trades show on top of the panel. That is the chart's trade history, which MetaTrader draws above every object, the panel included. To hide it: right-click the chart › Properties › Show tab, untick Show trade history.
- 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 the panel says so on its status strip. The figures still update. To try the panel for real, run it on a demo account.
Risk Control Panel 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.


