cones
Calculate the realized volatility quantiles over rolling windows of time.
The cones indicator is designed to map out the ebb and flow of price movements through a detailed analysis of volatility quantiles. By examining the range of volatility within specific time frames, it offers a nuanced view of market behavior, highlighting periods of stability and turbulence.
The model for calculating volatility is selectable and can be one of the following:
Standard deviation
Parkinson
Garman-Klass
Hodges-Tompkins
Rogers-Satchell
Yang-Zhang
Read more about it in the model parameter description.
Example
from openbb import obb
stock_data = obb.equity.price.historical(symbol='TSLA', start_date='2023-01-01', provider='fmp')
cones_data = obb.technical.cones(data=stock_data.results, lower_q=0.25, upper_q=0.75, model='STD')
Parameters
- standard
| Name | Type | Description | Default | Optional |
|---|---|---|---|---|
| data | List[Data] | The data to use for the calculation. | False | |
| index | str | Index column name to use with data, by default "date" | date | False |
| lower_q | float | The lower quantile value for calculations | 0.25 | False |
| upper_q | float | The upper quantile value for calculations | 0.75 | False |
| model | Literal['STD', 'Parkinson', 'Garman-Klass', 'Hodges-Tompkins', 'Rogers-Satchell', 'Yang-Zhang'] | The model used to calculate realized volatility | STD | False |
| is_crypto | bool | Whether the data is crypto or not. If True, volatility is calculated for 365 days instead of 252 | False | False |
| trading_periods | int | Number of trading periods in a year. | None | True |
Returns
OBBject
results : List[Data]
The cones data.