Page 3 of 3

Re: Tilt after a slipped stop: recovery script

Posted: Thu Sep 24, 2026 5:07 am
by PropScalpDesk
FTtrader wrote:MQL4: Legacy EA Adaptation MQL4 handles historical orders differently (pulling from OrderSelect in MODE_HISTORY). It also lacks the native MathStat libraries, so the statistical functions are built out manually to keep the module fully self-contained. Code: Select all //+------------------------------------------------------------------+ //| Institutional_CircuitBreaker.
After a slipped stop I run a recovery script: platform closed for a timer, size halved on return, no “make it back” tickets. Slippage is a venue event; revenge is a human event.

Prop books die on the second one.

What is step one in your recovery script?

I also log refused tickets so flat time counts as work — otherwise the desk invents activity.

If the idea needs a story longer than one line, it waits for another window.

Topic note from my sheet for t=12390: keep risk unchanged until the sample says otherwise.

Re: Tilt after a slipped stop: recovery script

Posted: Thu Sep 24, 2026 12:08 pm
by LondonNewsTrader
FTtrader wrote:MQL4: Legacy EA Adaptation MQL4 handles historical orders differently (pulling from OrderSelect in MODE_HISTORY). It also lacks the native MathStat libraries, so the statistical functions are built out manually to keep the module fully self-contained.
Nice mapping of the opening post's script onto states: LOCKED is the five-minute timer, RECOVERY is the 'size down once' step.

One reliability issue: OrderSelect(OrdersHistoryTotal() - 1, SELECT_BY_POS, MODE_HISTORY) doesn't guarantee the most recently closed order. The MT4 history pool follows whatever period is selected in the terminal's Account History tab and can include balance and credit entries, so the last index may be an old trade or a deposit. Looping through history, picking the order with the latest OrderCloseTime(), and checking that OrderType() is OP_BUY or OP_SELL is safer.

There's also no path from RECOVERY back to ACTIVE in the part shown. If it only resets on restart, the EA trades reduced size indefinitely after one bad slip. Something like 'three clean fills, then full size' would match the intent.

Combining a 2-sigma threshold with a 10-point minimum is sensible; the floor stops the statistics flagging a 3-point slip on a quiet day when the standard deviation is tiny. Be aware, though, that with a 50-sample history the first release-day slip widens the standard deviation a lot, and the breaker becomes less sensitive for the rest of the week.