quantlab.factor.predefined.roster.RosterFactor#
- class quantlab.factor.predefined.roster.RosterFactor(config)[source]#
Bases:
FactorViewThe outputs of
config.factoron the symbols ofconfig.roster.The roster is the symbol axis of the roster dataset’s store, read on every call, so it follows the store as members are added. It is cast to the type of the wrapped panel’s symbol axis (an integer permaticker axis against a text one) and the symbols the wrapped panel lacks are dropped, the count logged on a read or a computation: a symbol without values is a fact of the data, not an error. The kept symbols are in the wrapped panel’s order.
readreads the wrapped factor’s store on the kept symbols, so only those are read and fingerprinted.computecomputes the wrapped factor on its whole dataset and cuts afterwards: a cross-sectional factor standardizes over the whole market, so computing it on the roster alone would change its values. The store queries are a view’s (seeFactorView):store_pathisNone,store_uses()reads the wrapped factor’s store,store_range()is the wrapped factor’s,owns_store()is false andbuildandextendare refused, so a live day extends the wrapped store only through its owner.- Parameters:
- configRosterConfig
The wrapped
factorand therosterdataset.
Examples
With
stylesa factor pinned tobof a store holdinga, b, con symbols 1..5, androstera dataset on symbols 2 and 4:>>> factor = RosterFactor(RosterConfig(factor=styles, roster=roster)) >>> panel = factor.read("2024-01-05", "2024-01-10") >>> list(panel.data_vars), panel["symbol"].values.tolist() (['b'], ['2', '4']) >>> factor.stored_symbols() ['2', '4']
- config_cls#
The config class
from_configrebuilds this factor with.alias of
RosterConfig