Exp_RangeExpansionIndex
This EA trades based on the Range Expansion Index (REI) indicator, opening buy positions when REI crosses above the lower threshold from below and sell positions when REI crosses below the upper threshold from above. It uses configurable money management modes, fixed stop-loss and take-profit levels, and processes signals on new bar formation to avoid redundant entries. The strategy is a mean-reversion system that enters when the indicator exits extreme zones.
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 | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
| GBPUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
| USDJPY | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
| XAUUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
Why this EA never traded: no entry rule survived the conversion.
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 based on the Range Expansion Index (REI) indicator, which measures the degree of price range expansion and belongs to the DeMark indicator family. Entry conditions are: open a buy position when REI crosses above the -60 lower level from below, and open a sell position when REI crosses below the +60 upper level from above, essentially entering when the indicator reverts from extreme zones, which is a mean-reversion logic. Exit conditions are triggered by reverse signals: close buy positions when REI is above -60, close sell positions when REI is below +60, with fixed stop-loss of 1000 points and take-profit of 2000 points as additional protection. Position sizing supports five modes: percentage of free margin, percentage of balance, percentage of free margin after losses, percentage of balance after losses, and fixed lot size, selectable via the MarginMode enumeration. The MM parameter controls the trading proportion or lot size, defaulting to 0.1 which means 0.1 lots in fixed lot mode. The strategy also allows independent control of buy/sell direction opening and closing through input parameters, providing flexible trading control.
Strengths
- Uses new bar detection (IsNewBar) to prevent repeated entries within the same bar, reducing overtrading risk
- Supports multiple money management modes, flexibly adapting to traders with different risk preferences
- Buy and sell directions can be independently controlled, enabling one-direction trading or close-only operations
- Fixed stop-loss and take-profit are set, providing clear risk boundaries for each trade
- Checks BarsCalculated before CopyBuffer to ensure indicator data is ready, avoiding false signals from insufficient data
Weaknesses
- Default stop-loss of 1000 and take-profit of 2000 points are large and may not suit all instruments, with no ATR-based dynamic adjustment
- Lacks spread filtering mechanism, still enters trades when spread is wide, potentially leading to unfavorable fill prices
- Depends on the custom RangeExpansionIndex indicator, which increases deployment complexity as the EA cannot run without it properly installed
- No position count limit, potentially leading to overexposure through consecutive entries during extreme market conditions
- Signal logic relies solely on the REI indicator, lacking multi-dimensional confirmation and prone to false signals
Possible improvements
- Add ATR-based dynamic stop-loss and take-profit calculation instead of fixed points, allowing the strategy to better adapt to different market volatilities
- Add spread filter and time filter (e.g., avoid news events and low-liquidity sessions) to improve entry quality
- Add multi-indicator confirmation mechanism, such as combining a trend indicator to filter counter-trend signals and improve win rate
Risk assessment
Overall risk: Medium
- Lacks spread filtering, wide spreads during high-volatility periods can lead to unfavorable fills
- Single indicator signals lack confirmation, prone to consecutive losses from false signals in ranging markets
- No maximum position count limit, potentially overexposed during extreme market conditions
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
MM | 0.1 | Deposit percentage or fixed lot; negative = fixed lot |
MMMode | LOT | MM mode: free margin/balance/post-loss margin/post-loss balance/fixed lot |
StopLoss_ | 1000 | Stop loss in points |
TakeProfit_ | 2000 | Take profit in points |
Deviation_ | 10 | Max price deviation in points (slippage limit) |
BuyPosOpen | true | Allow buy position open |
SellPosOpen | true | Allow sell position open |
BuyPosClose | true | Allow close long position |
SellPosClose | true | Allow close short position |
InpInd_Timeframe | PERIOD_H8 | GG-RSI-CCI indicator timeframe |
REI_Period | 8 | REI indicator period parameter |
Up_Indicator_level | +60 | Indicator upper threshold level |
Dn_Indicator_level | -60 | Indicator lower threshold level |
SignalBar | 1 | Bar index for trade signal |
Similar Mean Reversion EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.