Exp_CCI_Histogram
This EA trades based on a custom CCI_Histogram indicator, opening buy positions when the histogram transitions from neutral to positive zone and sell positions when it transitions from neutral to negative zone. It uses configurable money management modes, stop loss/take profit, and processes signals only on new bars to avoid over-trading.
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 | -7.93% | -6.93% | 8.56% | 141 | 40.00% | -1.58 | -0.93 | 6 | −$5.90 | Reliable |
| GBPUSD | -13.07% | -11.46% | 14.80% | 143 | 43.00% | -2.17 | -0.88 | 11 | −$9.37 | Reliable |
| USDJPY | -4.73% | -4.12% | 6.35% | 137 | 47.40% | -0.88 | -0.74 | 8 | −$3.45 | Reliable |
| XAUUSD | -94.09% | -90.34% | 96.76% | 39 | 61.50% | -1.64 | -0.97 | 5 | −$241.26 | Account stopped out |
Profitable on 0 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 7% of 68 · GBPUSD: better than 5% of 66 · USDJPY: better than 15% of 68 · XAUUSD: better than 19% of 75
Month by month
| Market | Months with a gain | Best month | Worst month |
|---|---|---|---|
| EURUSD | 23% | +5.33% 2026-03 | -3.56% 2026-02 |
| GBPUSD | 15% | +6.88% 2026-03 | -5.76% 2026-02 |
| USDJPY | 46% | +1.30% 2026-08 | -2.75% 2026-09 |
| XAUUSD | 15% | +19.20% 2025-11 | -94.18% 2026-02 |
From the backtest equity curve, sampled about every two days; only reliable results.
Blow-up risk: High
- Hit a stop-out in our backtest (equity below 10%) on XAUUSD
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 a histogram representation of the CCI indicator, identifying momentum direction changes by evaluating CCI values relative to overbought/oversold thresholds (+100/-100). Entry conditions: a buy position opens when the previous histogram bar is in the neutral zone (Col[1]==0) and the current bar enters the positive zone (Col[0]>0); a sell position opens when the previous bar is in the neutral zone (Col[1]==2) and the current bar enters the negative zone (Col[0]<2). Exit conditions: positions are closed on reverse signals—long positions close when a sell signal appears, and short positions close when a buy signal appears. Position sizing supports five modes: percentage of free margin, percentage of balance, percentage of net free margin, percentage of net balance, and fixed lot size. Money management is controlled by the MM parameter for position size and MMMode for calculation method, defaulting to fixed lot mode (LOT=0.1). The strategy only checks signals tick-by-tick when SignalBar is 0, otherwise it waits for a new bar to form before evaluating, reducing unnecessary computation.
Strengths
- Clear strategy logic based on CCI momentum transitions to identify trend starts, with well-defined signal conditions
- Multiple money management modes provide flexibility to choose appropriate position sizing based on account size
- New bar filtering mechanism reduces duplicate signals and over-trading risk
- Configurable stop loss and take profit parameters provide a basic risk control framework
- Buy and sell directions can be independently toggled, enabling directional-only trading strategies
Weaknesses
- Stop loss of 1000 points and take profit of 2000 points are excessively large, potentially causing much greater actual risk than expected on most instruments
- Lacks spread filter and volatility filter, which may result in unfavorable fills during high-volatility or wide-spread periods
- No position check or duplicate order protection, potentially opening repeated positions when signals persist
- Depends on the custom CCI_Histogram indicator—if the indicator fails to load, the EA cannot run at all
- When SignalBar=1, signals are only checked on new bars, potentially missing optimal entry points during fast market moves
Possible improvements
- Add position check logic to prevent duplicate entries in the same signal direction and avoid over-exposure
- Add spread filter and volatility filter (e.g., ATR-based) to pause trading during unfavorable market conditions
Risk assessment
Overall risk: Medium
- Stop loss of 1000 points is excessively large; on small accounts or high leverage, a single trade loss may exceed account tolerance
- Lack of position checking may lead to duplicate entries in the same direction, compounding risk exposure
- The reverse-signal exit mechanism may trigger frequently in ranging markets, leading to consecutive losses
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
MM | 0.1 | Money management ratio or fixed lot size |
MMMode | LOT | Lot 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 | Maximum allowed slippage |
BuyPosOpen | true | Allow opening long positions |
SellPosOpen | true | Allow opening short positions |
BuyPosClose | true | Allow reverse closing long positions |
SellPosClose | true | Allow reverse closing short positions |
InpInd_Timeframe | PERIOD_H4 | ASCtrend indicator timeframe |
CCIPeriod | 14 | CCI indicator period |
CCIPrice | PRICE_CLOSE | CCI applied price type |
HighLevel | 100 | Indicator upper threshold level |
LowLevel | -100 | Indicator lower threshold level |
SignalBar | 1 | Signal bar index; 0=current, 1=last closed bar |
Similar Momentum EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.