The signal is an 878-bar running sum of bar-to-bar changes in candle body size. As configured it is contrarian: it buys when that sum sets a new low below 0 and shorts when it sets a new high above 41 pips. Every opposite signal reverses the position, so it is always in the market.
Best run of 29. S&P 500, 30 min, spread 1, from run pf:2026-09-24-USA500-30m.tsv:1.
| Period | Up to 2026-09-24 |
| Instrument | S&P 500, 30 minutes |
| Spread | 1 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-24 |
| positionSize Contracts per trade | 1 |
| sumPeriod Bars summed for the body-change total | 878 |
| invertSignal 1 trades as written, -1 flips every signal | 1 |
| upperFilterPips Total must exceed this many pips to count as a positive reading | 41 |
| lowerFilterPips Total must be below minus this many pips to count as a negative reading | 0 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| S&P 500Best run | 30 min | 2.03 | 294 | 61.90 | 6,910 EUR | -1,336 |
| S&P 500 | 15 min | 1.87 | 202 | 57.43 | 5,222 EUR | -1,215 |
| USD/JPY | 30 min | n/a | 1,334 | 53.37 | 583,360 JPY | -311,340 |
| USD/JPY | 15 min | n/a | 680 | 53.68 | 390,690 JPY | -260,480 |
| USD/JPY | 10 min | n/a | 470 | 53.40 | 356,070 JPY | -299,470 |
| EUR/USD | 5 min | n/a | 124 | 50.00 | 226,540 USD | -178,822 |
| EUR/USD | 10 min | n/a | 150 | 53.33 | 206,625 USD | -82,297 |
| USD/JPY | 2 min | n/a | 48 | 50.00 | 106,210 JPY | -94,070 |
| EUR/USD | 30 min | n/a | 1,134 | 52.38 | 101,930 USD | -82,289 |
| Nikkei 225 | Daily | n/a | 1,299 | 59.28 | 65,932 USD | -17,149 |
| Silver | Daily | n/a | 849 | 57.83 | 36,872 USD | -16,947 |
| Dow Jones | Daily | n/a | 2,118 | 56.94 | 21,680 EUR | -18,902 |
| DAX 40 | Daily | n/a | 1,968 | 59.10 | 20,493 EUR | -6,430 |
| Nasdaq 100 | Daily | n/a | 1,351 | 58.18 | 17,701 EUR | -11,124 |
| FTSE 100 | 1 hour | n/a | 2,537 | 53.72 | 7,365 EUR | -2,920 |
| US Crude Oil | Daily | n/a | 1,183 | 56.97 | 6,255 EUR | -5,266 |
| S&P 500 | 4 hours | n/a | 566 | 56.89 | 6,141 EUR | -1,923 |
| S&P 500 | Daily | n/a | 444 | 53.83 | 5,968 EUR | -2,189 |
| S&P 500 | 1 hour | n/a | 460 | 54.57 | 5,400 EUR | -1,509 |
| Gold | 30 min | n/a | 150 | 60.00 | 4,171 EUR | -1,172 |
| Gold | 4 hours | n/a | 180 | 55.00 | 3,655 EUR | -2,304 |
| FTSE 100 | 10 min | n/a | 182 | 60.44 | 3,625 EUR | -1,305 |
| Gold | 1 hour | n/a | 176 | 53.41 | 3,384 EUR | -2,098 |
| S&P 500 | 10 min | n/a | 94 | 51.06 | 3,049 EUR | -1,455 |
| Gold | 15 min | n/a | 120 | 52.50 | 2,806 EUR | -1,935 |
| Gold | Daily | n/a | 194 | 57.22 | 2,643 EUR | -1,484 |
| S&P 500 | 5 min | n/a | 44 | 56.82 | 2,266 EUR | -1,426 |
| FTSE 100 | 5 min | n/a | 72 | 56.94 | 2,035 EUR | -1,593 |
| S&P 500 | 2 min | n/a | 12 | 66.67 | 840 EUR | -833 |
Charts
Top 10 of 29 runs. The full list is in the table above.
Above 1.0 made money, below 1.0 lost money.
The code
// ============================================================ // Candle Body Momentum // ProRealAlgos Strategy Library | prorealalgos.com // Type: Momentum // Direction: Long & short // Timeframe tested: 30 minutes // ============================================================ // --- Settings --- DEFPARAM CumulateOrders = false // --- Parameters --- positionSize = 1 // contracts per trade sumPeriod = 878 // bars summed for the body-change total invertSignal = 1 // 1 = trade as written, -1 = flip every signal upperFilterPips = 41 // total must exceed this many pips to count as positive lowerFilterPips = 0 // total must be below minus this many pips to count as negative ONCE lastPositiveSum = 0 ONCE lastNegativeSum = 0 ONCE tradeDirection = 0 // --- Indicators --- bodySize = close - open bodyChange = bodySize - bodySize[1] bodyChangeSum = Summation[sumPeriod](bodyChange) // Remember the latest positive and negative readings; each holds until replaced. IF bodyChangeSum > upperFilterPips * PipSize THEN lastPositiveSum = bodyChangeSum ENDIF IF bodyChangeSum < (0 - lowerFilterPips) * PipSize THEN lastNegativeSum = bodyChangeSum ENDIF negativeSumFalling = lastNegativeSum < lastNegativeSum[1] positiveSumRising = lastPositiveSum > lastPositiveSum[1]
20 more lines: the entry and exit rules.
Setup
The S&P 500 15 minute rerun had 456,000 bars and made EUR 6,660.97 against EUR 5,222.27 in the standard run, so the older data alone added EUR 1,438.70.
| Bars available | 456,000 |
| Net, standard 200,000-bar run | 5,222.27 EUR |
| Net, long run | 6,660.97 EUR |
| Net on the older data alone | 1,438.70 EUR |
Questions
Yes, but make sure enough history loads for the 878-bar sum. The rewritten code was not compile-checked, so test it in ProBacktest first.
Indices, currency pairs, metals and oil, and every listed run was positive. S&P 500 15 minutes recorded a profit factor of 1.87 over 202 trades.
The S&P 500 30 minute best run had a max drawdown of EUR 1,335.84 against EUR 6,909.96 net profit.
It gave the best recorded run, and it keeps the 878-bar window to a manageable span of history.
Related
Copy trading on US indices is available to ProRealAlgos members as spots open.