kc
Calculate the 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
- standard
| Name | Type | Description | Default | Optional |
|---|---|---|---|---|
| data | List[Data] | The data to use for the Keltner Channels calculation. | False | |
| index | str | Index column name to use with data, by default "date" | date | False |
| length | int | The length of the Keltner Channels, by default 20 | 20 | False |
| scalar | float | The scalar to use for the Keltner Channels, by default 20 | 20 | False |
| mamode | Literal['ema', 'sma', 'wma', 'hma', 'zlma'] | The moving average mode to use for the Keltner Channels, by default "ema" | ema | False |
| offset | int | The offset to use for the Keltner Channels, by default 0 | 0 | False |
Returns
OBBject
results : List[Data]
The Keltner Channels data.