quantlab.factor.predefined.alpha101.Alpha101Stock#
- class quantlab.factor.predefined.alpha101.Alpha101Stock(factor_config)[source]#
Bases:
FactorKunQuantAlpha101 factors over adjusted US-equity bars, z-scored across symbols.
Reads
adjOpen,adjHigh,adjLow,adjCloseandadjVolume, the split- and dividend-adjusted series. Every output is wrapped inCrossSectionalZScore: US equities are traded here with cross-sectional strategies, so each alpha is standardized across the symbols of the same bar, never along a symbol’s own history. The graphs come fromquantlab.factor.predefined._support.kunquant_alpha101and are built insidemissing_bars_only: a symbol with no bar that day is NaN in every operator, so it stays out of the ranks and the z-score, and every other value is KunQuant’s, including the 0 its formulas give a value that is undefined on real data.- Parameters:
- factor_configFactorConfig
The KunQuant factor config.
data_columnslists the five adjusted columns above andfactor_namesselects which alphas to compute (all 101 when unset).
Notes
The stock stores carry no dollar-volume column, so the graph passes no
amountinput. KunQuant’sAlpha101.AllDatawould otherwise compute VWAP asamount / volume(and raise “Bad inputs” without it), so the graph passes the adjusted typical price(adjHigh + adjLow + adjClose) / 3asvwap, asAlpha158Stockdoes.Examples
>>> factor = Alpha101Stock(FactorConfig( ... warmup_bars=20, dataset=dataset, mode="batch", ... data_columns=["adjOpen", "adjHigh", "adjLow", "adjClose", ... "adjVolume"], ... file_path="alpha101_stock.zarr", ... )) >>> panel = factor.compute("2024-01-01", "2024-06-30")