Join waitlist
Strategies / Momentum / MACD Histogram Pivot CCI Filter

MACD Histogram Pivot CCI Filter

Buys after a MACD histogram low pivot below zero when CCI(40) has reached -150 or below recently and price is above the 400 period SMA. Sells short on the mirrored high pivot setup when price is at or below that average.

MomentumLong & shortSwingS&P 5001 hour
1.42Profit factor
2,777Net profit EUR
64.85%Win rate
532Trades
-674Max drawdown
5.22Avg trade

Best run of 23. S&P 500, 1 hour, spread 1, from run pf:2026-10-04-USA500-1h.tsv:5.

Entry rules, long

  1. The CCI (40 periods) was -150 or below on at least one of the last 12 bars.
  2. The close is above the 400 period SMA.
  3. The 14 period ADX was above 25 on at least one of the last 10 bars.

Entry rules, short

  1. The CCI (40 periods) was 150 or above on at least one of the last 12 bars.
  2. The close is at or below the 400 period SMA.
  3. The 14 period ADX was above 25 on at least one of the last 10 bars.

Exit rules

  1. An open short is closed when a low pivot below zero is confirmed with CCI at or below -150 in the last 12 bars.
  2. An opposite signal closes the trade, without reversing on the same bar.

Test conditions

PeriodUp to 2026-10-04
InstrumentS&P 500, 1 hour
Spread1 points
Starting capital1,000,000
CostsSpread only. Commissions and overnight financing are not included.
BarsUp to 200,000 bars, fewer where the instrument has less history
Last tested2026-10-04

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
S&P 500Best run1 hour1.42 53264.852,777 EUR-674
USD/JPY1 hourn/a 59363.24536,360 USD-167,980
Nikkei 2251 hourn/a 40564.4423,798 USD-6,345
Nikkei 2254 hoursn/a 10862.9621,701 USD-10,257
Dow JonesDailyn/a 6078.3320,839 EUR-7,180
SilverDailyn/a 4273.8119,808 USD-9,676
Nikkei 225Dailyn/a 3863.1616,641 USD-8,036
Nikkei 22530 minn/a 83358.9415,128 USD-7,723
Dow Jones1 hourn/a 16567.8812,348 EUR-6,697
Silver5 minn/a 80055.1211,496 USD-5,766
Nasdaq 1001 hourn/a 52965.7811,459 EUR-4,127
Nasdaq 10030 minn/a 88960.0711,448 EUR-4,653
Nasdaq 100Dailyn/a 4879.1710,141 EUR-3,953
Nasdaq 1004 hoursn/a 15470.137,919 EUR-3,406
Dow Jones4 hoursn/a 5070.007,464 EUR-6,096
DAX 40Dailyn/a 5669.647,041 EUR-4,262
US Crude Oil1 hourn/a 35062.866,251 EUR-3,502
FTSE 100Dailyn/a 4173.174,150 EUR-2,643
S&P 500Dailyn/a 5875.862,856 EUR-1,238
S&P 5004 hoursn/a 15072.672,291 EUR-697
Brent Crude1 minn/a 80557.642,179 EUR-1,831
S&P 50030 minn/a 90360.021,852 EUR-632
GBP/USD5 minn/a 76559.35534 USD-333

Charts

Results by run

Top 10 of 23 runs. The full list is in the table above.

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// MACD Histogram Pivot CCI Filter
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Momentum
// Direction: Long & short
// Timeframe tested: 1 hour
// ==============================================================

DEFPARAM CumulateOrders = false

macdl = MACDline[24,52,18](close)
macds = ExponentialAverage[18](macdl)
hist = macdl - macds
tp = (high + low + close) / 3
myCci = CCI[40](tp)
sma = Average[400](close)
myAdx = ADX[14]

pivhigh = 1
pivlow = 1
FOR myK = 0 TO 10 DO

37 more lines: the entry and exit rules.

Setup

How to load it

  1. Copy the code with the copy button on the code block.
  2. In ProRealTime, open a chart of the instrument and timeframe you want to test, then open ProOrder > New trading system and choose "Create with programming".
  3. Paste the code, give the system a name and save it.
  4. Click "Backtest", set your own spread and position size, and run it before you consider trading it live.

Indicators used

MACDCCISMAADXEMA
Longer historyRe-run on up to 1,000,000 barsS&P 500 · 1 hour · older data 0.00 EUR

S&P 500 had no history beyond the standard run, so both runs used 114,000 bars.

S&P 500 · 1 hour

Bars available114,000
Net, standard 200,000-bar run2,777.17 EUR
Net, long run2,777.17 EUR
Net on the older data alone0.00 EUR
Read this firstKnown weaknesses2 points
  • The code sets no stop loss, so a losing trade stays open until an exit signal arrives.
  • Results include the spread only. Commissions and overnight financing are not included.

Questions

About this strategy

Can I run MACD Histogram Pivot CCI Filter in ProOrder?

Yes. The code is ProBuilder and runs as an automated ProOrder system. Backtest it on your own account with your own spread and position size before trading it live.

Which markets was it tested on?

It was tested on 23 market and timeframe combinations. The best run was S&P 500, 1 hour, with a profit factor of 1.42 over 532 trades.

How large was the drawdown?

The best run had a maximum drawdown of 674 EUR at the tested position size, against a net result of 2,777 EUR.

Does it trade long, short or both?

It trades both long and short.

Related

Strategies like this one

Trend Surfer

Uses the same indicator.

1.04 PF · 10,813 trades

CCI Sign With EMA Alignment

Best run on the same market, S&P 500.

1.23 PF · 1,253 trades

DEMA Spread Momentum Hold

Also a momentum strategy.

1.41 PF · 826 trades

Put your name on the ProRealAlgos waitlist to trade a tested portfolio instead of single strategies.

Copy trading on US indices is available to ProRealAlgos members as spots open.

Past backtest results do not guarantee future results. This is not financial advice. Curated and maintained by ProRealAlgos. ProRealTime™ is a trademark of ProRealTime SAS. prorealalgos.comStatsDocs