The strategy goes long when CCI(20) on typical price crosses above 100 and short when it crosses below -100. It exits when CCI returns through 0, with a 1% stop loss as protection. Only one position is open at a time and there is no profit target.
Best run of 16. Gold, 1 hour, spread 0.6, from run pf:2026-09-15-GOLD-1h.tsv:1.
| Period | Up to 2026-09-15 |
| Instrument | Gold, 1 hour |
| Spread | 0.6 points |
| Contracts | 1 |
| Starting capital | 1,000,000 |
| Costs | Spread only. Commissions and overnight financing are not included. |
| Bars | Up to 200,000 bars, fewer where the instrument has less history |
| Last tested | 2026-09-15 |
| positionSize Contracts per trade | 1 |
| cciPeriod CCI length | 20 |
| cciLongLevel Long when CCI crosses above this | 100 |
| cciShortLevel Short when CCI crosses below this | -100 |
| cciExitLevel Close when CCI falls back through this | 0 |
| stopLossPct Protective stop, percent of entry price | 1 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| GoldBest run | 1 hour | 1.08 | 6,065 | 32.04 | 2,101 EUR | -861 |
| DAX 40 | 1 hour | n/a | 5,832 | 32.36 | 578 EUR | -8,240 |
| Gold | 30 min | n/a | 10,308 | 30.24 | -1,030 EUR | -4,667 |
| Gold | 5 min | n/a | 10,214 | 28.83 | -3,305 EUR | -3,725 |
| Gold | 15 min | n/a | 10,126 | 27.92 | -3,985 EUR | -5,465 |
| S&P 500 | 1 hour | n/a | 6,573 | 30.17 | -8,105 EUR | -8,479 |
| S&P 500 | 30 min | n/a | 10,578 | 29.18 | -8,925 EUR | -10,914 |
| S&P 500 | 5 min | n/a | 10,276 | 27.13 | -9,427 EUR | -9,447 |
| S&P 500 | 15 min | n/a | 10,105 | 28.82 | -9,875 EUR | -9,932 |
| DAX 40 | 30 min | n/a | 10,080 | 29.97 | -15,728 EUR | -19,144 |
| Nasdaq 100 | 1 hour | n/a | 6,585 | 29.69 | -16,221 EUR | -16,309 |
| Nasdaq 100 | 15 min | n/a | 9,955 | 30.72 | -18,904 EUR | -19,692 |
| Nasdaq 100 | 30 min | n/a | 10,478 | 28.55 | -19,390 EUR | -23,058 |
| Nasdaq 100 | 5 min | n/a | 10,248 | 29.01 | -27,220 EUR | -27,275 |
| DAX 40 | 15 min | n/a | 10,057 | 29.70 | -28,696 EUR | -28,765 |
| DAX 40 | 5 min | n/a | 10,308 | 28.36 | -30,572 EUR | -30,769 |
Charts
The code
Every file in the library uses the same header, the same section order and the same variable names. The numbers above were produced by the original version before the rewrite, and the rewrite has not yet been compiled in ProRealTime.
// ============================================================ // CCI Breakout // ProRealAlgos Strategy Library | prorealalgos.com // Type: Momentum // Direction: Long & short // Timeframe tested: 1 hour // ============================================================ // --- Settings --- DEFPARAM CumulateOrders = false // --- Parameters --- positionSize = 1 // contracts per trade cciPeriod = 20 // CCI length cciLongLevel = 100 // long when CCI crosses above this cciShortLevel = -100 // short when CCI crosses below this cciExitLevel = 0 // close when CCI falls back through this stopLossPct = 1 // protective stop, percent of entry price // --- Indicators --- cciValue = CCI[cciPeriod](TypicalPrice)
25 more lines: the entry and exit rules.
Read this first
Questions
Yes, the rules are simple and use a percent stop that ProOrder supports. Given how many markets lost money, test it on demo before risking capital.
It was tested on Gold, DAX 40, S&P 500 and Nasdaq 100. Gold 1 hour made EUR 2,100.5 and DAX 40 1 hour made EUR 578.4, while Gold 30 minutes lost EUR -1,030.1 and the DAX 40 15 minute run lost EUR -28,696.3.
The best run on Gold had a max drawdown of EUR 861.22 with 1 contract. The DAX 40 1 hour run needed to sit through EUR 8,239.8 of drawdown to end up EUR 578.4 ahead.
On shorter charts the CCI crosses 100 far more often, and the extra trades mostly added costs. The Gold 5 minute run lost EUR -3,305.1 on 10,214 trades.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.