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
ta.kcw(series, length, mult, usetruerange) → series floatArguments
| Parameter | Type | Description |
|---|---|---|
| series | series int/float | Source series (typically price). |
| length | simple int | Length for the central average and band calculation. |
| mult | simple int/float | Multiplier applied to the range measure. |
| usetruerange | simple bool | Optional. 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
//@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
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.
Related Pine Script Functions
ta.kc() - Keltner Channels
Learn how to use ta.kc() in Pine Script. Syntax, parameters, code examples for Keltner Channel volatility bands.
ta.bbw() - Bollinger Bands Width
Learn how to use ta.bbw() in Pine Script. Syntax, parameters, code examples for measuring Bollinger Band squeeze and width.
ta.atr() - Average True Range
Learn how to use ta.atr() in Pine Script. Syntax, parameters, code examples for the Average True Range volatility indicator.
ta.bb() - Bollinger Bands
Learn how to use ta.bb() in Pine Script. Syntax, parameters, code examples for Bollinger Bands with upper, middle, and lower bands.
ta.stdev() - Standard Deviation
Learn how to use ta.stdev() in Pine Script. Syntax, parameters, code examples for statistical standard deviation calculation.