EA-53022 · Martingale

Smart Trend Follower

This EA is a trend-following martingale system that uses either MA crossover or MA+Stochastic confirmation to generate trade signals. On losing positions, it opens additional layers at fixed pip distances with multiplied lot sizes (martingale), then sets a common break-even TP/SL across all positions of the same direction.

Open the interactive view (equity curve, symbol switch)

Key facts

CategoryMartingale
RiskDangerous
Blow-up riskHigh
Rating★★☆☆☆
TypeTrading EA
TimeframesM15, H1, H4
IndicatorsSMA, Stochastic Oscillator
AuthorRobotop.

Backtest results (H1, about 1 year)

SymbolP&LAnnualMax DDTradesWin rateSharpeRecoveryLosing streakPer tradeStatus
EURUSD+2.31%+2.00%4.76%1383.30%0.440.481+$42.93Reliable
GBPUSD-3.89%-3.39%8.34%10.00%————Too few trades
USDJPY+2.69%+2.33%6.71%14100.00%0.400.400+$44.83Reliable
XAUUSD+93.97%+72.87%45.24%5563.00%1.092.087+$243.64Reliable

Profitable on 3 of 3 markets with reliable results.

Converted from MQL5 to Python and run with the same rules for every EA. Positions use MT5 lot sizes (100,000 units per FX lot, 100 oz per gold lot) with 1:100 leverage, one order at a time, and a stop-out below 10% of the starting balance. Sharpe is computed from the equity curve. Results marked as unreliable are shown for completeness only.

Against the other Martingale EAs with a reliable result on the same market: EURUSD: better than 94% of 16 · USDJPY: better than 75% of 16 · XAUUSD: better than 69% of 16

Month by month

MarketMonths with a gainBest monthWorst month
EURUSD54%+3.43% 2026-03-1.75% 2026-01
USDJPY54%+1.94% 2025-12-2.31% 2026-03
XAUUSD62%+54.18% 2026-02-26.98% 2026-06

From the backtest equity curve, sampled about every two days; only reliable results.

Blow-up risk: High

  • Increases the position size after losses (martingale)
  • Has no stop loss or trailing stop

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 trend following with two entry signal modes: one is dual MA crossover (fast MA crossing above slow MA for buy, below for sell), and the other uses MA trend direction confirmation combined with Stochastic oversold/overbought zone filtering and candle direction confirmation. Exit conditions use a weighted average break-even price across all same-direction positions plus a fixed pip take-profit, with optional stop-loss. Position sizing employs a martingale approach where the first position uses the initial lot size, and each subsequent layer multiplies the lot by a configurable multiplier (default 2x), with layers spaced at a fixed 200-pip distance. Money management includes lot normalization, minimum/maximum lot limits, lot step alignment, and margin checking, but lacks overall risk exposure limits. The EA detects signals on each new candle and continuously modifies TP/SL for all positions to maintain a unified exit target.

Strengths

  • Provides two entry signal modes (MA crossover and MA+Stochastic trend confirmation), adding strategy flexibility
  • Includes thorough margin checking and lot normalization logic to prevent invalid orders
  • Unified TP/SL management for same-direction positions based on weighted average break-even price, with clear logic

Weaknesses

  • Martingale strategy carries extreme risk; consecutive layering causes exponential lot growth that can rapidly blow the account
  • Default stop-loss is 0, meaning martingale positions accumulate without any safety net, making risk uncontrollable
  • Bug in getTotalVolume: uses PositionGetDouble instead of OrderGetDouble for pending orders volume
  • CopyBuffer return values are not checked, so failed indicator data reads can produce wrong signals

Possible improvements

  • Mandate a stop-loss or add a maximum layer count limit to control martingale risk exposure
  • Fix the getTotalVolume bug using OrderGetDouble for pending orders instead of PositionGetDouble, and check CopyBuffer return values
  • Add maximum drawdown protection that forces position closure when floating loss reaches a configurable percentage of account balance

Risk assessment

Overall risk: Dangerous

  • Martingale lot sizing grows exponentially; consecutive layering can rapidly deplete account funds
  • Default stop-loss of 0 means multi-layer positions have no protection, and a sustained trend can cause massive losses
  • No maximum layer count limit means risk exposure is unbounded in extreme market conditions

Evaluation scores

Code quality3.0
Strategy logic2.0
Risk management1.0
Robustness2.0
Innovation1.0
Documentation1.0
Overall1.7

Parameters

ParameterDefaultDescription
inMagicNumber778899Magic number for identifying EA positions
inLotSize0.01Initial lot size
inMultiply2.0Martingale multiplier, lot scaling factor per layer
inJarakLayer200Layer spacing (points), price distance for adding positions
inJnsSignaleTypeCrossMASignal type: MA crossover or trend following
inMAPeriodFast14fastMA period
inMAPeriodSlow28slowMA period
inSTOKPeriod10Stochastic %K period
inSTODPeriod3Stochastic %D period
inSTOSlowing3Stochastic smoothing period
inTakeProfit500Take profit in points
inStopLoss0Stop loss in points (0 = no stop loss)

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.