Bollinger breakout buy sell
Marks bars that close outside the Bollinger band: buy above the upper band, sell below the lower band.
Takes the average and sample standard deviation of the last window closes. The upper band is the average plus mult times that deviation, the lower band is the average minus it. A buy marks a close above the upper band and a sell marks a close below the lower band, each shifted by band and held for confirm_days bars. Both are breakouts in opposite directions; neither name is a trade on its own.
How to read it
- Buy markers sit on candles that close above the upper band; sell markers on candles that close below the lower band.
- A run of markers means price stayed outside the band, so several markers can be one breakout.
- Read a buy as price running up out of its recent range, a trend reading, not a call to buy a dip.
What it outputs
- Buy
- Marks bars where the close is above the upper band, held for confirm_days bars in a row. An upside breakout, not a reversal call.
- Sell
- Marks bars where the close is below the lower band, held for confirm_days bars in a row. A downside breakout; the name does not mean go short.
When it fires
A buy fires on the bar a close above the upper band has held for confirm_days bars, meaning price has broken up out of its recent range. A sell fires on the matching bar below the lower band, a breakdown out of that range. Read the moment as a breakout, not a turning point.
Settings
- window
- Bars the average and deviation look back over. Shorter (around 10) hugs recent price, so the bands are tight and breakouts are more frequent. Longer (around 60) gives slow, wide bands and fewer, larger breakouts.
- mult
- Deviations from the average to each band. Higher (2.5 to 3) pushes the bands out, so only extreme moves mark. Lower (toward 1) pulls them in and markers get frequent. Below zero the bands swap sides and both markers fire on most bars.
- band
- Shifts each threshold by that fraction of the band price. Positive values push the thresholds out, so fewer markers, and at 1 nothing fires. Negative values pull them in, so more markers, and at -1 both fire on every bar.
- confirm_days
- Bars in a row the close must stay outside the band before a marker. At 1 every bar outside the band marks. At 3 or more only the bar the run reaches that length marks, so markers are fewer and later, and single-bar pokes are ignored.
Pitfalls
- Breakouts, not reversals: in a steady trend, buy markers cluster along the upper band and keep appearing while the trend lasts.
- Frequent at defaults: on SPY one-minute bars for September 2026 it marked about 25 buy runs and 25 sell runs a day, so the chart gets busy. Raise mult or confirm_days to thin them.
- Extreme slider values break it: the sliders accept negative mult and band down to -1, and then both markers fire on nearly every bar.