Exp_RAVI_Histogram
This EA trades based on the RAVI (Range Action Verification Index) Histogram indicator, which measures momentum by comparing fast and slow moving averages. It opens buy positions when the RAVI value crosses above the upper level and sell positions when it crosses below the lower level, with corresponding close signals for opposite positions.
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 core strategy of this EA is based on the RAVI (Range Action Verification Index) Histogram indicator, which measures market momentum direction by calculating the difference between fast and slow smoothed moving averages. Entry conditions: when the RAVI value is above the upper level (UpLevel=+0.1) and the previous bar's value was below or equal to the upper level, a buy open signal is triggered; when the RAVI value is below the lower level (DnLevel=-0.1) and the previous bar's value was above or equal to the lower level, a sell open signal is triggered. For exit conditions, when a buy signal triggers, existing sell positions are simultaneously closed, and vice versa; additionally, fixed stop loss (1000 points) and take profit (2000 points) are configured. Position sizing is controlled by the MM parameter which sets the risk ratio, supporting multiple margin modes including free margin, balance, loss-adjusted balance, and fixed lot size. Money management uses the MarginMode enumeration, defaulting to fixed lot mode (LOT), with MM=0.1 representing the capital allocation ratio. The strategy employs an IsNewBar mechanism to ensure signal evaluation only occurs on new bar formation, preventing duplicate trades, while the SignalBar parameter controls which bar's signal is used for analysis.
Strengths
- Uses multi-timeframe indicator (H4), avoiding short-period noise interference, suitable for capturing medium-term trend momentum
- Provides complete open/close toggle controls, allowing flexible enabling of only buy or sell directions
- Employs IsNewBar mechanism to prevent duplicate trades within the same bar, reducing unnecessary trading frequency
- Supports 10 smoothing algorithms and 9 price types, offering high parameter flexibility to adapt to different market conditions
- Configured with stop loss and take profit, risk is controllable with a reasonable 2:1 reward-to-risk ratio
Weaknesses
- Stop loss of 1000 points and take profit of 2000 points are excessively large, potentially leading to high per-trade risk on most instruments
- Lacks spread filtering mechanism, which may cause unnecessary losses on instruments with wide spreads
- No position check logic, potentially opening duplicate positions in the same direction when already holding
- Simple signal logic relying solely on RAVI crossing threshold levels may generate frequent false signals in ranging markets
- The Recount static variable is set to true on CopyBuffer failure but lacks a maximum retry limit, potentially causing infinite retry loops
Possible improvements
- Add position check logic to avoid duplicate same-direction entries, and implement maximum position count limits
- Add spread filtering and volatility filtering (e.g., ATR) to suppress trading signals when market conditions are unfavorable
- Change stop loss and take profit parameters to ATR-based dynamic calculation instead of fixed points, to adapt to different instruments' volatility characteristics
Risk assessment
Overall risk: Medium
- Fixed stop loss of 1000 points may be excessive on certain instruments, with single trade loss potentially representing too high a percentage of total capital
- Lack of position count limits and same-direction duplicate entry checks may lead to overexposure
- No spread filtering means trades execute even when spreads widen during high volatility periods
- Recount mechanism has no retry upper limit, potentiallyfall into loop when indicator data is abnormal
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
MM | 0.1 | Capital allocation ratio per trade |
MMMode | LOT | Margin mode: free margin/balance/drawdown free margin/drawdown balance/fixed lot |
StopLoss_ | 1000 | Stop loss in points |
TakeProfit_ | 2000 | Take profit in points |
Deviation_ | 10 | Maximum allowed slippage in points |
BuyPosOpen | true | Allow long entry |
SellPosOpen | true | Allow short entry |
BuyPosClose | true | Allow buy position close on reverse signal |
SellPosClose | true | Allow sell position close on reverse signal |
InpInd_Timeframe | PERIOD_H4 | Indicator calculation timeframe |
FastMethod | MODE_EMA_ | fastsmoothing method |
FastLength | 7 | Fast smoothing period length |
FastPhase | 15 | Fast smoothing phase (JJMA/VIDYA/AMA) |
SlowMethod | MODE_EMA_ | slowsmoothing method |
SlowLength | 65 | Slow smoothing period length |
SlowPhase | 15 | Slow smoothing phase (JJMA/VIDYA/AMA) |
IPC | PRICE_CLOSE_ | Applied price type |
Shift | 0 | Indicator offset |
UpLevel | +0.1 | Upper band threshold level |
DnLevel | -0.1 | Lower band threshold level |
SignalBar | 1 | Signal detection bar index position |
Similar Momentum EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.