quantlab.factor.config.MarketFeatureConfig#

class quantlab.factor.config.MarketFeatureConfig(*, warmup_bars=60, dataset, file_path=None, factor_names=None, kwargs=None, resample_freq=None, resample_how=None, name=None, series)[source]#

Bases: BaseFactorConfig

Config of quantlab.factor.predefined.market.MarketFeatures.

dataset is the target: the panel whose symbols receive the market features, and the calendar warmup_bars is counted on. series names the index or ETF datasets the features are computed from, one single-symbol dataset per name; the name prefixes the features, as in spy_ret_mean_20. series is a component field, so to_dict() nests each series dataset’s config dict under it and MarketFeatures.from_config rebuilds them.

Examples

With stocks the target dataset and spy a dataset over one ETF:

>>> cfg = MarketFeatureConfig(dataset=stocks, series={"spy": spy})
>>> cfg.warmup_bars, list(cfg.series)
(60, ['spy'])
series#

Series name to the single-symbol dataset it is computed from, in the order the features are listed.

warmup_bars = 60#

Bars read before the requested start; 60 fills the longest window.