VolatilityPine Script v6

ta.kcw()

Keltner Channels Width

The Keltner Channels Width is the difference between the upper and the lower Keltner Channels divided by the middle channel.

Syntax

Syntax
ta.kcw(series, length, mult, usetruerange) → series float

Arguments

ParameterTypeDescription
seriesseries int/floatSource series (typically price).
lengthsimple intLength for the central average and band calculation.
multsimple int/floatMultiplier applied to the range measure.
usetruerangesimple boolOptional. If true, uses true range in the band width; default true.

Returns

Keltner Channels Width.

Remarks

Expresses channel width relative to the middle line, useful for comparing volatility compression and expansion over time.

Code Examples

Pine Script v6 Example
//@version=6
indicator("ta.kcw")

plot(ta.kcw(close, 5, 4), color=color.yellow)

Trading Applications

Measure channel width for volatility analysis

Detect volatility contraction and expansion

Compare with BBW for squeeze confirmation

Monitor trend strength through channel width changes

Related Functions

Frequently Asked Questions

Generate ta.kcw() Code with AI

Skip the manual coding. Use Pineify's AI Coding Agent to generate Pine Script code using ta.kcw() and other built-in functions instantly.