EA-45596 · Mean Reversion

BandOsMACustomSignal

This EA trades based on a mean-reversion signal generated by OsMA (Moving Average of Oscillator) crossing outside Bollinger Bands applied to the OsMA itself, with exits triggered when OsMA crosses back over a moving average of OsMA. It uses a custom signal interface supporting multi-symbol and multi-timeframe operation, with trailing stop protection and a sophisticated optimization framework using shadow parameters to enforce the fast<slow constraint on MA periods.

Open the interactive view (equity curve, symbol switch)

Key facts

RiskLow
Blow-up riskLow
Rating★★★★☆
TypeTrading EA
TimeframesM1, M5, M15, H1
IndicatorsOsMA, Bollinger Bands, MA (Moving Average)
Author—

Backtest results (H1, about 1 year)

SymbolP&LAnnualMax DDTradesWin rateSharpeRecoveryLosing streakPer tradeStatus
EURUSD0.00%0.00%0.00%0—————Conversion problem
GBPUSD0.00%0.00%0.00%0—————Conversion problem
USDJPY0.00%0.00%0.00%0—————Conversion problem
XAUUSD0.00%0.00%0.00%0—————Conversion problem

Why this EA never traded: it compares lines on different scales (an oscillator against a price level).

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.

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 strategy concept is mean reversion: buy signals are generated when OsMA crosses below the Bollinger Band lower band, and sell signals when it crosses above the upper band, assuming price will revert to the mean. Entry conditions require OsMA to cross the Bollinger Band boundary on two consecutive bars — below the lower band for longs, above the upper band for shorts. Exit conditions trigger when OsMA crosses back over its own moving average, or when the current signal no longer matches the open position direction. Position sizing uses fixed lots with no scaling mechanism. Money management includes a stop loss and trailing stop (with a step of stopLoss/50), but no take-profit is set, relying entirely on signal reversal or trailing stop to protect gains. The optimization framework cleverly converts the two-dimensional fast/slow period optimization into a one-dimensional combination index using shadow parameters, eliminating invalid combinations where fast >= slow.

Strengths

  • Clean architecture with TradingStrategy/TradingSignal interfaces for decoupling and extensibility
  • Clever shadow parameter optimization framework eliminates invalid fast>=slow period combinations
  • Multi-symbol and multi-timeframe signal support via BandOsMaSignal constructor parameters
  • Trailing stop mechanism protects floating profits with configurable step size
  • AutoPtr smart pointers manage dynamic resources, preventing memory leaks
  • R-squared criterion for optimization is more scientifically sound than raw profit

Weaknesses

  • No take-profit mechanism, fully relying on signal reversal or trailing stop which may miss optimal exits
  • Fixed lot sizing without proportional money management cannot adapt to account size changes
  • When multiple positions exist only an alert is issued without closing excess positions
  • No spread filter or slippage protection when trading on a different symbol than the signal symbol
  • Applying Bollinger Bands and MA on top of OsMA creates double-smoothing which may cause significant signal lag

Possible improvements

  • Add take-profit parameter or ATR-based dynamic take-profit to avoid over-reliance on signal reversal for exits
  • Implement proportional money management module that adjusts lot size based on account balance percentage or risk ratio
  • Add automatic handling logic for excess positions instead of just alerting when multiple positions are detected

Risk assessment

Overall risk: Low

  • Multiple positions only trigger an alert without auto-handling, potentially leading to unintended risk exposure
  • No spread filter, trading on small timeframe signal symbols may suffer from slippage
  • Fixed lot sizing cannot adapt to varying account sizes

Evaluation scores

Code quality5.0
Strategy logic4.0
Risk management3.0
Robustness4.0
Innovation4.0
Documentation3.0
Overall3.8

Parameters

ParameterDefaultDescription
Magic1234567890Magic number to identify this EA's positions
Lots0.01Lot size per trade
StopLoss1000Stop loss in points
SignalSymbolSignal symbol; empty uses current symbol
SignalTimeframePERIOD_M1signaltime period
FastOsMA12OsMAfastEMA period
SlowOsMA26OsMAslowEMA period
SignalOsMA9OsMAsignal line period
PriceOsMAPRICE_TYPICALOsMAapplied price type
BandsMA26Bollinger Bands MA period
BandsShift0Bollinger Bands offset
BandsDeviation2.0Bollinger Bands standard deviation multiplier
PeriodMA10MA period for OsMA indicator
ShiftMA0MAMA offset
MethodMAMODE_SMAMAMAcalculation method
FastSlowCombo4Optimization0Shadow param for optimization: fast-slow combo index
FastShadow4Optimization0Shadow param for optimization: fast period range
SlowShadow4Optimization0Shadow param for optimization: slow period range
StepsShadow4Optimization0Shadow param for optimization: step range

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.