Dual CCI Indicator Forex Trend Strategy

Feb 19, 2021

The Commodity Channel Index (CCI) is an underrated momentum indicator that is often overshadowed by the RSI and MACD.
I’ll show you how to build a simple trend following strategy using a pair of CCI indicators!
The complete strategy can be downloaded in the Free Strategies section.

The CCI indicator was invented by Donald Lambert in 1980 to detect cyclical turns in commodities, and has since become one of the most popular momentum indicators.

In essence, it measures the current price relative to an average price over a given lookback period. Unlike most indicators, the CCI uses typical price instead of closing price. Some feel that typical price (TP), calculated as (high+low+close)/3, is more representative of price action. 

The formula for a default 20-period CCI is:

The mean deviation is calculated as follows:

With the 20-period lookback, Lambert selected a 0.015 constant for the denominator such that the CCI would fall within the ±100 range 70-80% of the time.

Shorter lookbacks will produce a more volatile CCI, with the indicator often exceeding the ±100 range. Unlike the RSI and Stochastic oscillators, the CCI is unbound, meaning there is no minimum or maximum CCI value.

How Do Traders Use the CCI Indicator?

1. Detecting Overbought/Oversold Conditions

With shorter lookback periods, the CCI is most commonly used as an overbought/oversold indicator.

The CCI +100 level is usually used to indicate an overbought condition, while -100 indicates an oversold condition.

The chart below shows the 20-period CCI applied to the USDCAD, a mostly ranging market.

2. Trend Detection

When a longer lookback period is used, the CCI can be used to detect trends. Values above +100 indicate an uptrend, while values below -100 indicate a downtrend.

Lookback periods in the 60-100 range are generally good for trend detection. I do not recommend anything below 50 for the CCI since it is particularly reactive to price changes.

The chart below shows the 80-period CCI indicating an uptrend in the GBPJPY.

The Dual CCI Trend Strategy

We need a way to exploit both of the CCI’s uses above.

How about a trend following strategy that enters the market on a short-term pullback?

An 80-period CCI will be used for trend detection. We’ll throw in a 5-period CCI to detect short-term overbought/oversold conditions during pullbacks. In this context, the CCI is also being used as a pullback filter.

So a long signal will occur when the 80-period CCI is above +100, and the 5-period CCI is below -100. Rules are symmetrical for the short side.

Wait, what if the pullback eventually turns into a trend reversal? Don’t catch a falling knife!

Since we want to focus on trends that display signs of continuation, we will place buy stops at the previous bar’s high. Sell stops will be placed at the previous low.

The strategy’s pseudocode is as follows:

IF the 80-period CCI is above +100
AND the 5-period CCI is below -100,

THEN Place a buy stop at the previous bar’s high. Order is valid for 3 bars. 

Rules are symmetrical on the short side.

I try not to overthink trade management when it comes to trend following strategies. Most successful trend strategies do not use much management; they simply let the trend run till it reverses.

I’ll just use a 200-pip stop loss and trailing stop for trade management.

The CCI strategy was programmed in AlgoWizard as shown:

Dual CCI Trend Strategy Results

I did a 10-year backtest on my favourite trend following market, the GBPJPY.

Seems like the CCI was put to good use! Results are decent for a single-indicator strategy.

Out of curiosity, I decided to optimize the long-term CCI’s lookback period. The lookback period of the entry indicator usually has the largest impact on strategy performance.

I optimized the lookback period from 20 to 200, in steps of 1.

It is encouraging that all 181 optimizations are profitable, and that the average profit is over 9000 pips. This indicates that the strategy parameters are likely stable.

With net profit as the performance metric, the 80-period lookback seems to be in the middle of a high plateau.

This confluence with the optimization results gives me confidence that the strategy is logically sound. In other words, the 5 and 80-period CCIs are likely effective at detecting pullbacks in long-term trends.

Wrapping Up

The versatile CCI deserves a place in the trader’s toolbox. It can be used to detect both trends and pullbacks; all you need to do is vary its lookback period.

One downside of the CCI is its high reactivity to prices. It’s common to see the CCI move from -100 to +100 within a few bars. To combat this, you may choose to apply a smoothing function to the CCI. I have found success using a 5-period SMA of the CCI.

The completely strategy can be downloaded in the Free Strategies section.

Powered By

Development Platform

Forex VPS

FXVM Forex VPS

Popular Posts

Laguerre RSI Trend Following Strategy

The Laguerre RSI attempts to improve the responsiveness of the regular RSI, whilst keeping whipsaw trades to a minimum. Let’s see how well it detects short-term pullbacks for a trend following strategy!

read more

What is Fixed Ratio Money Management?

Have you heard of fixed ratio money management? How does it compare to the popular fixed fractional approach? Here I’ll explain how fixed ratio works, and see how it stacks up against fixed fractional money management.

read more

Build a Diversified Portfolio With QuantAnalyzer

The ability to efficiently trade a diversified portfolio of strategies is one of the biggest advantages of algorithmic trading. Here we will use QuantAnalyzer’s Portfolio Master to build a portfolio consisting of high performing, uncorrelated strategies.

read more

What Is the QQE Indicator?

The QQE is a mysterious indicator that sometimes pops up in trading forums. Does it deserve a place alongside the more traditional momentum indicators like the RSI and CCI? Let’s add it to a trend following strategy to find out!

read more

Make your money work for you!

Get promotions, trading ideas and strategy development tips delivered to your inbox!

Comments

7 Comments

  1. darrellgray100@yahoo.com

    GREAT STRATEGY. NEW AND EXPERIENCED TRADERS SHOULD BENEFIT FROM THIS STRATEGY. ALSO, CAN THIS STRATEGY BE USED ON ALL CURRENCY PAIRS AND TIME FRAMES?

    Reply
    • Wayne

      Hi Darrell, it’s very difficult to find a strategy that works well on all markets and timeframes. The strategy needs to suit the character of the market. In this case, your best bet is to trade a trending market on the higher timeframes.

      Reply
    • joomuatng

      thank you for providing the video. i am still learning how to do forex trading, profitably.

      i have questions on your strategy’s entry condition.

      for long entry, why not CCI (80) > +100 and CCI (5) crossover -100?

      is it because of the difficulties in writing the algorithm?

      If I use the entry condition
      CCI (80) > +100 and CCI (5) crossover -100,

      will it works similarly like yours?

      Reply
  2. Anonymous

    This is excellent for accurate price action

    Reply
    • Wayne

      Thanks, I agree!

      Reply
      • joomuatng

        thank you for providing the video. i am still learning how to do forex trading, profitably.

        i have questions on your strategy’s entry condition.

        for long entry, why not CCI (80) > +100 and CCI (5) crossover -100?

        is it because of the difficulties in writing the algorithm?

        If I use the entry condition
        CCI (80) > +100 and CCI (5) crossover -100,

        will it works similarly like yours?

        Reply
        • Wayne

          I replied in the Youtube video, please have a look.

          Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

Trading Strategies

What’s the Best Time to Trade Forex?

What’s the Best Time to Trade Forex?

The forex markets are open 24/5, but not all hours are created equal. Here I dissect my broker data to determine the best time to trade forex.

Forex Weekend Gaps: Can You Exploit Them?

Forex Weekend Gaps: Can You Exploit Them?

Have you noticed that forex weekend gaps usually reverse within 3 days? Here I’ll program a mean reversion strategy to exploit gaps over the last 18 years!

Money Flow Index: An Improved RSI?

Money Flow Index: An Improved RSI?

The Money Flow Index is sometimes called the volume-weighted RSI. Can it outperform the RSI in this trend following strategy?

Automated Bollinger Bands Squeeze Forex Strategy

Automated Bollinger Bands Squeeze Forex Strategy

StrategyQuant’s BBWR indicator is the perfect tool to detect a Bollinger Bands squeeze. Here I explain how it’s calculated, and use it to program a breakout strategy for the AUDJPY!

Should You Use the Kelly Criterion for Forex Trading?

Should You Use the Kelly Criterion for Forex Trading?

The Kelly criterion is a famous mathematical formula that attempts to maximize your long-term capital growth. In this post, I’ll apply it to a EURUSD breakout strategy and explain some of its potential shortcomings when applied to forex trading.

Can a Trading Pause Improve Your Trend Following Results?

Can a Trading Pause Improve Your Trend Following Results?

A temporary trading pause can improve your win rate if you’re trend following a volatile market. Here I’ll program a trading pause into a simple breakout strategy, and test its effectiveness on the Widow Maker – the GBPJPY.

Laguerre RSI Trend Following Strategy

Laguerre RSI Trend Following Strategy

The Laguerre RSI attempts to improve the responsiveness of the regular RSI, whilst keeping whipsaw trades to a minimum. Let’s see how well it detects short-term pullbacks for a trend following strategy!

How to Use the Supertrend Indicator

How to Use the Supertrend Indicator

Despite its cool name, the Supertrend indicator often seems to slip under the radar. Here I explain how it’s calculated, and combine it with moving averages to produce a simple trend following strategy.

Strategy Development

Do You Know Your System Quality Number?

Do You Know Your System Quality Number?

The System Quality Number measures the profitability & consistency of your trading system. Here’s how to calculate your SQN and use it to improve your trading!

How to Get a Realistic Backtest Spread

How to Get a Realistic Backtest Spread

Your choice of backtest spread can certainly make or break a strategy. This post will show you how to study the intraday spread variations of your market, and suggest several ways to avoid paying ridiculous spreads.

Do You Know Your Strategy’s Optimization Profile?

Do You Know Your Strategy’s Optimization Profile?

Your strategy’s optimization profile often reveals its robustness, helping you select strategies that will remain profitable in live trading. Here I explain why an optimization profile is important, and how you can easily obtain one using StrategyQuant’s optimizer.

Which MT4 Backtest Report Metrics Should You Use?

Which MT4 Backtest Report Metrics Should You Use?

Understanding your backtest report is an essential part of being a successful strategy developer. Here I explain what the numbers mean, and how you can make use of each metric during strategy development.

Out-of-sample Testing Using Monte Carlo Simulations

Out-of-sample Testing Using Monte Carlo Simulations

Traders often use Monte Carlo simulations to estimate worst-case drawdowns, but did you know they can be used for out-of-sample testing too? This post demonstrates the use of StrategyQuant’s Monte Carlo simulator to randomize historical prices and strategy parameters, helping you select robust strategies for live trading.

How Many Trades Should Your Backtest Have?

How Many Trades Should Your Backtest Have?

We all want a large sample of trades in our backtests, but practical limitations such as data availability often get in the way. Here I’ll explain why 30 trades is insufficient, and how you can use standard error to quantify the uncertainty arising from a small sample size.

Build a Diversified Portfolio With QuantAnalyzer

Build a Diversified Portfolio With QuantAnalyzer

The ability to efficiently trade a diversified portfolio of strategies is one of the biggest advantages of algorithmic trading. Here we will use QuantAnalyzer’s Portfolio Master to build a portfolio consisting of high performing, uncorrelated strategies.

Strategy Optimization Using MT4

Strategy Optimization Using MT4

How do you improve your trading strategy in MT4? This post will show you how to optimize the entry and exit parameters for a moving average crossover strategy. Finally, an intraday time filter will be added to help avoid false breakouts.

Debugging & Backtesting Using MT4

Debugging & Backtesting Using MT4

With a fresh algorithm at your fingertips, how do you verify that it has been programmed correctly? This guide will show you how to use Metatrader 4’s visual backtester to debug and backtest your strategy.

Create Your Trading Algorithm in 15 Minutes (FREE)

Create Your Trading Algorithm in 15 Minutes (FREE)

Converting your trading idea into an algorithm is the first step towards reaping the benefits of automated trading. This guide will cover the creation of a simple moving average crossover algorithm, without any actual programming.

What Is Drawdown in Trading?

What Is Drawdown in Trading?

Are you getting a comprehensive assessment of your strategy’s downside? This post will discuss several methods to measure drawdowns, helping you build and select strategies that better suit your risk appetite.

Live Trading

What’s the Best Time to Trade Forex?

What’s the Best Time to Trade Forex?

The forex markets are open 24/5, but not all hours are created equal. Here I dissect my broker data to determine the best time to trade forex.

How to Find a Real Trading Guru

How to Find a Real Trading Guru

Every day I come across a trading guru offering educational content on the internet. Many of them speak of huge returns with minimal effort. Should these be trusted? Here’s some tips on how to separate the wheat from the chaff.

How to Enjoy Stress-Free Trading

How to Enjoy Stress-Free Trading

Trading is a great way to make some additional income, but not if you’re constantly pulling your hair out. Here I offer 7 tips to help make your trading profitable and stress-free.

How to Select the Best Forex VPS

How to Select the Best Forex VPS

A virtual private server (VPS) is a virtual computer that you can rent and access remotely. It provides a reliable platform on which to execute your forex strategies. This post will help you decide whether you need a VPS, and show you how to select an optimal VPS.

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Pin It on Pinterest

Share This