

CCI Expert Advisor Documentation
This Expert Advisor (EA) utilizes a Commodity Channel Index (CCI)-based trading strategy for calculated entry and exit decisions. Alongside this core strategy, it incorporates optional advanced features, including a Moving Average filter on a higher timeframe, grid recovery, hedge, martingale strategies, position sizing based on profit, and day and time filters. These features provide flexibility and adaptability in various market conditions.
MT5 version available CCI OverBought OverSold EA MT5
MT4 version available CCI OverBought OverSold EA MT4
We divide our input sections into two parts. The first part is indicator-related settings, which you can find at the bottom side of the EA inputs. All other settings are common for every EA we make. We call these additional features. You can find the detailed documentation of these settings in this link.
1. CCI Settings
CCI Input Parameters
- CCI1__TEXT_1 - Divider text for visual clarity in the input section. (Not important for EA calculation)
- CCI1_TEXT - Text label for CCI settings. (Not important for EA calculation)
- CCI1__TEXT_2 - Divider text for visual clarity in the input section. (Not important for EA calculation)
- CCI1_TIMEFRAME - Selects the timeframe for CCI calculation. Default: PERIOD_CURRENT .
- CCI1_PERIOD - Defines the period for the CCI indicator. Default: 14 .
- CCI1_APPLIED_PRICE - Chooses the price type for CCI calculation. Default: PRICE_CLOSE .
Calculation Mode
- MANUAL - Uses the user-defined upper and lower levels for CCI signals.
- AUTO - Automatically calculates the upper and lower levels (useful for backtesting).
CCI Levels
- CCI1_UPPER_LEVEL - Sets the upper threshold for CCI. Default: 100 .
- CCI1_LOWER_LEVEL - Sets the lower threshold for CCI. Default: -100 .
Entry Strategy Options
- ENTRY_STRATEGY1 - Buys when the CCI enters the oversold region and sells when it enters the overbought region.
- ENTRY_STRATEGY2 - Buys when the CCI exits the oversold region and sells when it exits the overbought region.
- ENTRY_STRATEGY3 - Buys when the CCI enters the overbought region and sells when it enters the oversold region.
Exit Strategy Options
- EXIT_STRATEGY1 - Buys exit when the CCI enters the overbought region and sells exit when it enters the oversold region.
- EXIT_STRATEGY2 - Buys exit when the CCI exits the overbought region and sells exit when it exits the oversold region.
- EXIT_STRATEGY3 - Buys exit when the CCI enters the oversold region and sells exit when it enters the overbought region.
- EXIT_STRATEGY4 - Disables automatic exits.
Note: Only one entry or exit strategy can be active at a time. If you are using grid, hedge, or martingale strategies alongside the base strategy, it is recommended to disable the exit strategy to avoid interfering with these loss recovery mechanisms.
2. Additional Features
Moving Average (MA) Filter on Higher Timeframe
The MA filter enables trades that align with the broader trend based on a higher timeframe moving average:
- Uptrend Condition - Allows buy trades when the close price is above the moving average.
- Downtrend Condition - Allows sell trades when the close price is below the moving average.
Loss Recovery Strategies
There are couple of loss recovery strategies popular in the market. Grid, Hedge and Martingale is most popular among them. In this EA, we have these strategies inbuilt. But only one loss recovery strategy can be active at a time. EA will not load, if we enable more than one loss recovery strategies. There is one important point regarding these strategies, we can not set stoploss if you enable Grid or Hedge strategy. It will close trades earlier and will compromise the purpose of these strategies. All of these strategies are by default disabled.
Grid Recovery Strategy
In a losing position, the EA places additional trades in a grid pattern, averaging down the entry price to capitalize on retracements.
Hedge Strategy
To balance exposure during a losing position, the EA opens opposing trades (hedges), allowing profit potential in countertrend movements.
Martingale Strategy
Increases lot size after a loss on each subsequent signal, aiming for overall profitability.
Position Sizing Based on Profit
This feature adjusts the position size dynamically based on cumulative profit, aiming to optimize gains in favourable conditions. As profit accumulates, the EA increases the position size, allowing for scaled growth and larger potential returns.
Day Filter
Specifies trading days to avoid trading during specific days of the week, aligning with your strategy’s optimal market conditions. You can disable the entire day filter.
Time Filter
Limits trading to specific times, preventing trades during low-liquidity periods or other non-ideal market conditions. You can disable entire time filter.