EA-22274 · Mean Reversion

OHLC Stochastic

This EA implements a Stochastic oscillator-based mean reversion strategy, generating buy signals when the Stochastic enters oversold territory and sell signals when it reaches overbought zones. It uses OHLC price data to compute the Stochastic values and executes trades automatically based on crossover signals within the oscillator. The strategy targets reversal points in the market where price is expected to revert to its mean.

Open the interactive view (equity curve, symbol switch)

Key facts

RiskMedium
Blow-up riskLow
Rating★★★☆☆
TypeTrading EA
TimeframesM15, H1, H4
IndicatorsStochastic Oscillator
AuthorCopyright © 2018, Vladimir Karputov

Backtest results (H1, about 1 year)

SymbolP&LAnnualMax DDTradesWin rateSharpeRecoveryLosing streakPer tradeStatus
EURUSD+3.60%+3.12%3.08%13846.40%0.861.175+$2.61Reliable
GBPUSD-5.11%-4.46%8.05%13647.80%-0.90-0.647−$3.76Reliable
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 3 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 77% of 30 · GBPUSD: better than 19% of 32 · USDJPY: better than 72% of 32 · XAUUSD: better than 61% of 31

Month by month

MarketMonths with a gainBest monthWorst month
EURUSD38%+3.97% 2026-04-1.01% 2026-02
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

This EA implements a mean reversion strategy based on the Stochastic Oscillator, with the core concept of using %K and %D line crossovers combined with overbought/oversold zones to identify price reversal opportunities. Entry conditions are: buy when the %K line crosses above the %D line from the oversold zone (typically below 20), and sell when the %K line crosses below the %D line from the overbought zone (typically above 80). Exit conditions rely on reverse crossover signals or preset take-profit and stop-loss levels, depending on the parameter configuration. Position sizing uses a fixed lot size or an equity-proportional calculation method, with users able to adjust via input parameters. Money management may include maximum position limits and account equity protection mechanisms, though the adequacy of stop-loss settings should be carefully evaluated. The overall strategy logic is clear and suitable for ranging markets, but it may face consecutive losses in strongly trending conditions.

Strengths

  • Clear strategy logic based on the classic Stochastic oscillator, easy to understand and verify
  • High win rate in ranging markets by entering at overbought/oversold zones
  • Highly configurable parameters allowing optimization across different instruments and timeframes
  • OHLC data-driven with transparent and reliable calculation methodology
  • Mean reversion logic performs well in consolidation markets with controllable risk-reward ratio

Weaknesses

  • Prone to consecutive false signals in strongly trending markets, leading to repeated losses
  • Default stop-loss and take-profit may be zero, lacking effective risk protection mechanisms
  • No trend filter to distinguish between ranging and trending markets, risking counter-trend entries
  • No new bar check mechanism, potentially opening multiple positions on the same bar
  • Lacks spread filter, resulting in high entry costs that erode profitability in high-spread environments

Possible improvements

  • Add a trend filter (e.g., ADX or higher timeframe moving average) to avoid counter-trend trades in strong trends
  • Add new bar check and position check mechanisms to prevent duplicate entries and overtrading

Risk assessment

Overall risk: Medium

  • Stop-loss and take-profit defaults may be zero, creating unlimited loss risk
  • Lack of trend filter increases risk of counter-trend trades in trending markets
  • No spread filter or slippage protection mechanism

Evaluation scores

Code quality3.0
Strategy logic3.0
Risk management2.0
Robustness2.0
Innovation2.0
Documentation2.0
Overall2.3

Parameters

ParameterDefaultDescription
KPeriod5Stochastic %K period
DPeriod3stochasticindicator%Dsmoothing period
Slowing3Stochastic deceleration factor
OverboughtLevel80Overbought threshold level
OversoldLevel20Oversold threshold level
LotSize0.1Trading lot size
StopLoss0Stop loss in points
TakeProfit0Take profit in points

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.