CCI Multi-Currency EA: Comprehensive User Guide, Backtest Results, and Optimized Set Files

19 November 2024, 12:32
Biswarup Banerjee
0
556

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 CCI-based entry and exit logic. It goes beyond a simple scanner — this EA places and manages trades based on configurable CCI strategies, divergence detection, and trend filters. You get a full automated system that handles position sizing, stop-loss/take-profit, trailing stops, and even grid recovery, all while monitoring multiple symbols simultaneously. The core problem it solves: manually tracking CCI signals across several pairs is tedious and slow; this EA does it in real-time and acts on those signals instantly.

Who Should Use It: Forex traders who want a hands-off, rule-based approach to trading CCI setups across multiple currency pairs without staring at charts all day.

Main Benefit: Automate your CCI strategy across dozens of pairs with sophisticated risk controls, multiple entry/exit strategies, and divergence detection — 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-loss/take-profit lines, manages group-level loss limits, includes swap costs in profit calculations, and records historical trade data for backtesting.

Setting Name Type Default Value Description Example
Chart lines for virtual SL/TP (never drawn during optimization) bool false When enabled, draws dashed lines on the chart showing where your virtual stop-loss and take-profit levels sit. Useful for visual confirmation during live trading, but these lines are never drawn during optimization to avoid slowing things down. true — enable if you want to see your hidden SL/TP levels on the chart for manual monitoring.
Group Stoploss Amount double 0 Sets a maximum total loss in account currency for all trades opened by this EA. When the cumulative loss hits this amount, all positions are closed. Helps protect your account from runaway losses across multiple pairs. 100 — close all trades if total loss reaches $100 across all pairs.
Include Swap charges in Profit bool true When true, swap (overnight interest) is factored into the profit calculations used by breakeven, trailing stop, and group stop-loss logic. If you hold positions overnight, this gives a more accurate picture of real P&L. false — disable if you trade short-term and don't want swap affecting your exit triggers.
Enable history for backtests or optimization bool false When enabled, the EA records detailed trade history during backtests or optimization runs. This helps you analyze performance but can slow down optimization. Leave off for quick parameter sweeps, then enable for final validation. true — enable when you're doing a final backtest to review individual trade logs.

Atr Trailingstop Settings

These settings configure an ATR-based trailing stop that dynamically adjusts your stop-loss level based on market volatility, using the Average True Range indicator.

Setting Name Type Default Value Description Example
Use ATR Trailing Stop bool false Master switch for the ATR trailing stop feature. When enabled, the EA will adjust your stop-loss based on market volatility instead of a fixed pip distance. Useful for trending markets where volatility changes. true — enable on pairs like GBP/JPY that have variable volatility.
ATR Timeframe ENUM PERIOD_CURRENT Selects the timeframe used to calculate the ATR value for trailing stop adjustments. A higher timeframe gives a smoother, less reactive trail, while a lower one responds faster to recent volatility. H1 — use hourly ATR for a balanced trail on day trades.
ATR Period int 14 Number of bars used to compute the ATR. A shorter period (e.g., 7) makes the trail more sensitive to recent price swings, while a longer period (e.g., 21) smooths out noise. Adjust based on your trading style. 7 — use a shorter period for scalping to react quickly to volatility changes.
Activation (ATR multiplier) double 2.0 The profit level (in ATR units) that must be reached before the trailing stop activates. A value of 2.0 means the trade must be 2 ATRs in profit before the trail kicks in. Prevents premature trailing in choppy markets. 3.0 — require 3 ATRs of profit before trailing, useful for strong trends.
Trail distance (ATR multiplier) double 1.0 The initial distance of the trailing stop from the current price, measured in ATR units. A value of 1.0 means the stop is placed 1 ATR away. Tighter values lock in profit faster but risk being stopped out by noise. 1.5 — give the trade more room to breathe in volatile conditions.
Trail increment (ATR multiplier) double 0.5 How much the trailing stop moves each time price moves in your favor, in ATR units. A value of 0.5 means the stop moves up by 0.5 ATR for every 1 ATR of favorable price movement. Controls how aggressively the trail tightens. 0.3 — a more conservative increment that lets profits run longer before tightening.

Grid Settings

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

Setting Name Type Default Value Description Example
Recover profit from all grid trades bool false When enabled, the EA will close all grid trades as a group once their combined net profit turns positive. This is a common grid recovery technique — instead of each trade needing its own TP, the whole basket exits when in profit. true — enable if you're running a grid strategy and want basket-based profit taking.

Safeguard Settings

These settings act as safety nets for backtesting and live trading, limiting maximum loss, ensuring minimum profitability, and preventing extended periods of inactivity.

Setting Name Type Default Value Description Example
Max Loss from initial balance [0: disable] double 0.0 Sets a maximum drawdown limit as a percentage of the starting account balance. If losses exceed this percentage, the EA stops trading and closes all positions. Critical for protecting your account during adverse market conditions. 20 — stop all trading if losses reach 20% of initial balance.
Minimum Profit Percent [backtesting only] [0: disable] double 0 For backtesting: if the overall profit percentage falls below this threshold, the EA will stop trading. Useful for filtering out parameter sets that don't meet your profitability criteria during optimization. 5 — reject any backtest run that doesn't achieve at least 5% profit.
Minimum Trades [backtesting only] [0: disable] double 0 For backtesting: sets a minimum number of trades that must be executed during the test period. If the EA doesn't trade enough, the run is considered invalid. Helps avoid over-optimized but rarely triggered strategies. 50 — require at least 50 trades in the backtest to consider the results meaningful.
Max inactive days [backtesting only] [0: disable] int 0 For backtesting: if the EA goes without opening a trade for more than this many days, the run is stopped. Prevents strategies that work in theory but go dormant for long stretches in practice. 30 — stop the backtest if no trade occurs for 30 consecutive days.

Cci Settings

These settings define the core CCI indicator parameters — timeframe, period, applied price, overbought/oversold levels, and the entry/exit strategies that determine when the EA opens and closes trades.

Setting Name Type Default Value Description Example
Cci Timeframe ENUM PERIOD_CURRENT Selects the timeframe for CCI calculations. Using a higher timeframe (e.g., H4) produces fewer, more reliable signals, while lower timeframes (M5) generate more frequent entries. Match this to your trading horizon. M15 — good for intraday swing trading with moderate frequency.
Cci Period int 14 Number of bars used in the CCI calculation. A lower period (e.g., 7) makes the indicator more sensitive to price changes, generating more signals but also more false ones. Higher periods smooth the line for cleaner trends. 20 — use a longer period to reduce noise on volatile pairs like GBP/NZD.
Cci Applied Price ENUM PRICE_CLOSE Determines which price (close, open, high, low, median, typical, weighted) is used for CCI calculations. Close is standard, but using typical price (H+L+C)/3 can give a more balanced view of the session. PRICE_TYPICAL — use for a smoother CCI that accounts for intra-bar range.
Calculation Mode (Useful for backtesting) ENUM AUTO Controls how the upper and lower CCI levels are determined. Manual uses the values you set; Auto calculates the lower level as the negative of the upper level. Auto is handy for backtesting different thresholds quickly. MANUAL — set both levels independently if you want asymmetric thresholds like +150 and -100.
Cci Upper Level double 100 The overbought threshold. When CCI rises above this level, the market is considered overbought. Higher values (e.g., 150) require stronger momentum before triggering signals, reducing false entries in ranging markets. 150 — use a higher level for a more conservative overbought signal on strong trends.
Cci Lower Level double -100 The oversold threshold. When CCI falls below this level, the market is considered oversold. More negative values (e.g., -150) require deeper oversold conditions before triggering buy signals, filtering out weak reversals. -150 — use a lower level for a more conservative oversold signal in volatile pairs.
Cci Entry Strategy ENUM ENTRY_STRATEGY1 See options explained below. ENTRY_STRATEGY2 — use for entries when CCI exits oversold, catching the start of a recovery.
Cci Exit Strategy ENUM EXIT_STRATEGY0 See options explained below. EXIT_STRATEGY2 — exit longs when CCI exits overbought, locking in profits near the top.

Cci Entry Strategy — Options Explained

These strategies define the exact condition that triggers a buy or sell order. Each one interprets CCI behavior differently, so choose the one that matches your market view. Note that ENTRY_STRATEGY0 disables entry entirely — useful if you only want the EA to manage exits.

ENTRY_STRATEGY0: Disables all entry signals. The EA will not open any new trades based on CCI. Use this if you want the EA to only manage exits or if you're using it purely for monitoring.

ENTRY_STRATEGY1: Buy when CCI enters oversold territory (crosses below the lower level), anticipating a bounce. Sell when CCI enters overbought territory (crosses above the upper level), expecting a pullback. Classic reversal strategy.

ENTRY_STRATEGY2: Buy when CCI exits oversold (crosses back above the lower level), catching the early recovery. Sell when CCI exits overbought (crosses back below the upper level), capturing the start of a decline. Often more reliable than strategy 1 because it confirms the reversal.

ENTRY_STRATEGY3: Buy when CCI enters overbought territory — a contrarian approach expecting a short-term top. Sell when CCI enters oversold territory. This is a fade-the-extreme strategy, best used in ranging markets.

ENTRY_STRATEGY4: Buy when CCI is above the upper level, riding the bullish momentum. Sell when CCI is below the lower level, following the bearish momentum. A trend-following approach that enters in the direction of the extreme.

ENTRY_STRATEGY5: Buy when CCI is below the lower level, anticipating a reversal from oversold. Sell when CCI is above the upper level, expecting a reversal from overbought. Similar to strategy 1 but without requiring a cross — just being in the zone triggers the trade.

ENTRY_STRATEGY6: Buy when CCI crosses above the zero line, signaling bullish momentum. Sell when CCI crosses below zero, signaling bearish momentum. A momentum-based strategy that ignores overbought/oversold levels entirely.

ENTRY_STRATEGY7: Buy on bullish divergence (price makes a lower low while CCI makes a higher low). Sell on bearish divergence (price makes a higher high while CCI makes a lower high). Requires divergence detection settings to be configured. This is the most nuanced strategy and works well at trend reversals.

Cci Exit Strategy — Options Explained

These strategies define when the EA closes an existing trade based on CCI conditions. EXIT_STRATEGY0 disables CCI-based exits, meaning the EA will rely on your stop-loss, take-profit, or other exit methods. Each exit strategy mirrors the logic of the corresponding entry strategy but applied to closing trades.

EXIT_STRATEGY0: Disables all CCI-based exit signals. The EA will not close trades based on CCI conditions. Use this if you prefer to manage exits manually or rely solely on fixed SL/TP levels.

EXIT_STRATEGY1: Close a buy when CCI enters overbought (crosses above upper level). Close a sell when CCI enters oversold (crosses below lower level). Exits at the extreme, aiming to capture the full move.

EXIT_STRATEGY2: Close a buy when CCI exits overbought (crosses back below upper level). Close a sell when CCI exits oversold (crosses back above lower level). Exits after the extreme has passed,


3. HOW IT WORKS

Core Calculation & Logic

The EA calculates the Commodity Channel Index (CCI) for each symbol in your list using the standard formula: (Typical Price - SMA of Typical Price) / (0.015 × Mean Deviation). It then compares the current CCI value against your configured upper and lower levels (default ±100) to identify overbought and oversold conditions. What makes this EA different from a simple indicator overlay is that it monitors multiple timeframes and symbols simultaneously from a single chart, applying your chosen entry strategy to each pair independently.

The mathematical basis is straightforward: CCI measures how far price has deviated from its statistical average. Values above +100 suggest overbought conditions (potential sell), values below -100 suggest oversold conditions (potential buy). The EA doesn't just look at level crosses though — depending on your strategy selection, it can also detect zero-line crosses, momentum shifts, and even classic divergence patterns between price and CCI. This multi-strategy approach lets you adapt the same core indicator to different market regimes without switching tools.

Entry Strategies Explained

ENTRY_STRATEGY1 — Classic Overbought/Oversold Reversal

BUY Signal: CCI enters oversold territory (crosses below the lower level) and then crosses back above it. This catches the bounce from extreme selling pressure.

SELL Signal: CCI enters overbought territory (crosses above the upper level) and then crosses back below it. This catches the reversal from extreme buying pressure.

Best For: Range-bound markets where price oscillates between clear support and resistance zones. Works well on higher timeframes (H1+) where false breakouts are less common.

ENTRY_STRATEGY2 — Exit-Based Momentum

BUY Signal: CCI exits oversold territory by crossing back above the lower level. You're buying as soon as the extreme selling pressure releases.

SELL Signal: CCI exits overbought territory by crossing back below the upper level. You're selling as soon as the extreme buying pressure fades.

Best For: Trending markets where you want to enter early in the pullback, not wait for a full reversal confirmation. Scalpers often prefer this on M5-M15.

ENTRY_STRATEGY3 — Overbought Continuation (Counter-Trend)

BUY Signal: CCI enters overbought territory (crosses above the upper level). This is a contrarian buy — you're betting the overbought condition will lead to a price drop.

SELL Signal: CCI exits overbought territory by crossing back below the upper level. You're selling after the overbought condition breaks.

Best For: Strong mean-reversion strategies on lower timeframes. Use with caution — this strategy goes against the immediate trend direction.

ENTRY_STRATEGY4 — Trend Strength Filter

BUY Signal: CCI remains above the upper level, indicating sustained bullish momentum. You buy into strength, not weakness.

SELL Signal: CCI falls below the upper level after being above it. You exit or sell short when momentum weakens.

Best For: Strong trending markets where you want to ride momentum, not catch reversals. Combine with a trend filter like moving average for best results.

ENTRY_STRATEGY5 — Oversold Continuation

BUY Signal: CCI is below the lower level, indicating sustained bearish momentum. You buy into weakness, anticipating a bounce.

SELL Signal: CCI rises above the lower level after being below it. You exit or sell short when the selling pressure eases.

Best For: Counter-trend entries in strong downtrends. Higher risk but can catch sharp reversals if timed with support levels.

ENTRY_STRATEGY6 — Zero-Line Cross

BUY Signal: CCI crosses above the zero line from below. This signals a shift from bearish to bullish momentum.

SELL Signal: CCI crosses below the zero line from above. This signals a shift from bullish to bearish momentum.

Best For: Trend-following strategies on any timeframe. The zero line acts like a momentum equator — above is bullish, below is bearish.

ENTRY_STRATEGY7 — Divergence Detection

BUY Signal: Bullish divergence occurs when price makes a lower low but CCI makes a higher low. The EA scans back the number of bars defined in Divergence Lookback Bars to find these patterns.

SELL Signal: Bearish divergence occurs when price makes a higher high but CCI makes a lower high. This warns of weakening upward momentum.

Best For: Identifying trend reversals before price action confirms. Works best on H1-H4 where divergence patterns have time to develop. Requires the divergence settings to be properly configured.

Step-by-Step Workflow

Step 1: Attach to any chart. The EA doesn't need to be on a specific pair — it scans all symbols in your list from whatever chart you attach it to. Just make sure the chart timeframe matches your preferred scan timeframe.

Step 2: Configure your symbol list. In the SYMBOLS input, enter comma-separated pairs like "EURUSD,GBPUSD,USDJPY,AUDUSD". The EA will scan each one independently using your CCI settings.

Step 3: Set your CCI parameters. Choose your timeframe, period (default 14), applied price, and upper/lower levels. If you're using Strategy 7, also configure the divergence lookback and minimum bar distance.

Step 4: Select your entry strategy. Pick one of the seven strategies from the Cci Entry Strategy dropdown. Each strategy defines exact buy and sell conditions as described above.

Step 5: Configure risk management. Set your lot size, stop loss, and take profit. Choose between pips, amount, or percent modes. For group-based risk, use the GROUP_AMOUNT or GROUP_PERCENT options to manage total exposure across all open positions.

Step 6: Enable alerts. Turn on popup, email, or push notifications in the alert settings section. This way you don't need to watch the chart constantly.

Step 7: Run a backtest first. Before going live, test on at least 6 months of data with your chosen settings. Pay attention to drawdown and win rate — adjust your stop loss and take profit levels based on what you see.


4. RISK MANAGEMENT FEATURES

The EA offers several ways to control risk, from simple fixed stops to group-level exposure limits. Here's what each feature does:

Feature Description
Stoploss and Takeprofit calculation mode Choose between Pips, Amount, Percent, Group Amount, Group Percent, or No SL/TP. Pips mode uses fixed pip distances, Amount mode uses a fixed currency value, Percent mode uses a percentage of account equity. Group modes apply the risk limit across all open positions combined.
Hide Stoploss and Takeprofit When enabled, the EA uses virtual SL/TP levels that aren't visible to your broker. This prevents stop-hunting and keeps your strategy hidden. The EA manages these levels internally and closes positions when they're hit.
Chart lines for virtual SL/TP When enabled, the EA draws visual lines on the chart showing where your virtual stops and targets are. Useful for monitoring but never drawn during optimization to avoid slowing down backtests.
Group Stoploss/Takeprofit Amount Sets a maximum total loss or profit across all open positions in currency terms. For example, if Group Stoploss Amount is 100, the EA will close all positions if total loss exceeds $100. Prevents runaway losses on correlated pairs.
Risk Reward Ratio Automatically calculates take profit based on your stop loss distance. For example, a 1:2 ratio means your target is twice the distance of your stop. Ensures consistent risk/reward across all trades.

5. IMPORTANT NOTES & WARNINGS

Known Limitations

Issue Explanation
Multiple positions on same pair The EA can open multiple positions on the same symbol if signals keep firing. This can lead to overexposure if you're not careful. Use group stop loss settings to cap total risk.
Backtest accuracy with virtual SL/TP Virtual stops rely on tick data for accurate testing. On lower-quality data (like M1 OHLC), the EA may miss exact stop levels. Use tick data or real ticks mode for reliable backtests.
Divergence detection lag Strategy 7 requires a minimum bar distance between divergence points. On fast-moving markets, this can cause delayed signals. Reduce the lookback bars for faster detection, but expect more false signals.
Broker symbol naming Some brokers use suffixes like ".fx" or "m" in symbol names. Your symbol list must exactly match your broker's naming convention. Check the Market Watch before configuring.
Optimization speed Scanning multiple symbols during optimization is slow. Each pass tests every symbol in your list. Limit the symbol count to 3-4 during optimization, then expand for live trading.

Settings Beginners Should NOT Change

Setting Why to Leave Default
Calculation Mode The MANUAL mode uses your specified CCI values consistently. Switching to AUTO can cause unexpected behavior in live trading — it's designed for backtesting only. Leave it on MANUAL unless you fully understand the implications.
Divergence Lookback Bars The default 50 bars provides a good balance between catching divergences and avoiding noise. Reducing it too much (under 20) will generate constant signals, most of which will be false. Only adjust after extensive backtesting.
Minimum Bars distance between divergence Setting this to 0 disables the minimum distance check, which can cause the EA to detect divergences on every minor wiggle. The default 20 bars prevents this. Beginners should keep it enabled.
Hide Stoploss and Takeprofit Disabling this sends real SL/TP orders to your broker, revealing your strategy. Keep it enabled (True) to use virtual stops. Only disable if your broker requires real stop orders for certain account types.
Group Stoploss/Takeprofit modes Group modes are powerful but can close all your positions at once if misconfigured. Start with individual stop loss modes (Pips or Amount) until you understand how the EA manages multiple positions.

Dashboard Usage Tips

  1. Start with one strategy: Don't try to use all seven strategies at once. Pick one that matches your trading style (e.g., Strategy 6 for trend following) and master it before experimenting.
  2. Watch for correlated pairs: If you're trading EURUSD, GBPUSD, and USDCHF together, they're highly correlated. A single market move can trigger simultaneous signals. Use group stop loss to cap total exposure.
  3. Backtest with realistic spreads: The EA doesn't account for spread in its calculations. Add 1-2 pips to your stop loss distance during backtesting to simulate real trading conditions.
  4. Use the alert system: Enable push notifications to your phone. You don't need to watch the chart — let the EA tell you when a signal fires. This is especially useful for Strategy 7 divergence signals which can be hard to spot manually.
  5. Don't over-optimize: The CCI period and levels are robust across most markets. Tweaking them for perfect backtest results often leads to curve-fitting. Stick with 14 period and ±100 levels unless you have a strong reason to change.
  6. Check symbol availability: Before going live, run the EA on a demo account for a few hours to ensure all symbols in your list are available and tradeable. Some brokers restrict certain pairs for EAs.

Quick Start Guide

Follow these steps to get started in under 5 minutes:

  1. Attach to any chart: Open any currency pair chart (EURUSD works fine). Drag the EA onto it. The chart timeframe doesn't matter — the EA scans its own timeframes.
  2. Enter your symbols: In the SYMBOLS input, type the pairs you want to scan, separated by commas. Example: "EURUSD,GBPUSD,USDJPY,AUDUSD". Make sure they match your broker's naming exactly.
  3. Set your CCI period: Leave the default 14. This is the standard period used by most traders and works well across all timeframes.
  4. Choose your entry strategy: Start with ENTRY_STRATEGY6 (zero-line cross). It's the simplest and most intuitive — buy when CCI goes above zero, sell when it goes below.
  5. Configure risk: Set Lot Size to 0.01 (micro lot). Set SLTP_MODE to PIPS. Set STOPLOSS

    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