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
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
Parameters
| Parameter | Default | Description |
|---|---|---|
LotExponent | 1.4 | Lot multiplier coefficient for scaling trade size |
MaxTrades | 10 | Maximum simultaneous open positions |
DynamicPips | true | Use dynamic pip spacing for adding positions |
DefaultPips | 120 | Default price channel pips (M15 period) |
Glubina | 24 | Lookback bar count for highest/lowest price calculation |
DEL | 3 | Divisor coefficient for dynamic range calculation |
Lots | 0.1 | Initial lot size |
lotdecimal | 1 | Lot decimal places: 0=standard, 1=mini, 2=micro |
TakeProfit | 100.0 | Take profit pips based on weighted average price |
slippage | 30 | Allowed slippage in points |
MagicNumber | 2222 | EA unique identifier (magic number) |
RsiPeriod | 14 | RSI indicator period |
RsiMinimum | 30.0 | RSI lower threshold; below this, consider long |
RsiMaximum | 70.0 | RSI upper threshold; above this, consider short |
UseStopLoss | false | Whether to use classic stop loss |
StopLoss | 500.0 | Classic stop loss in points |
UseEquityStop | false | Whether to enable equity stop |
EquityPercent | 1.0 | Profit percentage to trigger equity trailing |
TotalEquityRisk | 20.0 | Maximum equity drawdown percentage |
UseTrailingStop | false | Whether to enable trailing stop |
TrailStart | 100.0 | Profit in points to trigger trailing stop |
TrailStop | 100.0 | Trailing stop distance from current price in points |
UseCCIStop | false | Whether to enable CCI indicator stop |
CCIPeriod | 55 | CCI indicator period |
CCILevel | 500 | CCI absolute threshold; close positions when exceeded |
UseCloseByTime | false | Enable timeout position closing |
MaxTradeOpenHours | 48 | Max position hold duration (hours) |
Similar Martingale EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.