Functions
talib.kc()
Keltner channels for `source` over `length` bars, with `mult` setting the distance to the outer bands. An optional `useTrueRange` flag selects true range for the width calculation. As with `talib.bb`, `mult` is an int, so a fractional multiplier is not accepted.
Syntax
talib.kc(series float source, series int length, series int mult, series bool useTrueRange) → [series float, series float, series float]
Arguments
source required series float The series the channels are built on. length required series int How many bars the calculation covers. mult required series int Band multiplier. An int, not a float: a fractional multiplier is refused when the script is checked, and there is no rounding. useTrueRange series bool Optional flag selecting true range for the width. Return Type
[series float, series float, series float] Example
indicator("Keltner Channels", overlay=true)
length = input(20, "Length")
mult = input.int(2, "Multiplier")
source = input(close, "Source")
[kcLower, kcMiddle, kcUpper] = talib.kc(source, length, mult)
plot(kcUpper, color=color.blue, title="Upper KC")
plot(kcMiddle, color=color.gray, title="Middle KC")
plot(kcLower, color=color.red, title="Lower KC")