Join today
Strategies / Volatility / Bollinger Squeeze

Bollinger Squeeze Breakout on Daily Stocks

When Bollinger Band width (22) drops to its lowest of the last 2 bars, the system places a buy stop at the upper band for the next bar. It holds the trade until the close falls below the 165-day SMA. This is a slow, long-only swing system tested on daily charts of large US stocks and the S&P 500.

VolatilityLong onlySwingAmazonDaily
14.30Profit factor
386,898Net profit USD
43.02%Win rate
86Trades
-361,369Max drawdown
4,499Avg trade

Best run of 31. Amazon, Daily, from run stock2-queue:2026-09-15-Amazon.tsv:9.

Entry rules, long

  1. Bollinger Band width (22) is at its lowest of the last 2 bars
  2. Members only

Exit rules

  1. Members only
  2. No stop loss or target

Test conditions

PeriodUp to 2026-09-15
InstrumentAmazon, Daily
Capital per trade10,000
CostsNot recorded for this run.
BarsDaily bars, full available history
Last tested2026-09-15

Parameters

capitalPerTrade
Money committed to each trade
10000
bandPeriod
Bollinger Band length
22
squeezeBars
Band width must be the lowest of this many bars
2
exitPeriod
Exit SMA length
165

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
AmazonBest runDaily14.30 8643.02386,898 USD-361,369
PalantirDaily16.65 2040.0094,451 USD-31,293
CiscoDaily13.86 10350.49225,807 USD-41,136
MetaDaily13.76 2850.0046,969 USD-10,472
MastercardDaily10.32 4052.5080,788 USD-23,544
NvidiaDaily7.16 10227.45202,659 USD-36,363
BroadcomDaily5.04 3540.0047,678 USD-9,468
TeslaDaily4.11 6440.6262,570 USD-28,438
AlphabetDaily3.79 2937.9319,069 USD-5,070
OracleDaily3.72 14833.78100,248 USD-24,550
Applied MaterialsDaily3.60 9837.7674,042 USD-30,687
MicrosoftDaily3.54 12531.2084,446 USD-34,568
AMDDaily3.22 18644.09124,415 USD-24,881
CostcoDaily3.17 10044.0039,134 USD-6,597
Berkshire HathawayDaily3.02 7546.6721,168 USD-9,905
Bank of AmericaDaily2.93 8940.4535,213 USD-7,319
VisaDaily2.86 3935.9021,413 USD-6,405
AbbVieDaily2.71 3943.5911,391 USD-5,999
Lam ResearchDaily2.65 12739.3789,157 USD-32,344
CaterpillarDaily2.52 18935.9851,732 USD-10,618
Eli LillyDaily2.40 18637.6349,760 USD-14,648
S&P 500Daily2.23 18330.0528,567 EUR-6,839
WalmartDaily1.99 23922.1849,448 USD-43,858
Johnson & JohnsonDaily1.99 21431.3130,738 USD-9,947
JPMorganDaily1.90 19637.7634,834 USD-8,919
ExxonMobilDaily1.59 23524.6823,697 USD-10,693
ChevronDaily1.12 11128.832,671 USD-9,124
AppleDaily0.55 775.19-10,740 USD-23,393
IntelDaily0.48 616.67-11,000 USD-21,000
Coca-ColaDaily0.45 916.59-10,165 USD-17,369
MicronDaily0.28 2725.93-10,755 USD-14,397

Charts

Results by run

Profit factor by run

Above 1.0 made money, below 1.0 lost money.

0.05.01015201.0 = break-evenPalantir · Daily16.65Amazon · Daily14.30Cisco · Daily13.86Meta · Daily13.76Mastercard · Daily10.32Nvidia · Daily7.16Broadcom · Daily5.04Tesla · Daily4.11Alphabet · Daily3.79Oracle · Daily3.72Applied Materials · Daily3.60Microsoft · Daily3.54AMD · Daily3.22Costco · Daily3.17Berkshire Hathaway · Daily3.02Bank of America · Daily2.93Visa · Daily2.86AbbVie · Daily2.71Lam Research · Daily2.65Caterpillar · Daily2.52Eli Lilly · Daily2.40S&P 500 · Daily2.23Walmart · Daily1.99Johnson & Johnson · Daily1.99

Net profit against max drawdown

Net profitMax drawdown
0-500K-250K250K500KAmazon · DailyCisco · DailyNvidia · DailyAMD · DailyOracle · DailyPalantir · DailyLam Research · DailyMicrosoft · DailyMastercard · DailyApplied Materials · DailyTesla · DailyCaterpillar · DailyEli Lilly · DailyWalmart · DailyBroadcom · DailyMeta · Daily

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 Squeeze
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Volatility
// Direction: Long only
// Timeframe tested: Daily
// ============================================================

// --- Settings ---
DEFPARAM CumulateOrders = false

// --- Parameters ---
capitalPerTrade = 10000   // money committed to each trade
bandPeriod = 22           // Bollinger Band length
squeezeBars = 2           // band width must be the lowest of this many bars
exitPeriod = 165          // exit when the close drops below this SMA

// --- Indicators ---
positionSize = capitalPerTrade / close
bandWidthValue = BollingerBandWidth[bandPeriod](close)
upperBand = BollingerUp[bandPeriod](close)
exitMA = Average[exitPeriod](close)

14 more lines: the entry and exit rules.

Read this first

Known weaknesses

  • There is no stop loss. The best run on Amazon had a max drawdown of USD 361,368.9, close to its USD 386,897.72 net profit.
  • Four of the thirty markets lost money: Apple, Intel, Coca-Cola and Micron. Coca-Cola won only 6.59% of its 91 trades.
  • Some results rest on few trades, for example Palantir (20 trades) and Intel (6 trades), so the profit factors there can swing a lot with a few more trades.
  • Positions are sized as 10,000 divided by the close, so the risk per trade changes with price and there is no fixed loss limit.

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

Can I automate the Bollinger Squeeze in ProOrder?

Yes. The buy stop is re-placed every bar while the squeeze holds, which ProOrder handles, but the rewritten code has not been compile-checked, so backtest it first.

Which stocks were tested?

Thirty daily charts, mostly large US stocks plus the S&P 500. Amazon gave the best run with a profit factor of 14.3 over 86 trades, while Apple, Intel, Coca-Cola and Micron lost.

How is position size set?

Each trade buys about 10,000 of stock, calculated as 10,000 divided by the close. With no stop in place, the best run still saw a max drawdown of USD 361,368.9.

Why daily bars?

The exit uses a 165-day SMA, so the system is built for multi-week trends. Daily data gave the full available history for each stock.

Related

Strategies like this one

Long-Term Moving Average Cross

Uses the same indicator.

12.31 PF · 61 trades

Winter Only

A similar profit factor.

14.53 PF · 49 trades

Volatility Breakout

Also a volatility strategy.

1.39 PF · 475 trades

Curious how volatility breakouts are combined with other systems? Get on the ProRealAlgos waitlist.

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