Skip to main content

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​

NameTypeDescriptionDefaultOptional
dataList[Data]The data to use for the calculation.False
indexstrIndex column name to use with data, by default "date"dateFalse
lower_qfloatThe lower quantile value for calculations0.25False
upper_qfloatThe upper quantile value for calculations0.75False
modelLiteral['STD', 'Parkinson', 'Garman-Klass', 'Hodges-Tompkins', 'Rogers-Satchell', 'Yang-Zhang']The model used to calculate realized volatilitySTDFalse
is_cryptoboolWhether the data is crypto or not. If True, volatility is calculated for 365 days instead of 252FalseFalse
trading_periodsintNumber of trading periods in a year.NoneTrue

Returns​

OBBject
results : List[Data]
The cones data.