quantlab.factor.predefined.alpha158.Alpha158Stock#

class quantlab.factor.predefined.alpha158.Alpha158Stock(factor_config)[source]#

Bases: FactorKunQuant

Alpha158 factors over adjusted US-equity bars, z-scored across symbols.

Reads only the split- and dividend-adjusted series adjOpen, adjHigh, adjLow, adjClose and adjVolume; list exactly these in data_columns. The VWAP features use the adjusted typical price (adjHigh + adjLow + adjClose) / 3 instead of the usual amount / volume. The stock stores carry no dollar-volume column, and dividing a raw amount by a split-adjusted volume would jump at every split. Every output is wrapped in CrossSectionalZScore, as in Alpha101Stock: these features feed cross-sectional strategies, so each one is standardized across the symbols of the same bar. The graphs come from quantlab.factor.predefined._support.kunquant_alpha158 and are built inside missing_bars_only: a symbol with no bar that day is NaN in every operator, so it stays out of the z-score, and every other value is KunQuant’s.

Parameters:
factor_configFactorConfig

The KunQuant factor config. data_columns lists the five adjusted columns above and factor_names selects which features to compute (all when unset).

Examples

>>> factor = Alpha158Stock(FactorConfig(
...     warmup_bars=10, dataset=dataset, mode="batch",
...     data_columns=["adjOpen", "adjHigh", "adjLow", "adjClose",
...                   "adjVolume"],
...     factor_names=["KMID", "STD5"], file_path="alpha158_stock.zarr",
... ))
>>> panel = factor.compute("2024-01-01", "2024-06-30")