quantlab.factor.predefined.market#

Market features: index or ETF series broadcast to every symbol of a panel.

A stock’s return depends partly on the market as a whole. MASTER (Li et al., AAAI 2024) feeds a model a few market features computed from broad indices, the same values for every stock on a date, and uses them to decide which stock features matter that day. MarketFeatures computes those inputs from one or more index or ETF price series (SPY, QQQ and IWM for US equities) and broadcasts them to the symbols of a target panel, so the result merges into a model’s panel like any other factor’s.

For each series the factor computes 21 features on the series’ own bars: the bar return ret = close / close[t-1] - 1 and, for each window d in 5, 10, 20, 30 and 60 bars, Mean(ret, d), Std(ret, d), Mean(amount, d) / amount and Std(amount, d) / amount, where amount is the dollar value traded in the bar (volume times close unless the store has its own column). This is the list of docs/research/qlib-gats-master.md section 2.1.

Classes

MarketFeatures

Index or ETF features, identical for every symbol that has a bar.