IStochastic_Trading
This EA trades based on the Stochastic Oscillator, entering buy positions when the indicator is oversold and sell positions when overbought. It uses customizable Stochastic parameters (%K, %D, slowing) along with configurable lot sizing, stop loss, and take profit levels. The strategy follows a classic mean reversion approach, expecting price to revert from extreme Stochastic readings.
Open the interactive view (equity curve, symbol switch)Key facts
Backtest results (H1, about 1 year)
| Symbol | P&L | Annual | Max DD | Trades | Win rate | Sharpe | Recovery | Losing streak | Per trade | Status |
|---|---|---|---|---|---|---|---|---|---|---|
| EURUSD | -1.78% | -1.55% | 5.38% | 134 | 47.00% | -0.43 | -0.33 | 9 | −$1.33 | Reliable |
| GBPUSD | -9.53% | -8.34% | 10.33% | 134 | 41.80% | -1.71 | -0.92 | 8 | −$7.11 | Reliable |
| USDJPY | +6.17% | +5.34% | 3.28% | 138 | 55.80% | 1.22 | 1.88 | 4 | +$4.47 | Reliable |
| XAUUSD | -15.49% | -12.98% | 61.50% | 146 | 50.30% | 0.27 | -0.25 | 5 | −$12.38 | Reliable |
Profitable on 1 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 53% of 30 · GBPUSD: better than 3% of 32 · USDJPY: better than 88% of 32 · XAUUSD: better than 39% of 31
Month by month
| Market | Months with a gain | Best month | Worst month |
|---|---|---|---|
| EURUSD | 54% | +1.67% 2026-06 | -2.40% 2026-02 |
| GBPUSD | 23% | +1.83% 2026-04 | -2.96% 2026-07 |
| USDJPY | 62% | +5.11% 2026-01 | -2.02% 2026-08 |
| XAUUSD | 62% | +39.38% 2026-06 | -35.57% 2026-03 |
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 of this EA is classic mean reversion trading based on the Stochastic Oscillator. Entry conditions are: open a buy position when the %K and %D lines cross upward from the oversold zone (below 20), and open a sell position when they cross downward from the overbought zone (above 80). Exit conditions rely on preset fixed stop loss and take profit levels, and positions may also be closed when an opposing signal appears. Position sizing uses a fixed lot approach where the user specifies the trade volume via a parameter, with no dynamic adjustment mechanism based on account balance. Money management is relatively simple, with stop loss and take profit set as fixed pip values, lacking dynamic risk management based on ATR or volatility. The overall strategy logic is clear but lacks a trend environment filter, which may lead to frequent counter-trend trades and consecutive losses during trending markets.
Strengths
- Clear and concise strategy logic based on a classic technical indicator, easy to understand and verify
- Uses Stochastic overbought/oversold zones to filter signals, reducing false entries
- Includes stop loss and take profit settings, providing basic risk control
Weaknesses
- Lacks a trend filter, prone to counter-trend trading and consecutive losses in strong trending markets
- Fixed lot size and fixed SL/TP without dynamic adjustment based on market volatility
- Does not check for existing same-direction positions, potentially leading to duplicate entries and increased risk exposure
- No new bar check, signals may trigger multiple times on the same bar causing over-trading
Possible improvements
- Add a trend filter (e.g., moving average direction or higher timeframe trend assessment) to avoid counter-trend trades in strong trends
- Implement ATR-based dynamic stop loss/take profit and position sizing to adapt risk parameters to market volatility
Risk assessment
Overall risk: Medium
- Mean reversion strategy may produce consecutive losses in trending markets
- No new bar check and no position check, creating risk of over-trading and duplicate entries
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
KPeriod | 5 | Stochastic %K period |
DPeriod | 3 | Stochastic %D period |
Slowing | 3 | Stochastic deceleration factor |
OverboughtLevel | 80 | Overbought threshold |
OversoldLevel | 20 | Oversold threshold |
LotSize | 0.1 | Fixed trading lot size |
StopLoss | 50 | Stop loss in points |
TakeProfit | 100 | Take profit in points |
Similar Mean Reversion EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.