Capital protection: brakes fitted BEFORE they are needed
The account as a whole gets its own layer of defense: Equity Guard books the basket's profit, Basket Max Loss sets the floor, a daily limit cuts a bad day short, and quality gates block bad entries.
A single position is defended by the SL. A campaign — by limits and the reaction to the reversal. But the account as a whole needs its own layer of defense, working INDEPENDENTLY of signal quality. This set arms four mechanisms:
- Equity Guard (EG) — a trailing stop on the BASKET RESULT. When the combined profit of the open positions reaches
EG_Start(5 USD), the guard arms; from then on the result may pull back at mostEG_Dist(2.50 USD) from its peak — after that everything is closed. Earned profit stops being “paper”. - Basket Max Loss (BML) — the basket’s hard floor: a combined loss of 25 USD (2.5% of the deposit) closes everything. This is the safety in case an averaging campaign goes the wrong way.
- Daily P/L Limit (DPL, loss side) — a daily result of −40 USD (4%) disables trading until the end of the day (a hard stop, reset at the day anchor hour). It protects against the most dangerous phenomenon: adding positions after a series of losses.
The thresholds are deliberately pressed down to the scale of a basket with a 0.01 lot — in this lesson the brakes are meant to actually fire, so you see them in action rather than merely knowing they exist. With a larger lot or balance, scale the values proportionally.
- Entry-quality gates —
Global_MaxSpread=50(no entries on a blown spread, e.g. rollover) andFreeOpens_N=3(from the 4th campaign position on, at least 1 open position must be IN PROFIT — an anti-martingale brake).
What is enabled and why
| Feature | Value in the set | Rule |
|---|---|---|
EG_Start_value=5, EG_Dist_value=2.5 (mode: currency) | +5 arms, −2.50 from the peak closes | ”what is earned should stay earned” |
StopAfterEG_Mode=2, 60 min pause | after EG fires, an hour’s break | the result is booked, emotions cooled |
BasketMaxLoss_Mode=0, value=25 | a basket loss of 25 USD = close | the floor of the planned loss |
DPL_Loss_value=40, action: hard stop | a day at −40 USD = end of trading today | tomorrow is a session too |
Global_MaxSpread=50 | spread > 50 pts blocks entries | we do not pay to enter at the worst moment |
B1_FreeOpens_N=3 | the 4th entry only with a position in profit | averaging with your own, not borrowed |
The trigger hierarchy: DPL (account, day) → EG/BML (basket, now) → SL/BE/TS (a single position). Each layer has a different horizon.
How it makes price behavior visible
- The basket result is a chart too. EG treats the profit curve like a price and puts a trailing on it. You will see in practice how the basket’s profit waves — and how often the last wave gives everything back if nobody stops it.
- The distribution of days. DPL teaches you to look at trading in units of DAYS, not trades: a single bad day is allowed to happen — it is not allowed to drag a whole week with it.
- Spread as a signal. The MaxSpread gate shows that the market’s microstructure itself (rollover, data releases) can be a filter: when the spread runs away, the entry conditions are bad by definition.
What to watch
- The Equity Guard status line on the EA panel (armed / stop level).
- The
[EG],SAFETYand[DPL]entries in the log — each firing with amounts. - Days ended by DPL — compare with what happened next: how many losses were NOT realized thanks to the hard stop.
Next step
Lesson 10: protection also has a dimension of TIME — when to trade at all and who watches the stops when the VPS goes down. Schedule and server-side stops.
EG_ModeEG_Start_valueEG_Dist_valueStopAfterEG_ModeStopAfterEG_PauseMinutesBasketMaxLoss_ModeBasketMaxLoss_valueDPL_Loss_ModeDPL_Loss_valueDPL_Loss_ActionDPL_AnchorHourGlobal_MaxSpreadB1_FreeOpens_N
Load these in MetaTrader 5 via F7 → Load to reproduce the lesson exactly. As of release 2.00 the robot starts switched off, so after loading also click ON in the panel's top row — without it nothing will happen. Available to signed-in users with an active licence.
Educational material, not investment advice. The sets are teaching examples — before any live use, test on real ticks and tune to your own account. Reference deposit 1000 in account currency, lot 0.01; scale money values proportionally to your balance.