quantlab.factor.predefined.alpha101.Alpha101Stock#

class quantlab.factor.predefined.alpha101.Alpha101Stock(factor_config)[source]#

Bases: FactorKunQuant

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

Reads adjOpen, adjHigh, adjLow, adjClose and adjVolume, the split- and dividend-adjusted series. Every output is wrapped in CrossSectionalZScore: 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 from quantlab.factor.predefined._support.kunquant_alpha101 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 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_columns lists the five adjusted columns above and factor_names selects which alphas to compute (all 101 when unset).

Notes

The stock stores carry no dollar-volume column, so the graph passes no amount input. KunQuant’s Alpha101.AllData would otherwise compute VWAP as amount / volume (and raise “Bad inputs” without it), so the graph passes the adjusted typical price (adjHigh + adjLow + adjClose) / 3 as vwap, as Alpha158Stock does.

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")