Sanju Recovery Grid Guard
- エキスパート
- バージョン: 1.2
- アクティベーション: 5
Sanju Recovery Grid Guard
A two-leg recovery grid Expert Advisor for MetaTrader 5 with built-in guards for one-sided (strongly trending) markets, trading sessions, losses and margin.
IMPORTANT RISK WARNING - PLEASE READ
This EA uses a grid / martingale-type position-sizing method: while a leg is losing it can add positions with larger volumes. This can produce large, fast losses. The guards described below limit this risk but do not remove it. With default inputs the EA LOST money in both 12-month backtests shown below, and lost about 99% of the account on gold. Test on a demo account first, use only risk capital, and expect that losses are possible.
How it works
- Two independent legs (long and short). On start, both legs open at market with the first volume of the ladder.
- A leg scales in with stop orders on an editable volume ladder when price moves one step beyond the leg's highest or lowest entry.
- Pending stop orders follow price.
- A leg closes when its floating profit reaches (lots held x take-profit per lot) and restarts after a short pause.
Guards (all adjustable, all can be switched off)
- One-sided market guard: higher-timeframe ADX + EMA position and slope. In a strong trend, the counter-trend leg stops scaling in, its pending stops are cancelled and (optionally) it does not start new cycles. Defaults: H4, ADX 14, threshold 30, EMA 50, slope 3 bars.
- Grid depth guard: recovery (adverse) adds capped at step 8; recovery distance grows 25% per step and is at least 1.0 x ATR(14, H1).
- Loss limits: a leg is closed when its floating loss reaches 15% of balance (60-minute cooldown); an equity drawdown of 25% from peak closes everything and pauses trading until the next day.
- Margin guard: OrderCalcMargin before every order; free margin after the order must stay at least 50% of equity and margin level at least 300% (150% for the first order of a leg).
- Sessions (server time): new orders only 02:00-21:00, no new legs on Friday after 18:00, optional Friday close-all, rollover pause 23:30-01:30, maximum spread 60 points, no actions while the symbol's trade session is closed. Open legs are still managed and closed at target outside the session.
- Account guard: volumes are checked against minimum, maximum, step and volume limit; on a netting account only one leg runs (hedging both legs needs a hedging account).
- Chart panel shows the status of every guard.
Backtest results (real ticks, default inputs, $10,000, leverage 1:100, hedging account, 2025.10.29 - 2026.10.29)
- EURUSD.m H1: net profit -409.05 USD, profit factor 0.92, max equity drawdown 15.89%, 1,346 trades, no stop-out.
- XAUUSD.m H1: net profit -9,881.21 USD, profit factor 0.87, max equity drawdown 98.97%, 25,101 trades, no stop-out (the loss limits closed positions repeatedly).
For comparison, the same grid with all guards switched off was stopped out on both symbols (EURUSD.m H1: -8,116.46 USD; XAUUSD.m H1: -8,648.30 USD, stopped out on the first test day).
These are historical simulations from one broker's data. Past results do not guarantee future results.
Recommendations
- Start on a demo account. Use a hedging account to run both legs.
- The default step of 100 points is very tight for gold; consider larger steps and a smaller ladder for volatile symbols.
- Do not run other EAs with the same magic number on the same symbol.
A two-leg recovery grid Expert Advisor for MetaTrader 5 with built-in guards for one-sided (strongly trending) markets, trading sessions, losses and margin.
IMPORTANT RISK WARNING - PLEASE READ
This EA uses a grid / martingale-type position-sizing method: while a leg is losing it can add positions with larger volumes. This can produce large, fast losses. The guards described below limit this risk but do not remove it. With default inputs the EA LOST money in both 12-month backtests shown below, and lost about 99% of the account on gold. Test on a demo account first, use only risk capital, and expect that losses are possible.
How it works
- Two independent legs (long and short). On start, both legs open at market with the first volume of the ladder.
- A leg scales in with stop orders on an editable volume ladder when price moves one step beyond the leg's highest or lowest entry.
- Pending stop orders follow price.
- A leg closes when its floating profit reaches (lots held x take-profit per lot) and restarts after a short pause.
Guards (all adjustable, all can be switched off)
- One-sided market guard: higher-timeframe ADX + EMA position and slope. In a strong trend, the counter-trend leg stops scaling in, its pending stops are cancelled and (optionally) it does not start new cycles. Defaults: H4, ADX 14, threshold 30, EMA 50, slope 3 bars.
- Grid depth guard: recovery (adverse) adds capped at step 8; recovery distance grows 25% per step and is at least 1.0 x ATR(14, H1).
- Loss limits: a leg is closed when its floating loss reaches 15% of balance (60-minute cooldown); an equity drawdown of 25% from peak closes everything and pauses trading until the next day.
- Margin guard: OrderCalcMargin before every order; free margin after the order must stay at least 50% of equity and margin level at least 300% (150% for the first order of a leg).
- Sessions (server time): new orders only 02:00-21:00, no new legs on Friday after 18:00, optional Friday close-all, rollover pause 23:30-01:30, maximum spread 60 points, no actions while the symbol's trade session is closed. Open legs are still managed and closed at target outside the session.
- Account guard: volumes are checked against minimum, maximum, step and volume limit; on a netting account only one leg runs (hedging both legs needs a hedging account).
- Chart panel shows the status of every guard.
Backtest results (real ticks, default inputs, $10,000, leverage 1:100, hedging account, 2025.10.29 - 2026.10.29)
- EURUSD.m H1: net profit -409.05 USD, profit factor 0.92, max equity drawdown 15.89%, 1,346 trades, no stop-out.
- XAUUSD.m H1: net profit -9,881.21 USD, profit factor 0.87, max equity drawdown 98.97%, 25,101 trades, no stop-out (the loss limits closed positions repeatedly).
For comparison, the same grid with all guards switched off was stopped out on both symbols (EURUSD.m H1: -8,116.46 USD; XAUUSD.m H1: -8,648.30 USD, stopped out on the first test day).
These are historical simulations from one broker's data. Past results do not guarantee future results.
Recommendations
- Start on a demo account. Use a hedging account to run both legs.
- The default step of 100 points is very tight for gold; consider larger steps and a smaller ladder for volatile symbols.
- Do not run other EAs with the same magic number on the same symbol.
