AO_Lightning
This EA trades based on the Awesome Oscillator (AO) indicator, which is calculated as the difference between a fast SMA (period 34) and a slow SMA (period 5) of median prices. It opens buy positions when AO rises and sell positions when AO falls, while simultaneously closing opposite positions. The EA allows up to 10 simultaneous orders in each direction with fixed or percentage-based lot sizing.
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 | +6.38% | +5.52% | 3.90% | 143 | 54.20% | 1.32 | 1.64 | 6 | +$4.73 | Reliable |
| GBPUSD | +4.90% | +4.24% | 4.93% | 143 | 50.70% | 0.85 | 0.99 | 7 | +$3.62 | Reliable |
| USDJPY | +1.69% | +1.47% | 6.44% | 275 | 51.50% | 0.37 | 0.26 | 8 | +$0.62 | Reliable |
| XAUUSD | +204.44% | +150.89% | 32.49% | 148 | 50.70% | 1.95 | 6.29 | 6 | +$138.14 | Reliable |
Profitable on 4 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 Momentum EAs with a reliable result on the same market: EURUSD: better than 94% of 68 · GBPUSD: better than 91% of 66 · USDJPY: better than 74% of 68 · XAUUSD: better than 100% of 75
Month by month
| Market | Months with a gain | Best month | Worst month |
|---|---|---|---|
| EURUSD | 69% | +3.34% 2026-02 | -1.79% 2026-07 |
| GBPUSD | 62% | +2.86% 2026-02 | -2.00% 2026-07 |
| USDJPY | 38% | +3.50% 2026-09 | -2.33% 2026-08 |
| XAUUSD | 54% | +85.95% 2026-02 | -6.51% 2026-11 |
From the backtest equity curve, sampled about every two days; only reliable results.
Blow-up risk: Elevated
- Has no stop loss or trailing stop
- Can hold up to 10 positions at once
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 Bill Williams' Awesome Oscillator (AO) momentum indicator, calculated as the difference between a 5-period SMA and a 34-period SMA of median prices ((High+Low)/2) to determine market momentum direction. Entry conditions: a buy position is opened when AO[0]>AO[1] (momentum rising), and a sell position is opened when AO[0]<AO[1] (momentum falling), making this a trend-following momentum strategy. Exit conditions: all opposite-direction positions are closed when momentum reverses direction — buy positions are closed when AO declines, sell positions are closed when AO rises. Position management allows up to the 'Orders' parameter number of positions per direction (default 10), adding to positions on each new signal rather than going all-in. Money management supports two modes: fixed lot size (LotFixed) and dynamic lot sizing based on a percentage of free margin (LotFromPercent), with a pre-trade margin check via OrderCalcMargin. The strategy has no stop-loss or take-profit, relying entirely on momentum reversal signals for exits, creating significant risk exposure.
Strengths
- Clear and concise strategy logic based on the classic Awesome Oscillator momentum indicator, easy to understand and verify
- Supports both fixed lot and percentage-based dynamic lot sizing, offering good flexibility
- Pre-trade margin check prevents opening positions when insufficient funds are available
- New bar detection mechanism (time_bar) avoids duplicate entries on the same bar, reducing overtrading
Weaknesses
- No stop-loss or take-profit configured, relying entirely on momentum reversal for exits, which can cause massive losses during volatile markets
- Close functions use while loops iterating over positions, which can cause infinite loops or index errors when PositionsTotal changes during iteration
- Sell order margin check incorrectly uses ORDER_TYPE_BUY instead of ORDER_TYPE_SELL, potentially giving inaccurate margin calculations
- AO parameter names are counterintuitive: Period_sma_slow=5 is actually the fast SMA, Period_sma_fast=34 is the slow SMA
- MessageBox in CheckMoneyForTrade blocks EA execution, which is inappropriate for automated live trading
Possible improvements
- Add stop-loss and take-profit parameters to protect capital during extreme market volatility
- Fix the ORDER_TYPE_BUY bug in sell order margin check — should use ORDER_TYPE_SELL
- Use reverse iteration or collect tickets first then close in batch, avoiding index corruption during position traversal
- Replace MessageBox with Print or logging to prevent blocking automated EA execution
- Fix SMA period parameter naming to match their actual purpose (fast vs slow)
Risk assessment
Overall risk: Caution
- No stop-loss or take-profit can lead to massive floating losses during sustained adverse momentum
- While loop in close functions poses potential infinite loop risk during position traversal
- Incorrect order type in sell margin check may produce inaccurate margin calculations
- Up to 10 positions in the same direction can accumulate significant risk during unfavorable moves
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
LotFixed | 0.01 | Fixed lot size |
LotFromPercent | 0 | Dynamic lot from margin percentage, 0=fixed lot |
Period_sma_slow | 5 | AOindicatorslowSMA period |
Period_sma_fast | 34 | AOindicatorfastSMA period |
Orders | 10 | Maximum open positions per direction |
Magic | 5632 | EA magic number for position identification |
Similar Momentum EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.