quantlab.factor.predefined.alpha101.Alpha101SpotKline#
- class quantlab.factor.predefined.alpha101.Alpha101SpotKline(factor_config)[source]#
Bases:
TimeSeriesZScoredFactorAlpha101 factors over crypto spot klines, z-scored along time.
Reads the lowercase
open,high,low,close,volumeandamount(traded value in quote currency) columns of the spot kline dataset. Every output is wrapped inWindowedZScoreoverzscore_windowbars (kwargs["zscore_window"], default 20), which standardizes each symbol against its own trailing window. That time-series normalization suits the strategies spot data is traded with here, which follow one asset over time. The US-equity siblingAlpha101Stockz-scores across symbols instead, because it serves cross-sectional strategies that compare symbols on the same bar. The two classes are intentionally different.- Parameters:
- factor_configFactorConfig
The KunQuant factor config.
kwargs["zscore_window"]sets the z-score window.warmup_barsmust cover the longest alpha lookback pluszscore_window - 1bars for the first requested bar to be fully normalized.data_columnslists the six input columns above, andfactor_namesselects which alphas to compute (all 101 when unset).
Examples
>>> factor = Alpha101SpotKline(FactorConfig( ... warmup_bars=60, dataset=dataset, mode="batch", ... data_columns=["open", "high", "low", "close", "volume", "amount"], ... factor_names=["alpha001", "alpha002"], kwargs={"zscore_window": 20}, ... file_path="alpha101.zarr", ... )) >>> panel = factor.compute("2024-01-01", "2024-06-30")