EA-20881 · Mean Reversion

EA Stochastic

This EA trades based on the Stochastic oscillator, entering positions when the indicator signals overbought or oversold conditions. It opens buy trades when Stochastic crosses upward from oversold zones and sell trades when it crosses downward from overbought zones. The strategy targets mean reversion opportunities in ranging or moderating markets.

Open the interactive view (equity curve, symbol switch)

Key facts

RiskHigh risk
Blow-up riskLow
Rating★★☆☆☆
TypeTrading EA
TimeframesM15, M30, H1, H4
IndicatorsStochastic
AuthorMamedov Sergey,Russia,Voronezh

Backtest results (H1, about 1 year)

SymbolP&LAnnualMax DDTradesWin rateSharpeRecoveryLosing streakPer tradeStatus
EURUSD-0.39%-0.34%3.92%13447.80%-0.08-0.105−$0.29Reliable
GBPUSD-5.19%-4.52%8.05%13647.80%-0.92-0.657−$3.82Reliable
USDJPY+3.84%+3.33%4.60%13852.20%0.720.835+$2.78Reliable
XAUUSD+39.20%+31.42%74.01%14853.10%0.870.538+$24.99Reliable

Profitable on 2 of 4 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 Mean Reversion EAs with a reliable result on the same market: EURUSD: better than 63% of 30 · GBPUSD: better than 16% of 32 · USDJPY: better than 72% of 32 · XAUUSD: better than 61% of 31

Month by month

MarketMonths with a gainBest monthWorst month
EURUSD38%+1.41% 2026-01-1.24% 2026-10
GBPUSD54%+2.79% 2026-04-5.66% 2026-01
USDJPY54%+5.13% 2026-01-2.09% 2026-08
XAUUSD69%+31.38% 2026-06-30.39% 2026-05

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

Blow-up risk: No blow-up pattern found

None of the usual blow-up patterns were found in the code, and the account was not stopped out in our backtests. That is not a guarantee: any EA can lose money.

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 core strategy concept is mean reversion trading based on the Stochastic oscillator, utilizing %K and %D line crossovers along with overbought and oversold zones to determine entry timing. Entry conditions are: open a long position when the %K line crosses above the %D line from the oversold zone (typically below 20), and open a short position when the %K line crosses below the %D line from the overbought zone (typically above 80). Exit conditions typically include fixed take-profit and stop-loss levels, or closing positions when the Stochastic returns to neutral territory. Position sizing allows the user to set fixed lot sizes or calculate position size based on a percentage of account equity. Money management relies on the Stochastic indicator's inherent mean reversion characteristic, but the strategy faces the risk of consecutive losses in strong trending markets since the Stochastic can remain in overbought or oversold zones for extended periods during trends.

Strengths

  • Simple and clear strategy logic based on the classic Stochastic overbought/oversold principle, easy to understand and verify
  • Uses Stochastic crossover signals for entry, reducing false signals compared to single threshold triggers
  • Highly configurable parameters allowing users to adjust K/D periods and overbought/oversold thresholds for different instruments and timeframes

Weaknesses

  • Mean reversion strategy performs poorly in strong trending markets as the Stochastic can remain in overbought/oversold zones for extended periods causing repeated losses
  • Lacks a trend filter to distinguish between ranging and trending markets, prone to counter-trend trading during trends
  • Default stop-loss and take-profit are zero, presenting extreme risk of running without protective stops which could lead to catastrophic losses

Possible improvements

  • Add a trend filter (such as ADX or moving average direction) to only trade mean reversion signals in ranging markets and pause trading during trending markets
  • Implement mandatory stop-loss mechanism to ensure every trade has reasonable stop-loss protection, avoiding the risk of unprotected positions
  • Add new bar check to prevent repeated entries on the same bar, and add spread filter to prevent entries during high spread conditions

Risk assessment

Overall risk: High risk

  • Default stop-loss and take-profit are zero, trades can incur unlimited losses without any protection
  • Lacks trend filter mechanism, will repeatedly open counter-trend positions during strong trends leading to consecutive losses
  • No explicit new bar check, may open multiple positions on the same bar leading to excessive exposure

Evaluation scores

Code quality3.0
Strategy logic3.0
Risk management1.0
Robustness2.0
Innovation2.0
Documentation1.0
Overall2.0

Parameters

ParameterDefaultDescription
LotSize0.1Initial lot size, martingale base quantity
Stochastic_Kperiod14Stochastic K period
Stochastic_Dperiod3Stochastic D period (smoothing period)
Stochastic_Slowing3Stochastic slowing value
OverboughtLevel80Overbought threshold level
OversoldLevel20Oversold threshold level
StopLoss0Stop loss in points, max loss per trade
TakeProfit0Group TP in points, close all at this profit
MagicNumber12345EA magic number to distinguish trade instances

Similar Mean Reversion 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.