A long needs ADX(50) above 10, DI+ above DI-, and a bar whose low pierces the lower Bollinger Band but closes back above it. Shorts mirror this at the upper band. Each trade uses a 60 point stop and a 10 point target.
Best run of 1. S&P 500, Daily, spread 1, from run sweeps:2026-09-20-USA500-D-opt.tsv:4.
| Period | Up to 2026-09-20 |
| Instrument | S&P 500, Daily |
| Spread | 1 points |
| Contracts | 5 |
| 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-20 |
| positionSize Shares per trade, as published | 5 |
| adxPeriod ADX length | 50 |
| adxThreshold Minimum ADX | 10 |
| diPeriod DI+ / DI- length | 50 |
| bandPeriod Bollinger Band length | 20 |
| stopLossPoints Protective stop (points) | 60 |
| takeProfitPoints Profit target (points) | 10 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| S&P 500Best run | Daily | n/a | 155 | 80.65 | 1,241 EUR | -946 |
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.
// ============================================================ // Bollinger Band Rejection // ProRealAlgos Strategy Library | prorealalgos.com // Type: Mean reversion // Direction: Long & short // Timeframe tested: Daily // ============================================================ // --- Settings --- DEFPARAM CumulateOrders = false // --- Parameters --- positionSize = 5 // shares per trade, as published adxPeriod = 50 // ADX length adxThreshold = 10 // minimum ADX diPeriod = 50 // DI+ / DI- length bandPeriod = 20 // Bollinger Band length stopLossPoints = 60 // protective stop (points) takeProfitPoints = 10 // profit target (points) // --- Indicators --- adxValue = ADX[adxPeriod] plusDI = DIplus[diPeriod](close) minusDI = DIminus[diPeriod](close) lowerBand = BollingerDown[bandPeriod](close) upperBand = BollingerUp[bandPeriod](close)
16 more lines: the entry and exit rules.
Read this first
Questions
Yes. The stop and target are coded, and it trades 5 contracts per signal in ProOrder.
Only S&P 500 daily, which made EUR 1,241.20 over 155 trades with an average trade of EUR 8.01.
The max drawdown was EUR 946.05 at 5 contracts. Margin is set by your broker and not covered here.
Daily band rejections filter out much of the intraday noise, which matters when the target is only 10 points.
Related
Copy trading on US indices is available to ProRealAlgos members as spots open.