EA-12220 · Martingale

Ilan 1.6 Dinamic HT

A martingale-style grid EA that opens an initial position based on RSI and recent price direction, then adds averaging positions with exponentially increasing lot sizes when the existing position goes into loss beyond a dynamic pip threshold. It includes multiple exit mechanisms including trailing stop, equity stop, CCI stop, and time-based stop, but lacks a mandatory hard stop-loss by default.

Open the interactive view (equity curve, symbol switch)

Key facts

CategoryMartingale
RiskDangerous
Blow-up riskElevated
Rating★★☆☆☆
TypeTrading EA
TimeframesM15, H1
IndicatorsRSI, CCI, Highest/Lowest
Authordeveloping Vasiliy Sokolov.

Backtest results (H1, about 1 year)

Not backtested yet — this EA could not be converted automatically.

Blow-up risk: Elevated

  • Increases the position size after losses (martingale)

High: stopped out in our backtest, or martingale/grid sizing without a stop loss. Elevated: martingale or grid sizing with a stop loss, or several positions at once without a stop loss. What the label means and what we found →

Strategy analysis

The EA's core strategy is martingale-style averaging down: the initial entry relies on RSI readings and the price direction of the last two bars — going long when RSI is below 30 and price is rising, going short when RSI exceeds 70 and price is falling. When an existing position's loss exceeds a dynamically calculated pip threshold, the EA opens a new same-direction position with lot size multiplied by LotExponent raised to the power of the current position count, effectively averaging down the entry price. The dynamic pip threshold is derived from the High-Low range of the last Glubina bars divided by the DEL factor, bounded by DefaultPips/DEL (lower) and DefaultPips*DEL (upper). For exits, all positions share a common take-profit calculated from the weighted average price, with four optional protective mechanisms: trailing stop, CCI extreme level exit, equity drawdown stop, and time-based closure. Position sizing uses exponential lot increase (Lots × LotExponent^(N+1)), which is classic martingale money management that causes position sizes to escalate dramatically during consecutive losses.

Strengths

  • Dynamic pip threshold adapts to market volatility using recent High-Low range, providing more flexible grid spacing than fixed intervals
  • Offers multiple exit protection mechanisms (trailing stop, equity stop, CCI stop, time-based stop) giving traders flexible risk control options
  • Clean code structure with good modularization using object-oriented libraries for trade state and environment management
  • Unified take-profit based on weighted average price ensures all positions close only when the overall basket is profitable

Weaknesses

  • Martingale position sizing causes exponential lot escalation during adverse moves, creating catastrophic blow-up risk in trending markets
  • All stop-loss protections are disabled by default (UseStopLoss, UseEquityStop, UseTrailingStop, UseCCIStop all false), leaving positions completely unprotected out of the box
  • Trailing stop logic for short positions contains a bug: stopLevel comparison uses > instead of <, so trailing will never correctly ratchet down for shorts
  • No spread filter or trading session filter, making the EA vulnerable to slippage and wide spreads during low-liquidity periods
  • With MaxTrades=10 and LotExponent=1.4, the final lot size reaches 0.1×1.4^11≈1.58, which is 15.8x the initial lot — massive exposure concentration

Possible improvements

  • Fix the trailing stop comparison bug for short positions: change stopLevel>currStopLoss to stopLevel<currStopLoss so the stop correctly ratchets down
  • Enable at least one stop-loss protection by default (e.g., equity stop) to prevent users from running unprotected
  • Add spread filter and trading session filter to avoid trading during high-spread or low-liquidity periods
  • Add maximum total exposure as a percentage of account equity to prevent over-concentration in a single instrument

Risk assessment

Overall risk: Dangerous

  • Martingale lot escalation causes exponential position growth in sustained trends,easilyleading to account blow-up
  • All stop-loss protections disabled by default, first-time users run completely unprotected
  • Maximum 10 averaging layers with 1.4x multiplier means final lot can exceed 15x initial size
  • Bug in short position trailing stop logic may prevent stop-loss from correctly ratcheting down
  • No spread filter exposes the EA to severe slippage during low-liquidity market conditions

Evaluation scores

Code quality4.0
Strategy logic2.0
Risk management2.0
Robustness2.0
Innovation3.0
Documentation3.0
Overall2.7

Parameters

ParameterDefaultDescription
LotExponent1.4Lot multiplier coefficient for scaling trade size
MaxTrades10Maximum simultaneous open positions
DynamicPipstrueUse dynamic pip spacing for adding positions
DefaultPips120Default price channel pips (M15 period)
Glubina24Lookback bar count for highest/lowest price calculation
DEL3Divisor coefficient for dynamic range calculation
Lots0.1Initial lot size
lotdecimal1Lot decimal places: 0=standard, 1=mini, 2=micro
TakeProfit100.0Take profit pips based on weighted average price
slippage30Allowed slippage in points
MagicNumber2222EA unique identifier (magic number)
RsiPeriod14RSI indicator period
RsiMinimum30.0RSI lower threshold; below this, consider long
RsiMaximum70.0RSI upper threshold; above this, consider short
UseStopLossfalseWhether to use classic stop loss
StopLoss500.0Classic stop loss in points
UseEquityStopfalseWhether to enable equity stop
EquityPercent1.0Profit percentage to trigger equity trailing
TotalEquityRisk20.0Maximum equity drawdown percentage
UseTrailingStopfalseWhether to enable trailing stop
TrailStart100.0Profit in points to trigger trailing stop
TrailStop100.0Trailing stop distance from current price in points
UseCCIStopfalseWhether to enable CCI indicator stop
CCIPeriod55CCI indicator period
CCILevel500CCI absolute threshold; close positions when exceeded
UseCloseByTimefalseEnable timeout position closing
MaxTradeOpenHours48Max position hold duration (hours)

Similar Martingale EAs

Backtests are historical simulations and do not guarantee future results. Not financial advice.

Get the weekly Arena report

One email a week: ranking changes, new signals and new research. No spam; unsubscribe any time.