factor_agent.exported.GraphFactor#

class GraphFactor(config)[source]#

Bases: DerivedColumnsFactor

Recorded graphs, each ranked across the market, as one factor.

The graphs, name to Graph.to_json(), are the class’s GRAPHS (an exported factor) or, when it has none, config.kwargs["graphs"]; the class path of each operator they record, CLASSES or config.kwargs["classes"] (Vocabulary.class_paths); how each lag column they read is computed, PERIOD_LAGS or config.kwargs["period_lags"] (period_lags), none when neither is set; each output’s direction, DIRECTIONS or config.kwargs["directions"] (+1 when unset), turns it so a higher value means a higher return. A graph of an intraday family is its daily stage (staged): the intraday graph of each session column it reads is in SESSIONS or config.kwargs["sessions"], and the intraday dataset they run on, as a get_config() dict, in INTRADAY or config.kwargs["intraday"]. config.data_columns must hold every dataset column the graphs and their lags read (data_columns).

Inherited methods and attributes are documented on the base classes linked above.

Methods#

GraphFactor.data_columns

The daily dataset columns the recorded graphs read, with the columns and keys of their period_lags, sorted.

GraphFactor.period_lags

The entries of lag_columns (Vocabulary.lag_columns) the recorded graphs read.

GraphFactor.staged

Recorded graphs in their stages: each one's daily graph, by name, and every session column's intraday graph.

Attributes#

GraphFactor.CLASSES = {}#

Operator name -> class path, of every operator GRAPHS records; set by an exported subclass.

GraphFactor.DIRECTIONS = {}#

Output name -> its direction, +1 or -1; set by an exported subclass.

GraphFactor.GRAPHS = {}#

Output name -> Graph.to_json(); set by an exported subclass.

GraphFactor.INTRADAY = {}#

The intraday dataset SESSIONS runs on, as a get_config() dict; set by an exported subclass.

GraphFactor.PERIOD_LAGS = {}#

Lag column -> how it is computed, of every lag column GRAPHS reads; set by an exported subclass.

GraphFactor.SESSIONS = {}#

Session column -> its intraday graph, of every session column GRAPHS reads; set by an exported subclass.