ATMResearch
Join Overfit - free
Overfit cover card on a flat dark gradient, kicker 'CCI trading strategy': the headline 'The default CCI ranked 118 of 193 on ES.' over the line '672 settings, long and short, next-open fills', with a corner badge reading 'SPY and ES'.
  1. Overfit/
  2. Research/
  3. CCI Trading Strategy: 672 Settings Tested on SPY and ES, and Where the Default Ranks

June 13, 2025

CCI Trading Strategy: 672 Settings Tested on SPY and ES, and Where the Default Ranks

Share

7 min read

Written by Ali Casey, founder of StatOasis and AlgoChef, creator of the Algo Trading Masterclass (ATM), with over 10 years of experience building systematic trading tools - building algorithmic strategies, testing ideas with data, and teaching traders how to build structured, portfolio-based trading workflows.

Published June 13, 2025 · Updated October 28, 2026 · Method

← Back to Research
Table of contents▾
  • TL;DR: the answer box
  • What is the CCI indicator, and how did I test it?
  • Where does the default CCI setting rank?
  • Does the side matter more than the setting?
  • What are the best CCI indicator settings?
  • Which is better, RSI or CCI?
  • Do CCI signals beat a random entry?
  • The verdict, and the honest limits
  • What this means for you
  • Reference tables
  • Methodology
  • FAQs

The short version

The textbook CCI setting is CCI(20): buy below -100, short above +100. I tested it against 672 CCI settings on SPY since 1994 and ES futures since 2006. The default long rule beat 83.0% of reliable long settings on SPY, but only 38.9% on ES. A faster CCI did better on both. The short side lost on both. And a plain RSI(2) rule beat all but 6 of 223 reliable long CCI settings on SPY, and all but 7 of 193 on ES.

TL;DR: the answer box

  • The default is good on SPY and ordinary on ES. CCI(20), buy below -100, sell 5 bars later: a Ret/DD of 3.99 on SPY (rank 38 of 223) and 1.31 on ES (rank 118 of 193).
  • Pick the side before the setting. On SPY, 269 of 336 long settings made money. Only 30 of 336 short settings did. On Euro FX and yen futures it flipped toward short.
  • A fast CCI beat the default. CCI 5 to 14, bought below -50 to -150: a median Ret/DD of 4.88 on SPY and 2.75 on ES, across 27 settings.
  • Buying the drop beat chasing the rise. Of four rule types, "buy while CCI is below the line" scored highest on both markets.
  • On SPY and ES, RSI(2) below 10 beat almost every reliable long CCI setting. Ret/DD 7.34 on SPY and 4.82 on ES, same exit. Only 6 of 223 reliable long CCI settings on SPY scored higher, and 7 of 193 reliable ones on ES.
  • Few comparable long CCI settings beat luck. Against a random long entry, 9 of 27 long hold-5 settings with a similar trade count cleared the bar on SPY. On ES, 0 of 28.

What is the CCI indicator, and how did I test it?

The Commodity Channel Index is Donald Lambert's indicator. It measures how far today's price sits from its own recent average. Above +100 is called "overbought". Below -100 is called "oversold". The number in brackets is how many days it looks back, and 20 is the textbook default.

I tested four ways to turn it into a buy signal. Two fade the move, and two follow it.

Four rule types, one line: two buy the drop, two buy the rise.

The test. I ran all four rule types, long and short. Seven lengths, from 5 to 50. Five levels, from 50 to 250. Three holds: sell 3, 5 or 10 bars later. That is 672 settings per market.

The markets. SPY from 1994, on a $35,000 account in whole shares. ES (E-mini S&P 500 futures) from 2006, one contract. And two currency futures, Euro FX (6E) and Japanese yen (6J), from 2002. All to 2026-08-20.

The fills: Execution rule v2. The signal is read at the close. The trade buys the next open, and the exit sells at an open too. You can't trade a close you have not seen yet.

The scores, in plain words:

  • Drawdown: the biggest drop from a high point.
  • Ret/DD: net profit divided by the biggest dollar drawdown. Profit per dollar of pain. Higher is better.
  • Reliable: a setting with 100 trades or more. Only these get ranked.

Here is one default trade, the one closest to the median profit of all 355.

CCI(20) closed at -153.6. The trade bought the next open and sold 5 bars later for $100.

CCI(20) closed at -153.6 on 2013-06-05. The rule bought the open of 2013-06-06 at 161.20 and sold the open of 2013-06-13 at 161.66. $100. Not the best trade. The typical one.

Where does the default CCI setting rank?

High on SPY. Below the middle on ES. If you trade futures, that gap matters.

The same rule beat 83.0% of settings on SPY and 38.9% on ES.

On SPY the default long rule made $50,574 on 355 trades. Its worst drawdown was $12,690. It won 54.9% of trades, a Ret/DD of 3.99. On ES it made $62,788, but its worst drawdown was $47,925. Same rule, same index, a much worse rank.

Now compare it with what you could have traded instead.

Small changes flip the result. Wait for the cross back up and the default loses money.

The short side lost on both. 610 SPY shorts, a 39.5% win rate, -$34,224.

One small change broke it. Buy when CCI(20) climbs back over -100 instead of closing below it. The SPY Ret/DD drops from 3.99 to -0.38. On ES, from 1.31 to -0.51. Same indicator, same level, a different trigger.

Does the side matter more than the setting?

Yes. Before you tune a length, pick your side. On SPY, 269 of 336 long settings made money before costs. Only 30 of 336 short settings did.

Long won on the S&P 500. Short won on both currencies.

On the S&P 500, four in five long settings made money. About one in ten short settings did. After costs it was 261 long and 23 short on SPY.

On the two currencies it flipped. On Euro FX, 212 of 336 short settings made money and 100 long. On the yen, 235 short and 82 long. Some markets reward one side far more than the other.

Is the currency short bias real?

Over the full test, yes. But it was not steady.

On Euro FX the short side only took over after 2014.

On Euro FX from 2002 to 2014, more level-rule settings made money long (47 of 105) than short (24). From 2014 to 2026, short won 92 to 17. On the yen, short led in both halves, 71 to 40 and then 94 to 12. A long yen contract gains when the yen rises against the dollar, so these shorts were bets on the dollar.

That is the warning for a one-sided system built on one era. A bias found on one stretch of history can be the stretch, not the market.

What are the best CCI indicator settings?

A fast CCI, length 5 to 14, bought below -50 to -150. A region, not a single cell. I read it off the SPY results and checked it on ES.

Think of the settings as a pivot table: CCI length down the side, buy level across the top, and the score in each cell.

On SPY the fast region's cells ran from 3.26 to 7.48. The default scored 3.99.

On SPY, across all three holds, the 27 region settings had a median Ret/DD of 4.88. 18 of 27 beat the default. The deep levels, -200 and -250, mostly had too few trades to judge.

On ES every fast-region cell at hold 5 scored above the default's 1.31.

ES is the real check for you, because I did not pick the region from it. There, 24 of 27 region settings beat the default, with a median Ret/DD of 2.75. 26 of 27 stayed profitable after costs, on SPY and on ES.

Did it last? I split each test in half by time.

The region held steady across both halves. The default faded in the second half.

The region held: 2.91 and 2.88 on SPY, 1.88 and 2.03 on ES. The default faded, from 3.45 to 1.42 on SPY and from 1.88 to 0.47 on ES.

Don't chase the top cell. The best single SPY setting scored 8.99. It is the top of 336 long settings on SPY, picked on the same data it is scored on, so I report it but do not use it. Researchers measure that risk as the probability of backtest overfitting. I learned that the expensive way: I lost roughly $270K early on, over years of overfitting and leverage. The best ES cell was a different rule entirely, a CCI(30) breakout. Two markets, two different winners.

Does a longer CCI period cut whipsaws?

It cuts trades. It does not give you the best score. For a higher Ret/DD on these SPY and ES longs, go faster, not slower.

CCI(5) led on both markets: 4.59 on SPY and 3.26 on ES.

On SPY, moving from CCI(20) to CCI(40) cut the median trade count from 207 to 176, 15.0% fewer. The median Ret/DD rose from 3.09 to 4.09. So the longer setting did beat CCI(20). But going faster did better: CCI(5) scored 4.59 on SPY and 3.26 on ES.

Should you fade CCI or follow it?

For long trades on SPY and ES, fade it.

Buying while CCI sat below the line beat the other three rule types on both markets.

The level rule had a median Ret/DD of 3.70 on SPY and 2.32 on ES. The zero-line cross, a common trend entry, scored 0.94 and 1.08.

Which is better, RSI or CCI?

RSI(2), by a clear margin, for long trades on SPY and ES. RSI is another 0 to 100 score of recent up and down days, and RSI(2) looks back just two days. I ran it with the same next-open fills and the same 5-bar exit.

Every RSI(2) level tested beat both the CCI default and the fast CCI region's median.

RSI(2) below 10 took 405 SPY trades. It won 61.0% of them, with a Ret/DD of 7.34 and $88,289 profit. The CCI default: 3.99 and $50,574. On ES, RSI(2) below 10 scored 4.82 against the default's 1.31.

Only 6 of 223 reliable long CCI settings on SPY beat RSI(2) below 10. On ES, 7 of 193. Every RSI(2) level from below 5 to below 30 beat the CCI region's median on both markets. That median mixes holds of 3, 5 and 10 bars.

Do CCI signals beat a random entry?

On SPY, a third of comparable settings do. On ES, none.

This is the test that matters most, and you can run it on any setting you plan to trade. On SPY, a random long held 5 bars earned 0.199% on average, so a buy signal has to beat that drift. So I built a random long entry that sells 5 bars later the same way, over 10 seeds. It takes as many trades as the typical setting: 288 on SPY and 190 on ES. I then compared only the settings within 25% of that count. Random entries made $15,026 on SPY and $27,578 on ES. The luck bar is that average plus two spreads: $35,223 on SPY and $133,381 on ES.

On SPY 9 of 27 settings cleared the luck bar. On ES none of 28 did.

On SPY, 9 of 27 comparable settings cleared it. On ES, 0 of 28. On the currencies the short side looked thin too: 0 of 21 Euro FX short settings cleared their own random bar, and 2 of 27 on the yen.

And buy and hold? It made far more.

Buy and hold made $518,686. The default CCI rule made $50,574, with a worst drop of $12,690.

Buy and hold SPY made $518,686 on the same $35,000. Its worst fall was 56.45%. The default CCI rule made $50,574, with a worst drop of $12,690. The rule also sat out most of the time: it held a position on 21.7% of days.

The default rule held a position on 21.7% of days.

The verdict, and the honest limits

Where the old CCI advice holds up. Two textbook CCI rules lost money on SPY and ES. The default short side lost on both S&P 500 markets. The cross-back version of the default long rule lost too. And the side matters more than the setting.

Where it goes too far. A tuned CCI is not "a winning edge" by default. On ES, no comparable CCI setting beat the random bar. RSI(2) below 10 beat the CCI default on both markets. And the currency short bias on Euro FX only showed up after 2014.

The limits:

  • British Pound futures were not tested. My 2025 CCI work used them, and I have no data for them here. Euro FX and yen are different markets.
  • The fast region was picked on SPY. ES and the two halves are the checks.
  • RSI(2) did not win everywhere. On Euro FX longs, 185 of 204 reliable CCI settings beat RSI(2) below 10.
  • No stop loss. The biggest single loss on one ES contract with the default was -$25,888.
  • Costs are left out of the headline figures. 26 of the 27 region settings stayed profitable after costs, on SPY and on ES.
  • Daily bars, time exits only. No trailing stops.
  • A backtest is not a live edge. It is the best evidence about the past.

What this means for you

  1. Decide the side first. On the S&P 500, CCI longs made money in four of five settings. Shorts made money in one of ten.
  2. Buy the stretch, not the cross back. CCI(20) below -100 scored 3.99 on SPY. Waiting for the cross back scored -0.38.
  3. Go faster than the default. CCI 5 to 14, bought below -50 to -150, beat the default in 18 of 27 settings on SPY and 24 of 27 on ES.
  4. Test it against RSI(2) before you commit. Only 6 of 223 reliable long CCI settings on SPY beat RSI(2) below 10.
  5. Judge a region, not a cell. Put the trade lists of a few neighbouring settings into AlgoChef and check they behave alike before real money goes on the one that led the sweep.

CCI isn't dead. Long and fast, it held up on the S&P 500. Its default and its fast region's median trailed every RSI(2) level I tested, and on ES no comparable setting beat luck.

Reference tables

For readers who want the detail behind the charts.

Table 1. The default, CCI(20) at +/-100, sell 5 bars later

MarketSideTradesWin rateNet profitMax drawdownRet/DDProfit factorRank by Ret/DD
SPYlong35554.9%$50,574$12,6903.991.4438 of 223
SPYshort61039.5%-$34,224$38,320-0.890.77115 of 216
ESlong21259.0%$62,788$47,9251.311.22118 of 193
ESshort40341.4%-$86,488$112,162-0.770.75111 of 196

Profit factor: dollars won for each dollar lost. Execution rule v2, next-open fills, no costs. SPY $35,000 in whole shares, ES one contract.

Table 2. The fast region: level rule, CCI 5 to 14, buy below -50 to -150, all three holds

SPYES
Settings2727
Median Ret/DD4.882.75
Lowest to highest Ret/DD0.00 to 8.99-0.33 to 6.40
Median trades437268
Profitable after costs26 of 2726 of 27
Beat the default18 of 2724 of 27

Table 3. The sweep

SettingValues
Rule typelevel, cross back, breakout, zero line
CCI length5, 10, 14, 20, 30, 40, 50
Level50, 100, 150, 200, 250 (not used by the zero line)
Hold3, 5, 10 bars
Sidelong and short

672 CCI settings per market, plus 12 RSI(2) rows: 2,736 backtests across SPY, ES, 6E and 6J.

Everything here is research, not investment advice. It is a backtest on historical data with the assumptions stated above. It is not a recommendation to buy or sell anything, and past results do not predict future ones.

Want the next study when it is finished, including the ones that overturn something I believed? That is what the newsletter is for: StatOasis.com/Overfit

Methodology

Data source
Daily bars from TradingView exports: SPY (price only), and E-mini S&P 500 (ES), Euro FX (6E) and Japanese yen (6J) continuous futures, back-adjusted by the additive method so point changes are exact. CCI from engine.oscillators.cci (Lambert's definition, mean absolute deviation) and RSI(2) from engine.oscillators.wilder_rsi, both admitted engine indicators.
Date range
SPY 1994-02-01 to 2026-08-20 (32.55 years, 8,192 bars); ES 2006-01-03 to 2026-08-20 (20.63 years, 5,210 bars); 6E and 6J 2002-02-01 to 2026-08-20 (24.55 years, 6,217 bars each). Indicators warm up on earlier bars. Halves split each window at its middle bar.
Entry / exit rules
Four CCI rule types, long and short: level (buy below -T, short above +T), cross back (buy on a cross back up through -T, short on a cross back down through +T), breakout (buy on a cross up through +T, short on a cross down through -T) and zero line. Every trade fills at the next open after the signal close and exits at the open 3, 5 or 10 bars after entry. No stop, no target. Default: CCI(20) at +/-100, hold 5.
Sizing
SPY $35,000 in whole shares, no compounding; futures one contract (BigPointValue ES 50, 6E 125,000, 6J 12,500,000). Frictionless headline figures; every row also carries a costed net profit under the engine's atr-handbook-2026-09-24 schedule (futures $4.00 a round turn plus one tick a side; SPY $0.005 plus $0.01 a share a side).
Overlap mode
Flat-only within each setting: one position at a time; a setup while a position is open is ignored, including on the bar the exit order is placed (Execution rule v2).
Look-ahead
Every signal is read at a bar's close and every trade fills at the next bar's open. A cross compares the signal close with the close before it. No later bar decides an earlier trade.
Minimum sample
50 trades for the honesty baselines (the engine default). Rankings count a setting as reliable at 100 trades or more.
Buy-and-hold benchmark
Each market held over the same window. SPY on $35,000: $518,686.16 net, CAGR 8.85%, worst drawdown 56.45% (2009-03-09). ES one contract: $286,837.50 net, CAGR 11.36%, worst drawdown 97.57% (2009-03-09). Computed by tools/controls_report.py.
Random control
Seeded random entries, exits at the open under Execution rule v2, 10 seeds from base seed 20260803. Long controls matched to the study's median variant (SPY 271 entries, ES 182, 5-bar hold): net SPY $17,795.29 (sd $9,600.15), ES $61,992.50 (sd $26,288.96), computed by tools/controls_report.py. The article's comparison uses per-side controls matched to the median reliable hold-5 setting (SPY long 288 entries, ES long 190), computed in the facts sheet with the same engine function.
Parameter scopeParameters swept

The study searched the parameter space and reports the spread, not one tuned setting.

2,736 backtests: per market, 672 CCI settings (7 lengths, 5 to 50; 4 rule types; 5 thresholds, 50 to 250, not used by the zero line; 3 holds; long and short) plus 12 RSI(2) comparison rows. The default CCI(20) at +/-100, hold 5, was fixed before the run. The fast region (CCI 5 to 14, thresholds 50 to 150, level rule) was read off the SPY results, so on SPY it is in sample; ES, the halves and the currencies are the checks. The single best cells are reported and not used.

Run to v1 of the StatOasis research standard - the rules every study here has to meet before it is published. The version is the study's own: a standard that gained a rule later never reaches back and claims this one met it.

Historical backtest results are not a guarantee of future returns. This content is for educational purposes only and is not investment advice. Hypothetical performance disclosure (CFTC Rule 4.41).

Frequently asked questions

What is the best setting for the CCI indicator?⌄

On SPY and ES daily bars, long only, a fast CCI did better than the default: length 5 to 14, bought below -50 to -150. It is a region, not one magic number. I picked it from the SPY results and checked it on ES. Those 27 settings had a median Ret/DD of 4.88 on SPY and 2.75 on ES. The default CCI(20) below -100 scored 3.99 and 1.31. The single best cell on SPY scored 8.99, but it is the top of 336 long settings on SPY, so I don't use it.

Does a CCI trading strategy actually work?⌄

Long, on the S&P 500, most settings made money: 269 of 336 long settings on SPY and 267 of 336 on ES, before costs. Beating luck is a harder test. Against a random long entry with the same 5-bar exit, 9 of 27 comparable long CCI settings cleared the bar on SPY, and 0 of 28 on ES.

Which is better, RSI or CCI?⌄

For long trades on SPY and ES, RSI(2). With the same next-open fills and the same 5-bar exit, RSI(2) below 10 scored a Ret/DD of 7.34 on SPY and 4.82 on ES. The CCI default scored 3.99 and 1.31. Only 6 of 223 reliable long CCI settings on SPY, and 7 of 193 on ES, scored higher than RSI(2) below 10.

Is CCI better long or short?⌄

It depends on the market. On SPY, 30 of 336 short CCI settings made money, against 269 of 336 long settings. On Euro FX futures the split flipped: 212 of 336 short settings made money and 100 of 336 long. On Japanese yen futures, 235 short and 82 long.

Does a longer CCI period reduce whipsaws?⌄

It cuts the number of trades. On SPY, moving from CCI(20) to CCI(40) cut the median trade count from 207 to 176 for the level rule, 15.0% fewer, and lifted median Ret/DD from 3.09 to 4.09. But the fastest lengths did better still: CCI(5) scored 4.59 and CCI(10) 4.52.

What does the CCI indicator tell you?⌄

The Commodity Channel Index measures how far today's typical price, the average of the high, low and close, sits from its own moving average, scaled by how far price usually strays. A reading below -100 means price is unusually far below its recent average. On SPY, buying that stretch worked better than buying the cross back above it: a Ret/DD of 3.99 for the level rule against -0.38 for the cross back at CCI(20).

Read the Strategies, Backtested hub
← Back to Research

Table of contents

  • TL;DR: the answer box
  • What is the CCI indicator, and how did I test it?
  • Where does the default CCI setting rank?
  • Does the side matter more than the setting?
  • What are the best CCI indicator settings?
  • Which is better, RSI or CCI?
  • Do CCI signals beat a random entry?
  • The verdict, and the honest limits
  • What this means for you
  • Reference tables
  • Methodology
  • FAQs

Overfit - the newsletter

Skip the hype. Trust the data.One practical takeaway per issue.

Running a quick security check before this can be sent.

Delivered +2 times a month - when the work is ready, not on a calendar.I'll never sell your address.Unsubscribe in one click, any time.

Related Articles

Back to all research
#147

Mean Reversion: 40 Ways to Buy the Dip, and the 16 That Held Up

Nov 5, 2026 · 7 min read

Forty buy-the-dip entries tested on 33.5 years of SPY, 17,385 trades, every one measured against what entering on any day and holding as long paid. 35 of 37 rankable entries beat it. Then the window was cut into three periods: 16 held their edge, 11 decayed to under half, and only 4 of the top 10 held up.

Read more→
#155

Donchian Channel: What It Is, How to Trade It, and 900 Backtests on 15 Markets

Oct 29, 2026 · 9 min read

A Donchian channel is the highest high and the lowest low of the last N bars, with a middle line halfway between. I traded it both ways, as a breakout and as a fade, in 900 variants on 15 markets from 2004 to 2026. The breakout made money on the side each market drifted (283 of 300 variants) and rarely against it (43 of 300). Set beside random entries with the same exit, 111 of 900 variants beat the random 95th percentile per bar held.

Read more→

Overfit - the newsletter

Skip the hype. Trust the data.

One practical, evidence-driven takeaway per issue - strategy testing, portfolio construction, market structure, trading psychology, tactical asset allocation.

Running a quick security check before this can be sent.

Delivered +2 times a month - when the work is ready, not on a calendar.I'll never sell your address.Unsubscribe in one click, any time.

StatOasis is calm, evidence-based algorithmic-trading education, founded by Ali Casey. Ali builds systematic trading strategies and teaches the workflow behind them: research, build, test, combine, deploy. He writes the Overfit newsletter, published since 2024, and runs the Algo Trading Masterclass.

Socials

  • X ↗
  • YouTube ↗
  • Instagram ↗
  • LinkedIn ↗
  • GitHub ↗
  • Muck Rack ↗
  • LinkedIn SO ↗
  • GitHub SO ↗

Products

  • Overfit - the newsletter
  • Algo Trading Masterclass
  • StatOasis Community
  • 36 Ways to Buy the Dip
  • AlgoChef ↗

Reading & tools

  • Research
  • Methodology
  • Survive the Decade
  • Wall of Love

StatOasis

  • About Ali Casey
  • Contact
© 2026 StatOasis. Calm, evidence-based.
PrivacyTermsHypothetical resultsCalifornia