Guides, manuals and platform references.
A close above a Keltner Channel can make one trader buy and another prepare to sell. The chart has not contradicted itself. The traders have assigned different jobs to the same observation.
An outside close identifies price relative to a volatility band. It does not, by itself, choose continuation or reversal. For TradingView automation, decide which hypothesis you intend to trade before turning that observation into an alert. In an AlgoWay alert-to-execution workflow, the order instruction should express that decision; the connector is not where an ambiguous chart interpretation becomes a strategy.
A common Keltner construction puts an EMA in the middle and adds or subtracts a multiple of ATR. With a basis of 100, ATR of 2 and multiplier of 1.5, the upper band is 103 and the lower band is 97. These are hypothetical values, not a tested setup.
TradingView exposes choices for the basis, source, range calculation and lengths. Record them rather than assuming every script called “Keltner” calculates identical bands. Its indicator documentation also distinguishes strength in a trend from possible reversion in a sideways market. Neither interpretation guarantees the next move.
Suppose the next close is 104 and the upper band at that close is 103. It is an outside close. It becomes a new crossing only if the previous close was at or below its own upper band. Comparing both closes with today's band answers a different question.
The following are deliberately simple research specifications. They illustrate different events and are not recommendations or reported results.
| Decision | Continuation hypothesis | Reversion hypothesis |
|---|---|---|
| Outside close at 104, upper band 103 | A fresh crossing can qualify as a long entry signal. | Mark an excursion; do not sell yet. |
| Later close at 102.5, upper band 103.2 | May invalidate the breakout under an inside-close exit rule. | May qualify as a short signal on a return inside. |
| Price keeps rising outside | Keep the existing position under the chosen exit rule. | No inside-close trigger has happened. |
| Repeated outside closes | Do not add positions unless additions are explicitly part of the rule. | Do not reinterpret each close as a fresh reversal. |
For the short reversion example, define a protective exit above a chosen invalidation level and a separate profit-exit rule, perhaps involving the basis. Specify whether that basis is fixed at entry or recalculated. A moving target is still a rule, but only after you have admitted that it moves.
TradingView's built-in Keltner Channels Strategy describes a long entry on an upper-band crossing and a switch to short on a lower-band crossing. That is a particular continuation design. It is not the same as selling immediately above the upper band, nor the illustrative inside-close reversal above.
It is easy to label a chart “trending” after a breakout succeeds and “ranging” after it fails. A bot cannot consult tomorrow's caption.
If you want a regime filter, write a numerical condition available at the signal time. An example research rule could require the current completed-bar basis to exceed its value five completed bars earlier before accepting a long breakout. That measures one particular slope; it does not establish that the market will continue. For a reversion test, a separately defined flat-basis tolerance would need its own units and threshold.
Do not silently change the filter when a trade looks inconvenient. Compare the unfiltered rule and the filtered rule on the same sample, then evaluate the frozen choices on later data. The difference between a volatility setup and a directional trigger matters here too, although Keltner and Bollinger bands use different constructions.
For a completed-bar design, require the chosen crossing and confirmation at bar close. An intrabar high outside the channel is not equivalent to a close outside it. TradingView's Pine alert documentation distinguishes alert frequency options and strategy order-fill events; choose the event type that matches the tested logic.
A channel supplies boundaries. Your strategy supplies the verb. “Buy the break” and “sell the return” can both be precise hypotheses, but an alert that leaves the verb undecided is unfinished work.