Keltner breakout buy sell
Marks closes outside the Keltner channel: buy above the upper band, sell below the lower band.
The middle line is an exponential average of closes over ema_window bars. The upper and lower bands sit mult times a smoothed average true range (atr_window bars) above and below it, so their width follows recent bar ranges. A buy marks a bar whose close is above the upper band and a sell marks a bar whose close is below the lower band. It is a breakout test against volatility-scaled bands, not a crossover, and the chart shows only the markers, not the bands.
How to read it
- Buy markers sit on candles that close above the upper band; sell markers sit on candles that close below the lower band.
- The band lines are not drawn, so judge each marker against the candle and the recent range.
- A run of consecutive markers means price kept closing outside the band; the first marker of a run is the breakout bar.
- Buy and sell are independent, so a sell marker does not cancel an earlier buy.
What it outputs
- Buy (above upper band)
- Marks each bar whose close is above the upper band. An upward breakout out of the volatility channel, not a reversal call.
- Sell (below lower band)
- Marks each bar whose close is below the lower band. A downward breakout; the name does not mean go short.
When it fires
A buy fires on each bar whose close is above the upper band, and a sell on each bar below the lower band. Each run of such bars is one episode. With confirm_days above 1, the marker fires once per run, on the bar the run reaches that length.
Settings
- ema_window
- Length of the average the bands are centred on. Shorter tracks each swing, so the middle moves with price. Longer lags, so in a sustained move price runs further from the middle before a breakout.
- atr_window
- Bars used to measure the typical bar range that sets the band width. Shorter reacts within a few bars and widens or narrows the bands quickly. Longer changes the width slowly.
- mult
- How many ATRs the bands sit from the average. Higher widens the channel and cuts markers; lower narrows it and adds them. At 0 both bands sit on the average. Below 0 the bands swap sides and markers lose their breakout meaning.
- band
- Fraction of the band level that price must clear, applied to each band. Positive values move both thresholds out and cut markers; negative values pull them in. At -1 both signals fire on every bar; at 1 neither fires.
- confirm_days
- Consecutive bars the close must stay beyond a band before a marker appears. Higher values drop brief pokes outside the band and move the marker to the bar where the run reaches that length.
Pitfalls
- Frequent at defaults: on SPY one-minute bars for September 2026 it marked about 30 buy and 28 sell episodes a day, so the chart is busy. Raise mult or confirm_days to thin them.
- The current bar is part of both the average and the true range, so a sharp bar widens the band it is tested against on that same bar and can fail to break out.
- Parameter ranges allow broken settings: at band -1 both signals fire on every bar, and at mult below 0 the bands swap sides.