CCI OVERBOUGHT OVERSOLD EA MT4/MT5 Settings/Inputs Guide

CCI OVERBOUGHT OVERSOLD EA MT4/MT5 Settings/Inputs Guide

18 February 2024, 10:39
Biswarup Banerjee
0
686

Complete User Documentation — MT4 & MT5

1. OVERVIEW

The Commodity Channel Index (CCI) Strategy Multicurrency EA automates trading across multiple pairs from a single chart, using the classic CCI oscillator to detect overbought/oversold extremes, zero-line crosses, and divergences. It's built for traders who want to run a systematic CCI-based strategy without staring at screens all day — the EA handles entry, exit, trailing stops, and risk management for you. The core problem it solves is the manual overhead of monitoring several pairs on different timeframes, while also letting you backtest and optimize your CCI rules with realistic settings.

Who Should Use It: Forex traders who already understand CCI signals and want a reliable, configurable robot to execute those signals across a portfolio of pairs — especially those who trade multiple timeframes or use divergence as part of their edge.

Main Benefit: You get a fully automated CCI trading system that scans and trades up to 28 pairs simultaneously, with 8 entry strategies, 8 exit strategies, ATR-based trailing, and a trend filter quorum — all from a single chart.


2. INPUT PARAMETERS & SETTINGS

This product shares a common set of general input settings with all Multi-Currency Scanner Dashboard products in this series. The following sections are covered in the common guide: General Settings (pairs list, dashboard colors, panel size), Timeframe Signal Settings (individual TF scan per symbol), Timeframe Confluence Settings (multi-TF confluence scan), and Alert Settings (popup, push notification, email). For full details refer to the Common Multi-Currency Scanner Dashboard Settings Guide. The sections below cover only the product-specific inputs unique to this product.

General Settings

These settings control how the EA displays virtual stop levels, manages group-level loss limits, includes swap costs in profit calculations, and records historical trade data for backtest analysis.

Setting Name Type Default Value Description Example
Chart lines for virtual SL/TP (never drawn during optimization) bool false When enabled, the EA draws dashed lines on the chart showing where your hidden stop-loss and take-profit levels sit. Useful for visual confirmation during live trading, but the EA never draws these during optimization to avoid slowing things down. true — enable on a demo or small live account to see your virtual stops at a glance.
Group Stoploss Amount double 0 Sets a maximum total loss in account currency across all open positions managed by this EA. Once the combined loss hits this threshold, the EA closes all trades. Handy for limiting portfolio drawdown without micromanaging each pair. 50 — if you have a $500 account, this caps total loss at $50 across all pairs.
Include Swap charges in Profit bool true When true, the EA factors overnight swap fees into the floating profit/loss used for breakeven and trailing stop calculations. Leave it on unless you're testing a pure intraday strategy where swaps don't matter. false — disable if you scalp on M1 and never hold past a few hours.
Enable history for backtests or optimization bool false Turns on detailed trade logging so you can review every signal and decision after a backtest or optimization run. Leave it off during live trading to save memory, but enable it when you're fine-tuning parameters. true — enable before running a multi-pass optimization on CCI period and levels.

Atr Trailingstop Settings

These settings let you attach a volatility-based trailing stop that adjusts dynamically using the Average True Range, so your stop distance expands and contracts with market noise.

Setting Name Type Default Value Description Example
Use ATR Trailing Stop bool false Master switch for the ATR-based trailing stop. When enabled, the EA replaces any fixed trailing logic with a dynamic stop that widens during high volatility and tightens when things calm down. Leave off if you prefer a fixed pip trail. true — enable on pairs like GBPJPY that see frequent volatility spikes.
ATR Timeframe ENUM PERIOD_CURRENT Selects the timeframe used to calculate the ATR value for trailing. Using a higher timeframe like H1 gives a smoother, more stable ATR, while the current chart timeframe reacts faster. Match it to your trading horizon. PERIOD_H1 — use hourly ATR for a smoother trail on M15 entries.
ATR Period int 14 Number of bars used to compute the ATR. The standard 14 works for most swing and intraday styles. Increase it (e.g., 20) for a slower, more filtered ATR that ignores short-term noise; decrease it for a faster reaction. 20 — use on daily charts to get a broader view of average volatility.
Activation (ATR multiplier) double 2.0 The profit distance (in ATR units) that must be reached before the trailing stop kicks in. A value of 2.0 means the trade must be 2 ATRs in profit before the trail activates. Higher values delay activation, giving the trade more room. 3.0 — use on trending pairs like USDJPY to let winners run before tightening.
Trail distance (ATR multiplier) double 1.0 How far behind the current price the stop-loss trail sits, measured in ATR units. A value of 1.0 places the stop 1 ATR below price for longs. Tighter values (0.5) protect profits faster but risk early exit on pullbacks. 1.5 — use on volatile pairs like GBPNZD to avoid getting stopped out by normal wiggles.
Trail increment (ATR multiplier) double 0.5 The step size (in ATR units) the stop moves each time price advances in your favor. A 0.5 increment means the stop jumps half an ATR at a time, reducing the number of stop adjustments and keeping the trail smooth. 1.0 — use for a coarser trail that moves in full ATR steps, reducing whipsaw.

Grid Settings

This single setting controls whether the EA attempts to recover losses from all open grid trades by closing them as a group when total profit turns positive.

Setting Name Type Default Value Description Example
Recover profit from all grid trades bool false When enabled, the EA treats all open positions from the same symbol as a single grid and closes them all once the combined net profit turns positive. Useful for martingale or averaging strategies where you want to exit the whole basket at breakeven or better. true — enable if you use a grid or scaling-in approach and want to clear the deck when the group is in profit.

Safeguard Settings

These backtest-only parameters let you set minimum performance thresholds — max loss, minimum profit, minimum trades, and max inactivity — so you can quickly filter out poor optimization runs without manually inspecting each result.

Setting Name Type Default Value Description Example
Max Loss from initial balance [0: disable] double 0.0 Defines the maximum allowed drawdown as a percentage of the starting balance. If the equity drops below this threshold during a backtest, the EA stops trading. Set to 0 to disable. Crucial for avoiding strategies that blow up in volatile conditions. 20 — cap drawdown at 20% of initial balance during optimization.
Minimum Profit Percent [backtesting only] [0: disable] double 0 Sets a minimum total profit percentage that the backtest must achieve. If the result falls below this, the EA discards the run. Use it to quickly eliminate underperforming parameter sets during optimization without manual inspection. 10 — only keep optimization results that return at least 10% profit over the test period.
Minimum Trades [backtesting only] [0: disable] double 0 Requires a minimum number of trades to be executed during the backtest. If the EA takes fewer trades than this, the run is considered invalid. Helps filter out parameter sets that are too conservative or rarely trigger. 50 — ignore any optimization pass that produced fewer than 50 trades.
Max inactive days [backtesting only] [0: disable] int 0 Sets the maximum number of consecutive days without a trade before the EA considers the backtest invalid. Useful for detecting strategies that go dormant for long periods, which often means they're not robust across market conditions. 30 — reject any optimization run where the EA went more than a month without trading.

Cci Settings

These are the core CCI parameters — timeframe, period, applied price, calculation mode, overbought/oversold levels, and the entry/exit strategy selection that defines your trading logic.

Setting Name Type Default Value Description Example
Cci Timeframe ENUM PERIOD_CURRENT Selects the timeframe on which the CCI indicator is calculated. You can set it independently of the chart timeframe — for example, use M15 CCI on an M1 chart to get a smoother signal. The default uses the chart's own timeframe. PERIOD_M15 — use 15-minute CCI for entries on an M5 chart to reduce noise.
Cci Period int 14 The number of bars used in the CCI calculation. The standard 14 balances sensitivity and reliability. Lower values (e.g., 7) make the CCI react faster but produce more false signals; higher values (e.g., 30) smooth the line for trend trading. 20 — use a longer period on H4 charts to filter out minor fluctuations.
Cci Applied Price ENUM PRICE_CLOSE Determines which price — close, open, high, low, median, typical, or weighted — feeds into the CCI formula. Close is standard for most strategies, but using typical price (H+L+C)/3 can give a more balanced view of the session. PRICE_TYPICAL — use when you want the CCI to reflect the average price action rather than just the close.
Calculation Mode (Useful for backtesting) ENUM AUTO In AUTO mode, the EA calculates the upper and lower levels based on the upper level you provide (lower becomes -upper). In MANUAL mode, you set both levels independently. AUTO is simpler for backtesting; MANUAL gives you full control. MANUAL — set upper to 120 and lower to -80 for an asymmetric overbought/oversold range.
Cci Upper Level double 100 3. HOW IT WORKS

Core Calculation & Logic

The EA calculates the Commodity Channel Index (CCI) for each symbol in your list using the formula: (Typical Price - SMA of Typical Price) / (0.015 × Mean Deviation) . The Typical Price is the average of High, Low, and Close for each bar. The EA then compares the resulting CCI value against the user-defined upper and lower levels (default ±100) to detect overbought or oversold conditions. It also tracks the direction of CCI crosses relative to these levels and the zero line, depending on the chosen entry strategy.

What makes this EA different from a simple CCI indicator is its multicurrency scanning engine. It runs the same calculation across all selected pairs and timeframes simultaneously, then applies your chosen entry strategy and filters to decide whether to open a trade. The EA also includes divergence detection for Strategy 7, where it compares price action with CCI peaks and troughs to spot hidden or regular divergences. This gives you a systematic way to trade CCI signals without staring at multiple charts all day.

Entry Strategies Explained

ENTRY_STRATEGY1 — Classic Overbought/Oversold Reversal

BUY Signal: CCI crosses below the lower level (e.g., -100) — enters oversold territory.

SELL Signal: CCI crosses above the upper level (e.g., +100) — enters overbought territory.

Best For: Range-bound markets where price tends to revert from extremes. Works well on higher timeframes (H1+) to filter noise.

ENTRY_STRATEGY2 — Exit-Based Reversal

BUY Signal: CCI crosses above the lower level (exits oversold) — momentum shifting upward.

SELL Signal: CCI crosses below the upper level (exits overbought) — momentum shifting downward.

Best For: Trending markets where you want to enter after the initial extreme has passed, catching the continuation move.

ENTRY_STRATEGY3 — Overbought Continuation

BUY Signal: CCI crosses above the upper level — enters overbought territory (counterintuitive buy).

SELL Signal: CCI crosses below the upper level — exits overbought territory.

Best For: Strong uptrends where overbought readings persist. This strategy catches breakouts rather than reversals.

ENTRY_STRATEGY4 — Level Persistence

BUY Signal: CCI remains above the upper level for a sustained period — bullish momentum confirmed.

SELL Signal: CCI drops below the upper level after being above it — momentum failure.

Best For: Trend-following on high-volatility pairs like GBP/JPY. Requires a longer CCI period (20+) to avoid whipsaws.

ENTRY_STRATEGY5 — Extreme Oversold Persistence

BUY Signal: CCI stays below the lower level — extreme selling pressure, potential capitulation.

SELL Signal: CCI rises above the lower level after being below it — recovery underway.

Best For: Counter-trend scalping on M5-M15. Use tight stop-losses because these signals can fail in strong trends.

ENTRY_STRATEGY6 — Zero-Line Cross

BUY Signal: CCI crosses above the zero line — bullish momentum shift.

SELL Signal: CCI crosses below the zero line — bearish momentum shift.

Best For: Swing trading on H4/D1. The zero line acts as a neutral zone, so crosses here often align with major trend changes.

ENTRY_STRATEGY7 — Divergence

BUY Signal: Bullish divergence — price makes a lower low while CCI makes a higher low (regular) or price makes a higher high while CCI makes a lower high (hidden).

SELL Signal: Bearish divergence — price makes a higher high while CCI makes a lower high (regular) or price makes a lower low while CCI makes a higher low (hidden).

Best For: Experienced traders who can confirm divergence with support/resistance. Works best on H1-H4 with the lookback set to 30-50 bars.

Step-by-Step Workflow

Step 1: Attach to any chart. Open an MQL5-compatible chart (any pair, any timeframe). Drag the EA from the Navigator panel onto the chart. A dialog will appear — click OK to accept the default settings or adjust them first.

Step 2: Configure symbols. In the EA's input parameters, find the SYMBOLS field (under GENERAL SETTINGS). Enter the pairs you want to scan, separated by commas — for example: EURUSD,GBPUSD,USDJPY,AUDUSD . The EA will scan all of them from a single chart.

Step 3: Set your CCI strategy. Scroll to the Cci Entry Strategy dropdown and pick one of the seven strategies. If you choose Strategy 7, also adjust the Divergence Lookback Bars and Minimum Bars Distance settings.

Step 4: Define risk parameters. Set your Lot Size (start with 0.01 for testing). Choose a Stoploss and Takeprofit calculation mode — I recommend PIPS for simplicity. Enter your stop-loss and take-profit values in pips (e.g., 30 and 60).

Step 5: Enable alerts (optional). If you want popup, email, or push notifications when signals appear, configure the alert settings in the common guide section. This is useful if you're running the EA on a VPS and want to monitor signals remotely.

Step 6: Run a backtest first. Before going live, open the Strategy Tester in MT4/MT5. Select the EA, set your date range (e.g., last 6 months), and run with 90% quality or higher. Check the results for win rate, drawdown, and profit factor. Adjust the CCI period or levels if needed.

Step 7: Go live with caution. Once you're satisfied with backtest results, attach the EA to a demo account for at least 2 weeks. Monitor its behavior during different market conditions. Only then consider a live account with small size.


4. RISK MANAGEMENT FEATURES

The EA includes several built-in risk controls that let you tailor position sizing and loss limits to your account size and risk tolerance.

Feature Description
Lot Size Fixed lot size for all trades. Start with 0.01 for micro accounts. For larger accounts, you can scale up but never exceed 2% risk per trade.
Stoploss/Takeprofit Modes Choose from Pips, Amount, Percent, Group Amount, Group Percent, or No SL/TP. The Group modes calculate SL/TP across all open positions from this EA, useful for portfolio-level risk.
Hidden SL/TP When enabled (default), stop-loss and take-profit are managed internally without sending them to the broker. This prevents brokers from seeing your exit levels. The EA closes the trade when price hits the hidden level.
Group Risk Controls Group StopLoss and TakeProfit in Amount or Percent apply to the total equity of all positions opened by this EA. Useful if you're running multiple pairs and want a combined loss limit.
Risk/Reward Ratio If you set a risk/reward ratio (e.g., 1:2), the EA calculates the take-profit automatically based on the stop-loss distance. This ensures consistent risk management across all trades.

5. IMPORTANT NOTES & WARNINGS

Known Limitations

Issue Explanation
CCI Whipsaws in Ranging Markets In low-volatility, sideways markets, CCI can oscillate around the upper/lower levels repeatedly, generating false signals. Use Strategy 6 (zero-line cross) or increase the CCI period to 20+ to reduce noise.
Divergence Lag Strategy 7 (divergence) can be slow to confirm — sometimes price reverses before the divergence signal fires. Combine with price action confirmation (e.g., pin bars) for better timing.
Hidden SL/TP Not Visible in Backtest When SHOW_HIDDEN_SL_TP_LINES is disabled (default during optimization), you won't see SL/TP lines on the chart. This is normal — the EA still manages them internally. Enable it only for visual testing.
Multiple Pairs = Multiple Positions The EA can open trades on several pairs simultaneously. If you're not careful, you could end up with 5+ open positions at once. Use the Group StopLoss feature to cap total risk.
Broker Timezone Mismatch CCI calculations depend on bar close times. If your broker uses a different timezone than your local time, signals may appear earlier or later than expected. Always check the chart time vs. your broker's server time.

Settings Beginners Should NOT Change

Setting Why to Leave Default
Calculation Mode The default MANUAL mode uses your specified CCI values. Switching to AUTO changes how CCI is calculated during backtesting, which can produce unrealistic results if you don't understand the logic.
Divergence Lookback Bars Default 50 bars is a good balance for H1-H4. Reducing it to 20 can cause too many false divergence signals; increasing it to 100 makes the EA slow to react. Only change if you're experienced with divergence trading.
Minimum Bars Distance (Divergence) Default 20 bars prevents the EA from detecting divergence on consecutive bars, which is usually noise. Setting it to 0 disables this filter and will generate many low-quality signals.
Group StopLoss/TakeProfit Modes These are advanced portfolio-level controls. Beginners should stick with PIPS mode for individual trade SL/TP. Group modes can close all positions unexpectedly if you don't understand how they aggregate.
Hidden SL/TP Disabling this sends your stop-loss and take-profit levels to the broker, which can lead to stop-hunting. Keep it enabled unless you have a specific reason to show your levels.

Dashboard Usage Tips

  1. Start with one strategy: Don't try all seven at once. Pick Strategy 1 or 6 first, run it for a week on demo, then experiment with others. You'll learn which fits your trading style.
  2. Watch the CCI levels during news: Major economic releases can spike CCI to extreme values (+200 or -200). The EA might fire false signals. Consider disabling trading 30 minutes before and after high-impact news.
  3. Use the dashboard to compare pairs: The scanner shows CCI values for all symbols in real-time. If you see multiple pairs showing oversold simultaneously, it might indicate a broader market move — that's a higher-probability signal.
  4. Adjust levels for volatility: In calm markets, ±100 works fine. In volatile ones (like during COVID), try ±150 or ±200 to avoid whipsaws. Check the CCI's recent range on the chart to decide.
  5. Backtest with realistic spreads: When testing in the Strategy Tester, set your spread to at least 10-15 pips for major pairs and 20-30 for crosses. This prevents over-optimistic results that won't hold in live trading.
  6. Don't over-optimize: Changing the CCI period from 14 to 13 or 15 won't magically improve results. Focus on the strategy logic and risk management instead. A 14-period CCI is a standard that works across most markets.

Quick Start Guide

Follow these steps to get started in under 5 minutes:

  1. Attach the EA: Open any chart in MT4 or MT5. Drag the EA from the Navigator onto the chart. Click OK in the confirmation dialog.
  2. Enter your pairs: In the EA settings, find the SYMBOLS field. Type the pairs you want to trade, separated by commas — for example: EURUSD,GBPUSD,USDJPY . The EA will scan all of them.
  3. Pick a strategy: Scroll to Cci Entry Strategy and select ENTRY_STRATEGY1 (classic reversal)

    Installation Guide for MQL Products | Updating Purchased MQL Products on MT4/MT5 | General Troubleshooting Guide | Backtest and Set Files

    Check all my products: https://www.mql5.com/en/users/biswait50/seller

    Contact me for support: https://www.mql5.com/en/users/biswait50