Returns the Keltner Channels as three series: an EMA basis with bands mult times an averaged range above and below.
ta.kc returns [basis, upper, lower]. The basis is ta.ema(series, length), and the band offset is mult times an EMA of the bar range over the same length. The range is the true range, or high - low when useTrueRange is false.
With the true range, the first values appear on bar number length + 1, since the first bar has no previous close.
Syntax
ta.kc(series: series int/float, length: simple int, mult: simple int/float, useTrueRange: simple bool) -> [series float, series float, series float]Arguments
| Name | Type | Default | Description |
|---|---|---|---|
| series | series int/ | required | Series for the basis, usually close. |
| length | simple int | required | Length of both EMAs. A whole number of 1 or more. |
| mult | simple int/ | required | Multiplier applied to the averaged range. |
| useTrueRange | simple bool | true | true averages the true range; false averages plain high - low. |
Returns
[series float, series float, series float]: the basis, the upper channel and the lower channel.
Remarks
- Keltner Channels follow smoothed range, so they react less to a single outlier close than Bollinger Bands do.
Example
//@version=6
indicator("Keltner Channels", overlay = true)
[mid, upper, lower] = ta.kc(close, 20, 1.5)
plot(mid, "Basis", color = color.gray)
plot(upper, "Upper", color = color.green)
plot(lower, "Lower", color = color.red)See also
Runs on Sidechair