When a full candle opens and closes at or above the upper Bollinger Band (30) with price above the 10 and 100-period SMAs, the system buys, and the mirror setup sells short. It holds until price crosses the 120-period SMA or an opposite signal reverses it.
Best run of 16. USD/JPY, Daily, spread 1, from run pf:2026-09-24-USDJPY-D.tsv:5.
| Period | Up to 2026-09-25 |
| Instrument | USD/JPY, Daily |
| 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-25 |
| positionSize Contracts per trade | 1 |
| bandPeriod Bollinger Bands length (platform default deviation) | 30 |
| exitPeriod Exit SMA length | 120 |
| fastPeriod Fast SMA length | 10 |
| slowPeriod Slow SMA length | 100 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| USD/JPYBest run | Daily | 3.10 | 148 | 38.51 | 3,646,600 JPY | -312,500 |
| USD/JPY | 15 min | 1.14 | 2,526 | 27.16 | 538,320 JPY | -128,410 |
| USD/JPY | 30 min | n/a | 2,545 | 28.25 | 401,320 JPY | -243,220 |
| USD/JPY | 10 min | n/a | 2,563 | 26.84 | 359,970 JPY | -199,440 |
| EUR/USD | Daily | n/a | 145 | 39.31 | 125,286 USD | -65,587 |
| Nikkei 225 | Daily | n/a | 129 | 34.11 | 41,289 USD | -16,665 |
| GBP/USD | Daily | n/a | 175 | 31.43 | 16,560 USD | -6,901 |
| Nikkei 225 | 1 hour | n/a | 1,207 | 28.25 | 15,263 USD | -8,394 |
| Nikkei 225 | 2 min | n/a | 2,474 | 25.59 | 8,618 USD | -8,199 |
| US Crude Oil | 30 min | n/a | 2,466 | 29.20 | 8,237 EUR | -4,974 |
| Brent Crude | 30 min | n/a | 1,729 | 28.34 | 5,802 EUR | -4,645 |
| Gold | Daily | n/a | 177 | 31.07 | 1,556 EUR | -1,336 |
| Gold | 15 min | n/a | 2,565 | 26.08 | 1,318 EUR | -923 |
| Gold | 10 min | n/a | 2,608 | 23.85 | 1,308 EUR | -1,285 |
| Gold | 30 min | n/a | 2,597 | 28.53 | 1,245 EUR | -1,197 |
| Gold | 1 hour | n/a | 1,519 | 27.32 | 1,234 EUR | -842 |
Charts
Above 1.0 made money, below 1.0 lost money.
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 Walk // ProRealAlgos Strategy Library | prorealalgos.com // Type: Breakout // Direction: Long & short // Timeframe tested: Daily // ============================================================ // --- Settings --- DEFPARAM CumulateOrders = false // --- Parameters --- positionSize = 1 // contracts per trade bandPeriod = 30 // Bollinger Bands length (platform default deviation) exitPeriod = 120 // exit SMA length fastPeriod = 10 // fast SMA length slowPeriod = 100 // slow SMA length // --- Indicators --- slowMA = Average[slowPeriod](close) fastMA = Average[fastPeriod](close) upperBand = BollingerUp[bandPeriod](close) lowerBand = BollingerDown[bandPeriod](close) exitMA = Average[exitPeriod](close)
29 more lines: the entry and exit rules.
Read this first
Questions
Yes, it is always long, short or flat with 1 contract, and an opposite signal reverses the position. The rewritten code has not been compile checked.
USD/JPY, EUR/USD, GBP/USD, Nikkei 225, US Crude Oil, Brent Crude and Gold, and all 15 runs were positive. USD/JPY Daily was best with JPY 3,646,600.00 net profit.
On USD/JPY Daily the maximum drawdown was JPY 312,500.00. On EUR/USD Daily it was USD 65,587.00, so size carefully per market.
The 120-period SMA exit on daily bars keeps trades open for months of trend. Intraday runs traded far more often with lower win rates.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.