Skip to main content

kc

Keltner Channels.

Keltner Channels are volatility-based bands that are placed on either side of an asset's price and can aid in determining the direction of a trend.The Keltner channel uses the average true range (ATR) or volatility, with breaks above or below the top and bottom barriers signaling a continuation.

Example:​

from openbb import obb
stock_data = obb.equity.price.historical(symbol="TSLA", start_date="2023-01-01", provider="fmp")
kc_data = obb.technical.kc(data=stock_data.results, length=20, scalar=20, mamode="ema", offset=0)

Parameters​

NameTypeDescriptionDefaultOptional
dataList[Data]The data to use for the Keltner Channels calculation.NoneFalse
indexstrIndex column name to use with data, by default "date"dateTrue
lengthPositiveIntThe length of the Keltner Channels, by default 2020True
scalarPositiveFloatThe scalar to use for the Keltner Channels, by default 2020True
mamodeLiteral["ema", "sma", "wma", "hma", "zlma"]The moving average mode to use for the Keltner Channels, by default "ema"emaTrue
offsetNonNegativeIntThe offset to use for the Keltner Channels, by default 00True

Returns​

The Keltner Channels data.