Keltner Channel vs Bollinger Bands: ATR or standard deviation?
Modern Keltner Channels use a multiple of Average True Range (ATR) around a moving average. Standard Bollinger Bands use a multiple of the standard deviation of closing prices around an SMA. ATR captures bar ranges and gaps; standard deviation measures how dispersed the selected prices are.
Direct answer
Use an ATR channel to express distance in recent trading ranges, or Bollinger Bands to express distance in price dispersion. Neither is universally better or always wider. Match the data, record each center and smoothing rule, then compare a defined trading rule. A band touch alone does not establish a reversal.
Starting values
Modern Keltner basis
Often EMA; configurable
Keltner half-width
Multiplier × ATR
Standard BB basis
20-period SMA
Standard BB half-width
2 × standard deviation
Checks before using the result
- 1
Record the source, basis length and type, volatility length, smoothing method, multiplier, and plot offset. Equal multipliers do not imply equal coverage or risk.
- 2
Compare completed bars on the same symbol, session, timeframe, and adjusted price feed. Allow enough warm-up history for recursive averages before counting signals.
- 3
Keep channel containment, breakout direction, and trade execution as separate conditions. A compression label supplies neither an entry price nor a stop.
Formulas and defaults: specify the whole channel
For a modern ATR-based Keltner Channel, upper and lower = basis ± multiplier × ATR. For standard Bollinger Bands, upper and lower = SMA(close, n) ± multiplier × standard deviation(close, n). Full width is twice the half-width. Both produce price-unit distances, but measure different properties of the data.
- TradingView documents a 20-period Keltner basis, close as source, a choice of SMA or EMA, a bands-style setting, and a separate ATR length. Selecting a high-low range style changes the calculation from the ATR version discussed here.
- StockCharts documents its own baseline as EMA 20 ± 2 × ATR(10). Treat this as a named platform convention, not a universal Keltner default. The original Keltner formula used typical price and high-low ranges.
- Standard Bollinger settings are SMA 20 and 2 deviations. A custom basis type or price source changes that baseline. Keep offset at zero when comparing current-bar events.
- True range = max(high − low, |high − previous close|, |low − previous close|). TradingView ATR uses RMA smoothing by default; an EMA-smoothed range is a different series even with the same length.
Same-data calculation: one gap changes both widths
This synthetic five-bar example uses price units, not market returns. The prior close and initial EMA are 100. Closes are 100, 100, 100, 100, 110. Every bar has high = close + 1 and low = close − 1, so the final bar gaps from the prior close of 100 to a range of 109 to 111. Both channels use these same bars and a multiplier of 2.
- Bollinger: five-bar SMA = 102. Population variance = (4 × 4 + 64) / 5 = 16, so standard deviation = 4. Lower = 94, upper = 110, and full width = 16.
- Keltner range: true ranges are 2, 2, 2, 2, 11. Seed ATR(5) with their arithmetic mean, 3.8. Half-width = 2 × 3.8 = 7.6, and full width = 15.2.
- Keltner center: EMA(5) uses alpha = 2 / (5 + 1). Starting at 100 before the five bars gives final EMA = 103.3333. Lower = 95.7333 and upper = 110.9333.
- At the final close of 110, price equals the Bollinger upper band but remains below the Keltner upper channel. A strict close-above rule triggers on neither. The final high of 111 touches or exceeds both, showing why touch and close-based rules differ.
A steady trend can produce narrower bands without containment
Keep the same five-bar lengths, multiplier 2, initial EMA of 100, and prior close of 100. Change the closes to 102, 104, 106, 108, 110, again with high = close + 1 and low = close − 1. Each true range is 3, so the initial ATR(5) is 3. The following values are calculated examples, not backtest evidence.
- Bollinger: SMA = 106, population variance = 8, standard deviation = 2.8284. Lower = 100.3431, upper = 111.6569, full width = 11.3137.
- Keltner: final EMA = 106.5267, lower = 100.5267, upper = 112.5267, full width = 12.
- Bollinger is narrower, but its lower band is below the Keltner lower band. Comparing widths alone would incorrectly label complete containment.
- These short windows make the arithmetic visible. ATR is at its initial five-range mean here; later RMA values follow ATR = (previous ATR × 4 + current true range) / 5. Live chart values depend on earlier history and initialization.
Why smoother is a conditional description
A smoothed ATR can change gradually, while squared deviations make Bollinger width sensitive to unusually distant closes. That does not make Keltner always smoother: ATR length, smoothing, and the path of highs and lows matter. A wide intrabar range followed by an unchanged close can raise ATR while leaving close-based Bollinger dispersion unchanged. A sustained trend can spread closes across a window even when each bar has a similar true range.
- A gap affects true range immediately and can also affect standard deviation if the close shifts. Bollinger Bands do not simply ignore gaps.
- Rolling standard deviation can change when an old extreme leaves the window. Recursive ATR retains a decaying contribution from older ranges.
- To isolate width behavior, compare both distances around the same center first. Then restore their conventional SMA and EMA centers and measure how the signals change.
Compression describes relative geometry, not a forecast
A strict containment rule requires the Bollinger upper band to be below the Keltner upper channel AND the Bollinger lower band to be above the Keltner lower channel. Decide explicitly whether equality counts. Containment can arise from Bollinger contraction, Keltner expansion, or movement of the two centers. It does not prove low absolute volatility, a coming breakout time, or its direction.
- Compare Bollinger BandWidth with its own history when the question is whether dispersion is unusually low. A fixed ATR envelope answers a different question.
- A transition out of containment is only a change of state. Require a separate directional condition and execution rule if testing trades.
- The linked squeeze material covers the combination workflow. This comparison focuses on selecting and reproducing the width calculation.
Compare complete rules before choosing an indicator
Define an upper-band touch as high reaching the upper line, a breakout as a completed close above it, or re-entry as a previous close outside followed by a close inside. Specify whether each comparison uses the band for that bar or the previous completed band. These events are not interchangeable. In a trend, repeated upper-band contacts can accompany continued strength; in a range, a breakout may reverse.
- Hold entries, exits, position sizing, dates, fees, slippage, and fill assumptions fixed. Change only the channel calculation in the first comparison.
- Reserve a later time window before parameter selection. Compare net results, drawdown, and trade count there, including costs; attractive curves alone cannot establish which rule works.
- The Pineify Pine Script AI Coding Agent can turn the specification below into code to inspect in TradingView. Strategy Optimizer can test supported strategy inputs once entry and exit rules are implemented; an indicator overlay alone has no trade results to optimize.
Width mechanisms under the same data assumptions
| Question | ATR-based Keltner | Standard Bollinger Bands |
|---|---|---|
| Center convention | Often EMA of close | SMA of close |
| Distance measure | Smoothed true range | Rolling price standard deviation |
| Unchanged close, wider high-low range | Can increase ATR | No direct change to close dispersion |
| Gap with a shifted close | Included through previous close in TR | Changes dispersion of the close window |
| Five-bar gap example, full width | 15.2 price units | 16 price units |
| Five-bar trend example, full width | 12 price units | 11.3137 price units |
| Outer-band event | Requires a separate trading rule | Requires a separate trading rule |
Specification for a reproducible channel comparison
This is a coding prompt, not a validated script or a trading recommendation. Check generated values against the selected TradingView indicators before using alerts.
Create a Pine Script v6 comparison indicator. Use close as the source, zero offset, and the chart timeframe. Plot standard Bollinger Bands with SMA length 20, population standard deviation length 20, and multiplier 2. Plot modern Keltner Channels with EMA length 20, Wilder RMA of true range length 10, and multiplier 2. Expose each length and multiplier separately. Include an optional common SMA basis mode to isolate width differences. Display basis, upper, lower, and full width values in the Data Window. Mark strict containment only when both Bollinger boundaries are inside the Keltner boundaries, after all calculations have sufficient history. Mark containment entry and exit only on completed bars and provide separate alerts. State the initialization conventions. Do not infer direction or place trades from containment alone.Build a channel comparison
Related Bollinger Bands pages
Tools for the next test
Bollinger Band Squeeze
Define Bollinger Band compression, compare two squeeze formulas, and generate a testable Pine Script breakout rule.
HMA Bollinger Bands
Replace the standard Bollinger basis with a Hull Moving Average, compare the response, and generate a testable Pine Script rule.
Bollinger Bands Calculator
Compute Bollinger Bands to analyze market volatility and potential price breakouts.
Bollinger Bands Crossover
Define upper, lower, and basis crossover events by direction and generate separate bar-close alerts for each event.
Sources and method notes
Educational information, not investment advice. The numerical cases are synthetic arithmetic examples, not observed returns. Neither channel guarantees a reversal, breakout, or profit. Historical test results depend on data and execution assumptions and can fail in live markets.