Returns the Keltner Channel width: the distance between the upper and lower channel divided by the basis.
ta.kcw is (upper - lower) / basis for ta.kc with the same arguments. It is a relative measure, so readings compare across price levels and symbols.
Compare it with ta.bbw to find squeezes, where the Bollinger Bands move inside the Keltner Channels.
Syntax
ta.kcw(series: series int/float, length: simple int, mult: simple int/float, useTrueRange: simple bool) -> series floatArguments
| 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: the relative channel width.
Remarks
- The width equals 2 * mult * averagedRange / basis.
Example
//@version=6
indicator("Channel widths")
plot(ta.kcw(close, 20, 1.5), "Keltner width", color = color.green)
plot(ta.bbw(close, 20, 2), "Bollinger width", color = color.blue)See also
Runs on Sidechair