Join today
Strategies / Breakout / Bollinger Band Walk

Bollinger Band Walk: Riding Candles Outside the Bands

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.

BreakoutLong & shortSwingUSD/JPYDaily
3.10Profit factor
3,646,600Net profit JPY
38.51%Win rate
148Trades
-312,500Max drawdown
24,639Avg trade

Best run of 16. USD/JPY, Daily, spread 1, from run pf:2026-09-24-USDJPY-D.tsv:5.

Entry rules, long

  1. Members only
  2. Close is above both the 10 and 100-period SMAs

Entry rules, short

  1. Members only
  2. Close is below both the 10 and 100-period SMAs

Exit rules

  1. Members only
  2. Close a short when price crosses above the 120-period SMA
  3. An opposite signal reverses the position
  4. No stop loss or target

Test conditions

PeriodUp to 2026-09-25
InstrumentUSD/JPY, Daily
Spread1 points
Contracts1
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-09-25

Parameters

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

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
USD/JPYBest runDaily3.10 14838.513,646,600 JPY-312,500
USD/JPY15 min1.14 2,52627.16538,320 JPY-128,410
USD/JPY30 minn/a 2,54528.25401,320 JPY-243,220
USD/JPY10 minn/a 2,56326.84359,970 JPY-199,440
EUR/USDDailyn/a 14539.31125,286 USD-65,587
Nikkei 225Dailyn/a 12934.1141,289 USD-16,665
GBP/USDDailyn/a 17531.4316,560 USD-6,901
Nikkei 2251 hourn/a 1,20728.2515,263 USD-8,394
Nikkei 2252 minn/a 2,47425.598,618 USD-8,199
US Crude Oil30 minn/a 2,46629.208,237 EUR-4,974
Brent Crude30 minn/a 1,72928.345,802 EUR-4,645
GoldDailyn/a 17731.071,556 EUR-1,336
Gold15 minn/a 2,56526.081,318 EUR-923
Gold10 minn/a 2,60823.851,308 EUR-1,285
Gold30 minn/a 2,59728.531,245 EUR-1,197
Gold1 hourn/a 1,51927.321,234 EUR-842

Charts

Results by run

Profit factor by run

Above 1.0 made money, below 1.0 lost money.

0.01.32.53.85.01.0 = break-evenUSD/JPY · Daily3.10USD/JPY · 15 min1.14

Net profit against max drawdown

Net profitMax drawdown
0-500K-250K2.5M5.0MUSD/JPY · DailyUSD/JPY · 15 minUSD/JPY · 30 minUSD/JPY · 10 minEUR/USD · DailyNikkei 225 · DailyGBP/USD · DailyNikkei 225 · 1 hourNikkei 225 · 2 minUS Crude Oil · 30 minBrent Crude · 30 minGold · DailyGold · 15 minGold · 10 minGold · 30 minGold · 1 hour

The code

ProBuilder, rewritten to house standard

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

Known weaknesses

  • There is no stop loss. The USD/JPY daily run had a maximum drawdown of JPY 312,500.00, which is large in absolute terms.
  • Win rates are low, 38.51% on the best run and around 24% to 29% on intraday charts, so it depends on a few big trends.
  • USD/JPY dominates the results. Gold runs made only about EUR 1,233.70 to EUR 1,556.00.
  • Profit factor was recorded for just two runs, the rest are sweep data.

Indicators used

Bollinger BandsSMA

How to load it

  1. Copy the code with the copy button above 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.

Questions

About this strategy

Is it ready for ProOrder?

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.

Which markets were tested?

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.

What drawdown comes with 1 contract?

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.

Why daily bars?

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

Strategies like this one

Bollinger Squeeze

Uses the same indicator.

14.30 PF · 86 trades

Supertrend Counter Trend

Best run on the same market, USD/JPY.

3.47 PF · 1,444 trades

Negated Hammer

A similar profit factor.

3.20 PF · 372 trades

Trend trader at heart? The ProRealAlgos community waitlist is a click away.

The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.

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