OHLC#
- class quantflow.ta.ohlc.OHLC(*, serie: str, period: str | timedelta, index_column: str = 'index', parkinson_variance: bool = False, garman_klass_variance: bool = False, rogers_satchell_variance: bool = False, percent_variance: bool = False)#
Aggregates OHLC data over a given period and serie
Optionally calculates the range-based variance estimators for the serie. Range-based estimator are called like that because they are calculated from the difference between the period high and low.
Methods:
Adds Garman Klass variance estimator column to the dataframe
Adds parkinson variance column to the dataframe
Adds Rogers Satchell variance estimator column to the dataframe
Returns a polars expression for the OHLC column
Attributes:
add Garman Klass variance column
column to group by
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
add Parkinson variance column
log-transform the variance columns
down-sampling period, e.g. 1h, 1d, 1w.
add Rogers Satchell variance column
serie to aggregate
- garman_klass(df: DataFrame | DataFrame) DataFrame #
Adds Garman Klass variance estimator column to the dataframe
This requires the serie high and low columns to be present.
- parkinson(df: DataFrame | DataFrame) DataFrame #
Adds parkinson variance column to the dataframe
This requires the serie high and low columns to be present
- rogers_satchell(df: DataFrame | DataFrame) DataFrame #
Adds Rogers Satchell variance estimator column to the dataframe
This requires the serie high and low columns to be present.
- var_column(suffix: str) Expr #
Returns a polars expression for the OHLC column
- garman_klass_variance: bool#
add Garman Klass variance column
- index_column: str#
column to group by
- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- parkinson_variance: bool#
add Parkinson variance column
- percent_variance: bool#
log-transform the variance columns
- period: str | timedelta#
down-sampling period, e.g. 1h, 1d, 1w
- rogers_satchell_variance: bool#
add Rogers Satchell variance column
- serie: str#
serie to aggregate