EA-13315 · Martingale

Well Martin

This EA uses Bollinger Bands and ADX for mean-reversion entry signals, buying when price touches the lower band and selling when it touches the upper band, filtered by low ADX indicating a ranging market. It employs a Martingale position sizing system that multiplies the lot size by a factor (KLot) after each losing trade, capped at MaxLot. A stealth mode option hides actual SL/TP from the broker while managing exits internally via chart labels.

Open the interactive view (equity curve, symbol switch)

Key facts

CategoryMartingale
RiskDangerous
Blow-up riskElevated
Rating★☆☆☆☆
TypeTrading EA
TimeframesM15, H1, H4
IndicatorsBollinger Bands, ADX
AuthorAM2

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 strategy concept is based on Bollinger Bands mean reversion, expecting price to return to the mean when it reaches the band boundaries. Entry conditions: a buy signal requires Ask price below the previous bar's lower Bollinger Band and ADX below the threshold (indicating a ranging market), plus the last deal was not a buy; a sell signal requires Bid above the previous bar's upper Bollinger Band and ADX below the threshold, plus the last deal was not a sell. Exit conditions include fixed pip-based stop loss and take profit, or in stealth mode the EA internally calculates profit/loss in points and closes positions manually without broker-visible SL/TP. Position sizing follows a Martingale system where the lot size is multiplied by KLot after a loss, resets to the base Lot after a profit, and is capped at MaxLot — exceeding which it reverts to the base lot. Money management lacks equity drawdown controls, relying solely on MaxLot as a safety valve, but once MaxLot is exceeded and the lot reverts to base, consecutive losses restart the doubling cycle, creating significant cumulative risk.

Strengths

  • Bollinger Bands + ADX combination provides clear mean-reversion signals filtered for ranging markets
  • Stealth mode hides SL/TP from the broker, reducing the risk of stop hunting
  • New bar check prevents multiple entries within the same candle
  • MaxLot parameter provides a hard cap to limit Martingale exposure
  • Clean code structure with well-separated logic, easy to understand and modify

Weaknesses

  • Martingale position sizing causes exponential lot growth during consecutive losses, risking account blowup
  • Critical bug in IsNewBar: m_TOld is a local variable reset to 0 on every call, making new bar detection non-functional
  • PutLable function has ObjectSetInteger calls after the return statement — they are unreachable dead code
  • No equity drawdown protection; once MaxLot is hit and lot reverts, the Martingale cycle restarts from base
  • Volume() function retrieves the last deal by index, which may get an entry deal instead of exit deal, causing incorrect profit/lossjudgment
  • No spread filter — entries during news or high-volatility periods may suffer excessive slippage

Possible improvements

  • Fix IsNewBar by making m_TOld a static or class member variable so new bar detection actually works
  • Fix PutLable by moving the return statement after the ObjectSetInteger calls so label properties are actually set
  • Add equity drawdown protection that stops trading or resets lot size when drawdown exceeds a threshold
  • Volume() should filter for DEAL_ENTRY_OUT deals when determining profit/loss instead of blindly using the last deal
  • Add a spread filter to pause entries when the current spread exceeds a configurable threshold

Risk assessment

Overall risk: Dangerous

  • Martingale lot doubling during consecutive losses can lead to account blowup
  • IsNewBar bug means trades can open every tick instead of per new bar, vastly exceeding intended frequency
  • Stealth mode relies entirely on EA uptime for SL/TP — if EA disconnects, positions have no protection
  • No equity drawdown protection mechanism exists
  • Volume() may incorrectly judge the last deal's profit/loss, corrupting the Martingale logic

Evaluation scores

Code quality2.0
Strategy logic2.0
Risk management1.0
Robustness1.0
Innovation2.0
Documentation1.0
Overall1.5

Parameters

ParameterDefaultDescription
BBPeriod84Bollinger Bands period
BBShift0Bollinger Bands shift
BBDev1.8Bollinger Bands standard deviation multiplier
ADXPeriod40ADX period
ADXLevel45ADX threshold; below this = ranging market
TP1200Take profit in points
SL1400Stop loss in points
Slip50Slippage tolerance
Stelth0Stealth mode switch; 1 = hide SL/TP
KLot2Martingale lot multiplier
MaxLot5Maximum lot size limit
Lot0.1Initial lot size
LableClrclrGreenLabel color

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.