This idea is from Technical Analysis of Stocks & Commodities (TASC) magazine’s website. This is the second in a series of three system ideas that TASC features on their website. This system uses CCI, or Commodity Channel Index, which is an indicator that shows when the market may be overbought and oversold. This indicator was developed by Donald Lambert in 1980. As the name suggests, it was originally designed for commodities, but it has been used in equities, currencies, and other financial instruments.
The rules they provide are somewhat vague, since CCI is used in various ways by traders:
For this system, all CCI numbers from 2 to 100 were tested over a lookback period of 500 days. Buy signal is triggered when CCI reaches -100. Sell signal is triggered when CCI reaches +100. Tested on daily price data.
I interpret these rules to be as follows:
- Optimize the CCI Length from 2 – 100
- Buy when CCI crosses over -100 (moving up)
- Sell when CCI crosses under 100 (moving down)
The first TASC system I tried, the Optimized Moving Average, bombed. One of the difficulties I had was trying to replicate the results on traders.com. Without knowing the start dates for optimization and trading, it was nearly impossible. My goal here is to see if this idea works at all, irrespective of the results on their site
Phase 1: Plan & Design
1. Trading Idea
The idea is simple:
- Buy when the CCI indicates we are moving out of the oversold area
- Sell short when the CCI indicates we are moving out of the overbought area
- This is an ‘always in’ system
CCI length will be optimized. I will be looking for the ideal in-sample/out-of-sample periods, between 200 to 500 trading days. There are no stop losses or profit targets.
I will only test on equities, as their system does.
2. System Definition
I will use the following position sizing:
- Stocks/equities: # shares = $10,000 / Close price, rounded down
- If CCI crosses over -100
- Buy next bar at market
- If CCI crosses under 100
- Sell short next bar at market
- Profit targets: None
- Stop Loss: None
I will use the following parameters:
This system is pretty easy to develop.
3. Performance Objectives
The system will meet the following objectives:
|System Type (trend, mean-reversion, day, swing, etc.)||Trend following|
|Walk-forward Efficiency||> 50%|
|Risk of Ruin||0%|
|Profit Factor||>= 1.5|
|Win Percent||>= 30%|
|Max Drawdown %||< 35%|
|Profit/Drawdown Ratio||>= 2.0|
I added Walk-forward Efficiency, as I am finding this to be a useful measure of the effectiveness of the optimized values. 50% may be too low, but I need to start somewhere with this.
This idea is S.M.A.R.T.: Specific, Measurable, Achievable, Realistic, Time-bound
4. Market Selection
|Equities||Random equities from S&P||CAT, CL, COP, CPB, CVS, CVX, D, DE, DHI, DHR, DRI, DTE, ED, EIX, ES, ETN, ETR, EXC, F, FCX, FE, FITB, GD, GE, GLW, HAL, HBAN, HIG, HOG, HSY, HUM, IBM, IP, JNPR, K, KMB, KO, KR, KSS, L, LEG, LHX, M, MAR, MCK, MCO, MET, MKC, MMM, MO, MRK, MS, MSI, MTB||I picked a random selection of equities that have been active over the past 20 years.|
Chart Type, Timeframe, Session, Time Zone:
|Chart Type||Regular Candlestick||Charting is only useful for validating entry and exit signals|
|Timeframe / Interval(s)||Daily|
Phase 2: Build
5. Manual Test
I walked through some symbols and this worked well enough to proceed.
Sweet and simple.
7. Unit Test
The unit test went fine, and everything works as expected. I have a concern about when the CCI crosses over 100 or -100, generating a sell or buy signal, but then crossing back over the same line. It is possible to be on the wrong side of a trend and get stuck there. Below is an example of this phenomenon:
I do not have an answer for this since our rules are clear. The other cross-overs in this case is just whipsaw, but ultimately we are on the wrong side, at least for now.
Note: Unit Test verifies that the system is executing the trading rules correctly. It is, essentially, quality control.
Phase 3: Test
I optimized one input parameter:
- CCILength: range 2 to 100, step 1
9. Walk-Forward Analysis
None of the symbols passed, failing one or both of these two data points:
- Walk-forward Efficiency
- Profit Factor
Do you remember the Performance Objectives section, where I added Walk-forward Efficiency? Why did I do that? Let me explain why I am starting to think this is an important metric:
If Walk-forward Efficiency is 100%, that means that the out-of-sample testing results worked exactly as the optimized parameter(s) suggested they would. If it was 0%, then it was as effective as a monkey beating orders into our order entry application. 50% means the optimized parameters were right only about half the time. A coin flip, if you will.
I may be wrong about this, but I will continue to refine my thinking around this.
However, one instrument caught my eye MET (Metlife):
- It had a fairly steady equity curve
- It had the best Walk-forward Efficiency, at 46.3%
- Profit Factor: 1.91
I am going to advance this to Monte Carlo to see what it looks like. I think it will perform well, given its past performance.
10. Monte Carlo Simulation
This is how MET performed in Monte Carlo simulation:
One of my objectives is to have a Risk of Ruin at 0% for a given system, which is very strict, but it is what I require. Although the Median Return and Return to Drawdown ratio is very good, it still does not meet my criteria and does not advance to the next.
Is this untradable? No. I could probably trade it and make money with it, but it did not meet my Risk of Ruin goal, so it does not advance to incubation.
We did not make it this far. I ran MET through incubation anyhow, and it is +$400 (marked-to-market) for the past 6 months, but the current position is in a -$2,300 drawdown.
Phase 4: Deploy
We did not make it this far.
Notes and Commentary
Another TASC system failed to pass through our development process. I believe the issue I uncovered in Unit Testing shows the main weakness of the system. I have learned from experienced systems traders, those working at successful hedge funds and CTA’s (Commodity Trading Advisor), that simple systems are the best. My best system has one entry rule and two exit rules. This system is a little too simple.
MET is a good example of this. Over a six week period in 2021, February to March, the CCI oscillated around the 100 line (using the optimized CCI Length of 21), all while being stuck in a short position since January.
You can see there were six signals to go short (blue line), but the instrument was in a consolidation phase. The red line, a 9 period moving average of the CCI, is given for reference.
Can this system be improved? Perhaps. Here are some ideas for future systems:
- Use a moving average or other smoothing method on CCI to reduce the choppiness; John Ehlers developed an Adaptive CCI which I will consider using
- Use a stop-and-reverse method when caught on the wrong side
- Use a stop, such as ATR, to determine when we are caught on the wrong side and stay flat until the next signal
- Try it on futures or forex
That is all for this system. One big takeaway is that you cannot just take someone else’s system idea and start trading it. Algorithmic, quantitative, and systematic trading allows us to see if an idea is valid with a certain amount of confidence. A system may work for 6 months, 1 year, or two years. I am looking for system robustness. MultiCharts, one of my trading platforms, has a great walk-forward feature that measures system robustness, based on user-selected metrics (fitness functions such as profit factor, drawdown, etc.). It simply gives a pass/fail grade, which I have found to be very helpful. We are looking for robustness, something that we expect to perform well over a very long time.
I sincerely thank you for taking the time to read this article. If you want to stay informed about each new trading idea I test, subscribe to my semimonthly newsletter (below). If you have an idea you would like to build and test, feel free to leave a comment or reach me on the Comments page and we can discuss.
Next trading idea: Connors RSI 2 – RSI mean-reversion revisited…you will not want to miss this one!
Trading System Result: FAIL
Did you like what you read? Do you want to see more? Subscribe now and receive our email twice per month, with a new Trading System Idea of the Week and other fun stuff.
Don’t worry, we will never, ever, ever sell, overuse, or donate your email address. Promise.