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:
BaseFactorConfigConfig of
quantlab.factor.predefined.market.MarketFeatures.datasetis the target: the panel whose symbols receive the market features, and the calendarwarmup_barsis counted on.seriesnames the index or ETF datasets the features are computed from, one single-symbol dataset per name; the name prefixes the features, as inspy_ret_mean_20.seriesis a component field, soto_dict()nests each series dataset’s config dict under it andMarketFeatures.from_configrebuilds them.Examples
With
stocksthe target dataset andspya 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.