quantlab.factor.predefined.roster.RosterFactor#

class quantlab.factor.predefined.roster.RosterFactor(config)[source]#

Bases: FactorView

The outputs of config.factor on the symbols of config.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.

read reads the wrapped factor’s store on the kept symbols, so only those are read and fingerprinted. compute computes 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 (see FactorView): store_path is None, store_uses() reads the wrapped factor’s store, store_range() is the wrapped factor’s, owns_store() is false and build and extend are refused, so a live day extends the wrapped store only through its owner.

Parameters:
configRosterConfig

The wrapped factor and the roster dataset.

Examples

With styles a factor pinned to b of a store holding a, b, c on symbols 1..5, and roster a 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_config rebuilds this factor with.

alias of RosterConfig