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.

obb.technical.cones(data: Union[list, dict, pd.DataFrame, List[pd.DataFrame], pd.Series, List[pd.Series], numpy.ndarray, Data, List[Data]], index: str = date, lower_q: float = 0.25, upper_q: float = 0.75, model: Literal[str] = STD, is_crypto: bool = False, trading_periods: int = None)

Parameters​

NameTypeDescriptionDefaultOptional
dataList[Data]The data to use for the calculation.NoneFalse
indexstrIndex column name to use with data, by default "date"dateTrue
lower_qfloatThe lower quantile value for calculations0.25True
upper_qfloatThe upper quantile value for calculations0.75True
modelLiteral["STD", "Parkinson", "Garman-Klass", "Hodges-Tompkins", "Rogers-Satchell", "Yang-Zhang"]The model used to calculate realized volatility
Standard deviation measures how widely returns are dispersed from the average return.
It is the most common (and biased) estimator of volatility.

Parkinson volatility uses the high and low price of the day rather than just close to close prices.
It is useful for capturing large price movements during the day.

Garman-Klass volatility extends Parkinson volatility by taking into account the opening and closing price.
As markets are most active during the opening and closing of a trading session;
it makes volatility estimation more accurate.

Hodges-Tompkins volatility is a bias correction for estimation using an overlapping data sample.
It produces unbiased estimates and a substantial gain in efficiency.

Rogers-Satchell is an estimator for measuring the volatility with an average return not equal to zero.
Unlike Parkinson and Garman-Klass estimators, Rogers-Satchell incorporates a drift term,
mean return not equal to zero.

Yang-Zhang volatility is the combination of the overnight (close-to-open volatility).
It is a weighted average of the Rogers-Satchell volatility and the open-to-close volatility. | STD | True |

| is_crypto | bool | Whether the data is crypto or not. If True, volatility is calculated for 365 days instead of 252 | False | True | | trading_periods | int] [default: 252 | Number of trading periods in a year. | None | True |


Returns​

The cones data.

On this page