quantlab.factor.predefined.alternative_alpha.AlternativeAlphaParameters#

class quantlab.factor.predefined.alternative_alpha.AlternativeAlphaParameters(volume_window=21, short_change_window=21, short_volume_window=21, news_window=63, announcement_bars=3, announcement_hold=63, event_window=252, ownership_floor=0.01, denominator_floor=1e-09, ranked=False)[source]#

Bases: object

Windows of AlternativeAlpha, read from FactorConfig.kwargs.

Parameters:
volume_windowint, default 21

Bars of mean volume in days_to_cover.

short_change_windowint, default 21

Bars back of short_interest_change (about two FINRA releases).

short_volume_windowint, default 21

Bars summed by short_volume_ratio.

news_windowint, default 63

Bars summed by the news outputs.

announcement_barsint, default 3

Bars of the earnings announcement return, ending the bar after the filing is available.

announcement_holdint, default 63

Bars an announcement return is averaged over after it is known.

event_windowint, default 252

Bars summed by the event counts.

ownership_floorfloat, default 0.01

Smallest institutional ownership short_constraint divides by.

denominator_floorfloat, default 1e-9

Smallest denominator of a ratio; smaller gives NaN.

rankedbool, default False

Whether each output is its cross-sectional percentile rank (the input NeutralizedFactor should wrap).

classmethod from_config(config)[source]#

Build validated parameters from config.kwargs.

Raises:
ValueError

If a key is unknown or a value is invalid.

static required_panel_columns(outputs)[source]#

Return the exact data_columns outputs read, in a stable order.

Examples

>>> AlternativeAlphaParameters.required_panel_columns(("days_to_cover", "activist_13d"))
('short_interest', 'volume', 'event_35', 'adjClose')