Liquidation-Resistant
Risk Engine
v5.4.0 introduced equity-based lot sizing + free margin guard after a real liquidation event. v5.5.0 adds signal-gated entry filtering on top. Multiple defensive layers — no SL, but no naive exposure either.
How v5.5.0 Prevents Account Liquidation
Each layer kicks in at a different stage — entry, sizing, monitoring, recovery, emergency. Stacked, not separate.
Layer 1 — Equity-Based Lot Tier
Tier lot calculated from equity not balance. If account is in drawdown (equity < balance), EA picks lower-tier lots automatically.
lotBasis = (equity > 0 && equity < balance) ? equity : balance;
Before v5.4.0, balance-based tier kept opening tier-4 lots even when equity collapsed → free margin starvation → liquidation. ✓ Now defensive.
Layer 2 — Free Margin Guard
Before OpenNewMainTrade / OpenSPM / OpenDCA, EA calculates required margin via OrderCalcMargin():
if (freeMargin < reqMargin × 1.5) reject;
1.5× safety buffer means even bad trades don't fully consume free margin. 60sn fail cooldown prevents retry spam. ✓ Multi-fold safety.
Layer 3 — Signal-Gated Entry
Before any SPM opens, EA reads buy_score / sell_score from 12-indicator engine. If opposing signal ≥ 50 (45 for SPM3+), trade is rejected.
Translation: "if signal already says we're wrong, don't open another in the wrong direction." ✓ Fragile entries blocked.
Layer 4 — HEDGE_BOOST Conversion
If SPM3 would open against trend, EA converts to HEDGE_BOOST instead — opposite direction, 1.5× lot, signal-confirmed.
Mechanical zigzag ditched in favor of trend-aware hedge strengthening. ✓ ~70% trap reduction.
Layer 5 — MaxDrawdown Last Resort
If despite all layers, account hits MaxDrawdownPercent = 90%, emergency cycle reset triggers. (Should never happen with layers 1–4 active.)
Never** added to losing side blindly — every entry passes through 4+ checks. ✓ Defense in depth.
NO Stop-Loss (deliberate)
SPM system handles loss — closing at SL would lock losses. Hedge layers cover MAIN's drawdown, FIFO closes when net profit ≥ target.
✗ NEVER closes ANA at loss · ✗ NEVER closes hedge at loss
✓ FIFO can close ANA at loss only when SPM profit covers it.
Lot Scales with Balance, Capped Per Symbol
Every symbol category has its own tier — not a one-size-fits-all multiplier. Conservative on small accounts, scaling up safely.
| Balance | FOREX | BTC / Crypto | XAU / XAG / Alt |
|---|---|---|---|
| $0 – $200 | 0.04 lot | 0.01 lot | 0.01 lot |
| $200 – $500 | 0.06 lot | 0.02 lot | 0.02 lot |
| $500 – $1000 | 0.08 lot | 0.03–0.05 | 0.03–0.05 |
| $1000+ | 0.12 lot | 0.05–0.08 | 0.05–0.08 |
In v5.4.0+, these tiers use equity as the basis (not balance) — so a $1000 account in 50% drawdown trades like a $500 account, not a $1000 one.
Safety multipliers from Margin Guard + OpenLotBalancer further reduce lot in tight margin.
Close Targets Scale With Account Size
Smaller accounts close at smaller profit targets. Time decay reduces target on long-held positions to prevent stuck cycles.
Balance-Adaptive Target
Balance < $200 → $3 target
Balance < $500 → $5 target
Balance < $1000 → $8 target
Balance ≥ $1000 → $15 target
Time Decay (long-held positions)
Open 1–2h → 80% of target
Open 2–4h → 60% of target
Open 4h+ → 40% of target
Floor: $2 minimum
Risk Engineered. Not Avoided.
5 layers between your account and a margin call. Equity-aware sizing + signal-confirmed entry + hedge-strong recovery.