factor_agent.period_lag#

Period lags read from data: the lag columns PeriodLag(x, k) reads, computed when a factor is.

A lag column (Vocabulary.lag_columns) is no column of the price dataset but a derived column (factor_agent.derived): its provider, PeriodLags, reads the field’s column and the key column of its family (the period end of the report each bar shows) and computes it with quantlab’s report_lags, as FundamentalAlpha computes its report lags. On a bar showing report r, the value k periods ago is the last value shown during the k-th earlier report shown; it is missing unless that report’s period ends k * days (within tolerance_days) before the current one, so a skipped or missing report never passes for an earlier period. A key that is a date counts in days; a numeric key is used as it is.

A lag of k periods reads (k + 2) * bars bars before the first bar it computes: the k earlier periods, the current one and one more for a late filing.

Each lag column is described by a mapping, as Vocabulary.lag_columns gives it: column (the field’s dataset column), k, key, days, tolerance_days and bars.

Classes

PeriodLags

The lag columns lags (read), filled from the daily panel; see the module docstring.

Functions

providers

The provider of the lag columns lags, in a list; none without any.

read

The entries of lag_columns (Vocabulary.lag_columns) for the columns inputs, by sorted name.

warmup_bars

The bars before the first computed bar the lags read; 0 without any.