quantlab.factor.predefined.alpha158.Alpha158Stock#
- class quantlab.factor.predefined.alpha158.Alpha158Stock(factor_config)[source]#
Bases:
FactorKunQuantAlpha158 factors over adjusted US-equity bars, z-scored across symbols.
Reads only the split- and dividend-adjusted series
adjOpen,adjHigh,adjLow,adjCloseandadjVolume; list exactly these indata_columns. TheVWAPfeatures use the adjusted typical price(adjHigh + adjLow + adjClose) / 3instead of the usualamount / 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 inCrossSectionalZScore, as inAlpha101Stock: these features feed cross-sectional strategies, so each one is standardized across the symbols of the same bar. The graphs come fromquantlab.factor.predefined._support.kunquant_alpha158and are built insidemissing_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_columnslists the five adjusted columns above andfactor_namesselects 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")