← SFRecovery EA product page · Setup guide · Download the v3.31 presets (.zip)
SFRecovery EA - Inputs Manual
Version 3.31 - generated from the EA source, so every input is listed with its real default. Highlighted cells show where a preset differs from the default.
1. What the EA does (and does not do)
SFRecovery is a manager, not a trading system. It has no entry signal. It watches positions that already exist (your manual trades, or the magic numbers you list) and, when they fall into a loss, runs a recovery cycle: it adds averaging orders on the losing side so the average entry moves closer to price, then closes the whole basket at break-even plus a target. A recovery grid increases exposure while the market moves against you; the protections below bound that risk, they do not remove it.
2. A cycle, step by step
- ARMED - the panel shows
TRIGGER loss $3.20 / $15.00: the live loss of the monitored positions against the loss that launches a cycle.
- LAUNCH - fires on the first trigger reached: floating loss in money (
InpDDMoney), account drawdown in % (InpDDPercent), or at once (InpInstantLaunch). All presets use the money trigger with the % trigger OFF. The journal prints the exact reason: [ACTIVE] why: loss $15.20 >= trigger $15.00.
- FIRST ADD - the first averaging order opens immediately at launch, by design. Further adds need price to move one more grid step (or
InpStepBars bars to pass), up to InpMaxOrders.
- EXIT - basket take-profit (
[BASKET TP]), paired partial closes ([PARTIAL]; with a negative InpPartMinNet a pair may close at a small loss on purpose), or the anti-stall exit after InpCycleMaxBars bars ([CYCLE-MAX]).
- PROTECT - see section 4. Every close is tagged in the Experts journal, so any exit can be traced to its rule.
The cyan "basket BE" line is not a stop. It is the break-even price of the whole basket, drawn while a cycle is active so you can see where the basket stops losing. It never modifies an order and has nothing to do with the DD% input.
3. Presets in one table
| Preset | Launch trigger | Basket cap | Absolute close | First avg lot | Notes |
| Guardian | $15 loss | $250 | 10% | 0.01 | Lowest-risk profile, ATR grid |
| Control | $15 loss | $250 | 10% | 0.01 | Guardian + takes the whole symbol book at 2% DD |
| AW_Zona | $15 loss | $250 | 10% | 0.01 | Dual-side ZONE grid, hedging accounts only |
| Agresivo / Conservador / Equilibrado | $50 loss | $400 | 12% | 0.05 | Kalman mode; caps were OFF before v3.31 |
All money values are written for a 10k USD account and scale automatically with your equity (InpAutoEquityScale); the panel footer shows the scale in use. Presets are starting points, not a promise of results.
4. Protections - what closes what
| Rule | Journal tag | Measured on | What happens |
| CB tier 1 / 2 | - | equity DD % from peak | Tier 1 halves new lots, tier 2 stops new adds |
| CB tier 3 | [CB KILL] | equity DD % from peak | Flattens, waits InpCBCooldown bars, then re-arms |
| Basket cap | [MAX LOSS] | loss of the managed basket in money | Flattens the basket + cooldown |
| Absolute close | [ABSOLUTE CLOSE] | equity DD % from the true session peak | Flattens and stops the EA for good |
| Daily stop | [DAILY KILL] | equity vs day-start balance | Flattens, halts until the next server day |
| Worst-case preflight | [WORST-CASE] | projected loss of a full grid + N ATRs | Shown before every cycle; refuses the launch above InpMaxEquityRiskPct |
Always set a hard floor. The CB tier 3 re-arms after each cooldown. Without InpAbsoluteClose or InpMaxLossMoney, losses can repeat in tier-3 sized steps. Since v3.31 the absolute close is measured from the true session peak, so repeated CB kills can no longer walk the account below it.
5. Stopping your other EAs when the protection fires
MetaTrader 5 gives an EA no way to switch another EA off. v3.31 provides the enforceable equivalent:
InpKillScope = SYMBOL or ACCOUNT: every kill also closes the positions and pending orders of other EAs in that scope (MANAGED = only the recovery basket, the pre-3.31 behaviour).
InpHaltGuard = true: while the EA is halted (cooldown, absolute close, daily halt), any new position another EA opens inside the scope is closed at once.
InpHaltGlobalVar: the terminal global variable SFR_HALT_<symbol> is 1 while halted, 0 otherwise. Your own EAs can read it with GlobalVariableGet() and pause themselves.
ACCOUNT scope also closes your own manual trades on every symbol when a kill fires. Use it only on an account dedicated to the EAs it should police.
6. Strategy Tester notes
- The tester has no manual trades, so with
InpTestAuto=true (default) the EA opens a random-direction demo trade every InpTestEveryN bars to show full cycles. Those entries have no edge: the tester P/L shows how the manager behaves, not a strategy result.
- In visual mode, use the BUY/SELL pad. Since v3.31 the random demo entries pause as soon as you trade from the pad.
- The presets ship with
InpTestAuto=false: in a non-visual test they open only one validation trade. Switch it on to see cycles.
- At start the Experts journal prints a CONFIG SUMMARY: the active trigger, every cap (or OFF), and the inputs your configuration does not use.
7. All inputs
- ORDERS TO RECOVERY SETTINGS
- LAUNCH SETTINGS
- REGIME GATE (v3.29)
- WORST-CASE PREFLIGHT (v3.30)
- CIRCUIT BREAKER (PROTECTION)
- KILL SCOPE / HALT GUARD (v3.31)
- TAKEPROFIT AND PARTIAL CLOSE
- RECOVERY GRIDS AND AVERAGE ORDERS
- DUAL SIDE (ZONE) SETTINGS
- CONTROL MODE (TAKE CONTROL) SETTINGS
- UNIVERSAL MODE (v3.26)
- KALMAN FILTER SETTINGS
- MANUAL TRADING
- PROTECTION SETTINGS
- TELEGRAM
- PANEL
- STRATEGY TESTER
ORDERS TO RECOVERY SETTINGS
| Input | Default | What it does | Guardian | Agresivo |
|---|
InpMagicForRecovery | "*" | Magic numbers to recover (0=manual trades, comma sep, "*" or "ALL" = every external EA) | 0 | 0 |
InpUseLock | false | Lock basket at max DCA level (freeze floating loss, hedging accounts only; v3.17 default OFF - the lock auto-releases via InpLockReevalBars) | false | false |
InpRecoveryStyle | DCA_FIRST | Launch style: DCA_FIRST (classic), LOCK_FIRST (freeze+wait), LOCK_DRAIN (freeze+drain loss gradually) | 0 | 0 |
InpDeleteSLTP | true | Delete SL and TP at launch | true | true |
InpCloseProfit | true | Close profitable orders at launch | true | true |
InpDeletePending | true | Delete pending orders at launch | true | true |
LAUNCH SETTINGS
| Input | Default | What it does | Guardian | Agresivo |
|---|
InpMode | REC_KALMAN | Recovery mode | 2 | 3 |
InpInstantLaunch | false | Instant launch (start recovery immediately) | false | false |
InpDDPercent | 0.0 | Launch trigger: account equity DD % from peak (0=disabled). If both triggers are set, the FIRST one to hit launches | 0.0 | 0.0 |
InpDDMoney | 50.0 | Launch trigger: monitored positions' floating loss >= $ (auto-tuned to symbol/equity, see the panel; 0=disabled) | 15.0 | 50.0 |
InpAbsoluteClose | 0.0 | Absolute close: equity DD % from the TRUE session peak (never reset by CB cooldowns) -> close + stop EA for good (0=disabled) | 10.0 | 12.0 |
InpLaunchPullbackBars | 0 | Launch only after N bars with no new extreme (0=launch at once) | 0 | 0 |
InpCloseCounterTrend | false | Close losers that fight the Kalman slope at launch instead of averaging them (OFF recommended: tests showed it turns recoverable trades into realized losses) | false | false |
REGIME GATE (v3.29)
| Input | Default | What it does | Guardian | Agresivo |
|---|
InpGateRegime | false | REGIME GATE on launch: block cycles in vol extremes / off-session (fail-open; CONTROL mode bypasses) | false | false |
InpGateATRHigh | 90.0 | Block launches when D1 ATR percentile (last 260 bars) >= this (vol explosion / news) | 90.0 | 90.0 |
InpGateATRLow | 5.0 | Block launches when D1 ATR percentile <= this (dead tape, grid stalls) | 5.0 | 5.0 |
InpGateHourFrom | 7 | Launch window start (server hour, inclusive; wraps if From>To) | 7 | 7 |
InpGateHourTo | 21 | Launch window end (server hour, exclusive) | 21 | 21 |
InpGateBlockLog | true | Log every blocked launch once per bar (off = silent) | true | true |
WORST-CASE PREFLIGHT (v3.30)
| Input | Default | What it does | Guardian | Agresivo |
|---|
InpWorstCaseATRs | 5.0 | Worst case: adverse continuation beyond the LAST add, in D1 ATRs | 5.0 | 5.0 |
InpMaxEquityRiskPct | 0.0 | Refuse launches whose worst case exceeds this % of equity (0 = display only - recommended first) | 0.0 | 0.0 |
InpWorstCaseTG | true | Include the worst case in the launch Telegram | true | true |
CIRCUIT BREAKER (PROTECTION)
| Input | Default | What it does | Guardian | Agresivo |
|---|
InpCBTier1 | 2.0 | Tier 1: reduce lots 50% at DD% | 3.0 | 2.0 |
InpCBTier2 | 4.0 | Tier 2: halt new orders at DD% | 4.0 | 4.0 |
InpCBTier3 | 6.0 | Tier 3: close all + cooldown at DD% | 6.0 | 6.0 |
InpCBCooldown | 24 | Cooldown after kill (bars) | 24 | 24 |
InpMaxLossMoney | 0.0 | Hard kill: flatten basket if managed loss >= $ (0=off) | 250.0 | 400.0 |
InpDailyLossPct | 0.0 | Daily equity stop: flatten + halt until next day at this % of day-start balance (0=off; prop firms: 40-60% of the firm limit, e.g. 2% vs 5%) | 0.0 | 0.0 |
InpMaxDailyKills | 0 | Halt the day after N kills (CB tier-3 / max-loss / daily) (0=off) | 0 | 0 |
KILL SCOPE / HALT GUARD (v3.31)
| Input | Default | What it does | Guardian | Agresivo |
|---|
InpKillScope | KILL_MANAGED | What a KILL closes (CB tier 3 / max loss / absolute / daily): MANAGED = only the recovery basket (v3.30), SYMBOL = every position + pending on this symbol (any EA), ACCOUNT = every position + pending on the account | 0 | 0 |
InpHaltGuard | false | While HALTED (cooldown / absolute close / daily halt): close any position other EAs open inside the kill scope and delete their pendings. MT5 does not let one EA switch another off - this is the enforceable equivalent | false | false |
InpHaltGlobalVar | true | Publish the halt as terminal GlobalVariable "SFR_HALT_<symbol>" (1=halted, 0=running) so your own EAs can read it and pause themselves | true | true |
TAKEPROFIT AND PARTIAL CLOSE
| Input | Default | What it does | Guardian | Agresivo |
|---|
InpPartClose | 0.01 | Lots to close each partial (smaller = more gradual) | 0.01 | 0.01 |
InpTPPoints | 10 | Min points profit to trigger partial close | 10 | 10 |
InpCommAware | true | Include broker commission in P/L check | true | true |
InpOverlapAfter | 1 | Allow overlap after N orders | 2 | 1 |
InpBasketTP | true | Use TP for total basket (false = exit only via partials / circuit breaker / manual) | true | true |
InpBasketMoney | 40 | Close whole basket at this PROFIT (break-even + $; set low for near-BE exits) | 25.0 | 40 |
InpBasketPerLot | 0.0 | Extra $ per basket lot on the TP target (0=fixed InpBasketMoney) | 0.0 | 0.0 |
InpLockAtOrder | 0 | Lock when avg count reaches N (0=lock only at max orders) | 0 | 0 |
InpLockReevalBars | 24 | Lock release: re-evaluate every N bars, release when the trend turns (0=locked forever) | 24 | 24 |
InpPartMinNet | -2 | Min NET $ a partial pair must book (0.10=v3.12 net-positive only; negative=AW-style overlap, e.g. -2) | -2.0 | -2.0 |
InpExitCostBuffer | 1.0 | Min NET cushion ($) on every green basket exit (TP / anti-stall / scale-out): covers exit commission + spread the floating P/L cannot see (0 = off) | 1.0 | 1.0 |
InpStepBars | 96 | Anti-stall: force a DCA add after N bars even if the distance gate has not passed (0=distance only) | 96 | 12 |
InpCycleMaxBars | 24 | Anti-stall: after N bars in cycle, exit the basket at any positive P/L (0=wait for full target) | 24 | 24 |
InpScaleTiers | 4 | Staircase scale-out: exit the basket in N profit tiers (0=off, classic single TP). Only active with InpRecoveryStyle=LOCK_FIRST (validated: DCA+scale-out destroys the neto, 3 A/Bs) | 4 | 4 |
InpScaleFirst | 8.0 | Basket P/L $ that fires the 1st scale-out tier | 8.0 | 8.0 |
InpScaleStep | 6.0 | Extra $ of basket P/L per additional tier | 6.0 | 6.0 |
InpScaleFrac | 0.25 | Fraction of the basket closed per tier (last tier closes all) | 0.25 | 0.25 |
InpAvgTPPoints | 0 | Real broker-side TP (points) on every recovery/avg leg (AW uses ~30): the banked win is guaranteed even between ticks. 0=off (v3.22 exact) | 0 | 0 |
InpBuyoutOnTP | false | AUTO-BUYOUT: when an avg leg banks a profit, immediately retire a slice of a loser (pair net >= InpPartMinNet) - the AW part-by-part drain | false | false |
InpLoserPick | 0 | Which loser the buyout retires first: 0=deepest loss (v3.22 rule), 1=closest to break-even (AW: cheapest slice first = continuous trail) | 0 | 0 |
RECOVERY GRIDS AND AVERAGE ORDERS
| Input | Default | What it does | Guardian | Agresivo |
|---|
InpLotMode | LOT_GEOMETRIC | Lot progression mode | 2 | 0 |
InpAvgLot | 0.05 | Volume of first average order | 0.01 | 0.05 |
InpAvgMult | 1.5 | Multiplier to volume | 1.5 | 1.5 |
InpStep | 200 | Step for average orders (points) | 200 | 200 |
InpStepMult | 1.0 | Multiplier to step | 1.15 | 1.0 |
InpMaxOrders | 6 | Max average orders | 6 | 6 |
InpMaxBasketLots | 0.0 | Max total lots of the managed basket (0=off; hard exposure cap - no add once exceeded) | 0.0 | 0.0 |
DUAL SIDE (ZONE) SETTINGS
| Input | Default | What it does | Guardian | Agresivo |
|---|
InpDualSide | DUAL_OFF | Dual-side grid: 0=OFF (v3.18 exact), 1=ZONE (mirror grid on the opposite side, AW-style; arms after the 1st main add; hedging accounts only) | 0 | 0 |
CONTROL MODE (TAKE CONTROL) SETTINGS
| Input | Default | What it does | Guardian | Agresivo |
|---|
InpTakeControlPct | 0.0 | At equity DD% >= this, take control of the WHOLE book on the symbol (any magic - opt-in) and run recovery (ZONE forced) until the book exits at basket TP or the loss caps (0=off) | 0.0 | 0.0 |
InpControlCooldown | 6 | Cooldown after a kill WHILE in control (bars; 0=use InpCBCooldown). Short = re-engages fast instead of days of silence | 6 | 6 |
InpKalmanAdaptive | 0.0 | Kalman-adaptive grid: step x (1 + this x |filter slope|, cap 2x) in strong trends (KALMAN mode only; 0=off - A/B candidate) | 0.0 | 0.0 |
UNIVERSAL MODE (v3.26)
| Input | Default | What it does | Guardian | Agresivo |
|---|
InpUniversal | true | UNIVERSAL MODE: auto-scale everything to the symbol (recommended) | true | true |
InpATRPeriod | 14 | ATR Period | 14 | 14 |
InpATRMult | 1.5 | ATR multiplier for step (manual override, metals) | 0.3 | 1.5 |
InpATRMultForex | 0.15 | ATR multiplier for forex (manual override) | 0.15 | 0.15 |
InpATRMultIdx | 0.05 | ATR multiplier for indices (manual override) | 0.05 | 0.05 |
InpRiskPerTrade | 2.0 | Risk % of equity per recovery cycle (universal mode) | 2.0 | 2.0 |
InpATRTF | PERIOD_D1 | ATR Timeframe | 16408 | 16408 |
InpAutoScale | true | Auto-scale money params by point value (forex/10, idx/10) | true | true |
InpAutoEquityScale | true | Auto-tune: money targets also scale with equity (inputs assume a $10k account) | true | true |
KALMAN FILTER SETTINGS
| Input | Default | What it does | Guardian | Agresivo |
|---|
InpKalmanQ | 0.05 | Process noise (lower=smoother) | 0.05 | 0.05 |
InpKalmanR | 2.0 | Measurement noise (higher=smoother) | 2.0 | 2.0 |
InpKalmanMinProb | 0.4 | Min reversion probability to open | 0.4 | 0.4 |
InpDcaKalmanGate | false | Kalman filter also gates DCA adds (no averaging into a strong counter-slope; keep OFF - backtests: pf 5.05 -> 2.12 with the gate on) | false | false |
InpMaxAvgVolume | 5.0 | Max average volume (cap) | 0.1 | 5.0 |
InpMultiDir | true | Multi-directional trade (true = each cycle recovers whichever side is losing; false = fixed direction from the FIRST cycle of the session, opposite losers stay floating) | true | true |
InpOnePerBar | true | One opened order per bar filtering | true | true |
MANUAL TRADING
| Input | Default | What it does | Guardian | Agresivo |
|---|
InpLotType | 0 | Lot type INITIAL position (0=fixed, 1=risk% - needs InpDefaultSL>0) | 0 | 0 |
InpLotSize | 0.1 | Default lot size | 0.01 | 0.1 |
InpRiskPct | 1.0 | Risk % of equity if SL hits (initial position only; DCA grid unchanged) | 1.0 | 1.0 |
InpDefaultSL | 0 | Default SL (points, 0=none) | 0 | 0 |
InpDefaultTP | 0 | Default TP (points, 0=none) | 0 | 0 |
InpMaxSpread | 0 | Max spread to open (0=any) | 0 | 0 |
InpMagic | 0 | Magic number | 0 | 0 |
InpFitMargin | true | Fit manual lot to free margin (false=reject the trade if it does not fit) | true | true |
PROTECTION SETTINGS
| Input | Default | What it does | Guardian | Agresivo |
|---|
InpMaxSlippage | 30 | Max slippage (points) | 30 | 30 |
InpMaxSpreadProt | 7500 | Max spread protection for DCA adds (points) | 7500 | 7500 |
InpRolloverGuard | true | Block new entries around daily rollover (23:55-00:10 server) | true | true |
InpMaxSpreadEntry | 100 | Max spread (points) for new entries (0=off) | 100 | 100 |
TELEGRAM
| Input | Default | What it does | Guardian | Agresivo |
|---|
InpTelegram | true | Enable Telegram notifications | false | false |
InpTgToken | "" | Bot Token | | |
InpTgChat | "" | Chat ID | | |
InpNotifyLaunch | true | Notify on launch | true | false |
PANEL
| Input | Default | What it does | Guardian | Agresivo |
|---|
InpShowPanel | true | Show panel | true | true |
STRATEGY TESTER
| Input | Default | What it does | Guardian | Agresivo |
|---|
InpTestAuto | true | Auto-open losing trades in tester | false | false |
InpTestEveryN | 50 | Open trade every N bars | 50 | 50 |
InpTestLot | 0.1 | Tester: initial lot for the pad (0=use InpLotSize; the pad value is what opens) | 0.01 | 0.01 |
InpTestDir | 0 | Direction (0=random, 1=buy only, 2=sell only) | 0 | 0 |
Risk warning: averaging down increases exposure during drawdown. Test on a demo account first. Past tests do not predict future results. signalforge-ai.com