O!kurra
Core Lesson 09 New layer: Equity Guard, Basket Max Loss, DPL, gates

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.

On the left, the basket result curve with Equity Guard trailing — armed at +5 and closed after giving back 2.50 from the peak — plus the Basket Max Loss floor at −25; on the right, the trigger hierarchy of three defense horizons (position, basket, day) and the entry-quality gates: maximum spread and free opens.

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 most EG_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 gatesGlobal_MaxSpread=50 (no entries on a blown spread, e.g. rollover) and FreeOpens_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

FeatureValue in the setRule
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 pauseafter EG fires, an hour’s breakthe result is booked, emotions cooled
BasketMaxLoss_Mode=0, value=25a basket loss of 25 USD = closethe floor of the planned loss
DPL_Loss_value=40, action: hard stopa day at −40 USD = end of trading todaytomorrow is a session too
Global_MaxSpread=50spread > 50 pts blocks entrieswe do not pay to enter at the worst moment
B1_FreeOpens_N=3the 4th entry only with a position in profitaveraging 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

  1. 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.
  2. 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.
  3. 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], SAFETY and [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.

F7 keys in this lesson
  • EG_Mode
  • EG_Start_value
  • EG_Dist_value
  • StopAfterEG_Mode
  • StopAfterEG_PauseMinutes
  • BasketMaxLoss_Mode
  • BasketMaxLoss_value
  • DPL_Loss_Mode
  • DPL_Loss_value
  • DPL_Loss_Action
  • DPL_AnchorHour
  • Global_MaxSpread
  • B1_FreeOpens_N
Lesson .set files

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.

🔒 Sign in with an active licence to download the sets.

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.