quantlab.factor.predefined.literature_alpha.LiteratureAlphaParameters#
- class quantlab.factor.predefined.literature_alpha.LiteratureAlphaParameters(high_52week_window=252, short_reversal_window=21, max_return_window=21, idio_vol_window=21, amihud_window=21, ff3_ridge=1e-10, determinant_floor=1e-24, variance_floor=1e-14, denominator_floor=1e-12, dollar_volume_floor=1.0, amihud_scale=1000000.0, emit_diagnostics=False, fama_french_csv=None, return_column='ret', split_adjusted_close_column='adjClose', raw_close_column='close', volume_column='volume', risk_free_column='risk_free', market_column='mkt_rf', smb_column='smb', hml_column='hml', gross_profit_column='gross_profit', total_assets_column='total_assets', prior_year_total_assets_column='prior_year_total_assets', eps_actual_event_column='eps_actual_event', eps_consensus_event_column='eps_consensus_event', eps_scale_price_event_column='eps_scale_price_event')[source]#
Bases:
objectFormula settings and panel-column aliases for
LiteratureAlpha.Every field is read from
FactorConfig.kwargs. Windows count bars of the input panel, so the daily defaults use 252 bars for one year and 21 bars for one month. Fundamental and earnings-event inputs must already be point-in-time aligned by the caller.- Parameters:
- high_52week_windowint, default 252
Bars in the rolling price high.
- short_reversal_windowint, default 21
Bars compounded for the short-term reversal signal.
- max_return_windowint, default 21
Bars searched for the maximum daily return.
- idio_vol_windowint, default 21
Bars in the Fama-French three-factor regression.
- amihud_windowint, default 21
Bars averaged for the Amihud price-impact ratio.
- ff3_ridgefloat, default 1e-10
Ridge added to the three factor variances.
- determinant_floor, variance_floor, denominator_floorfloat
Positive numerical safeguards.
- dollar_volume_floorfloat, default 1.0
Smallest valid raw-close times raw-volume observation.
- amihud_scalefloat, default 1e6
Positive scale applied before taking the logarithm.
- emit_diagnosticsbool, default False
Whether default outputs include MAX, IVOL, the betas and determinant.
- fama_french_csvstr or None, default None
Optional daily Fama-French CSV. When set, FF3 series are injected in batch mode instead of read from the panel.
- *_columnstr
Panel variable names used by each formula.
- property ff3_columns#
Return the four graph names supplied by the FF3 panel or CSV.
- classmethod from_config(config)[source]#
Build validated parameters from
config.kwargs.- Parameters:
- configFactorConfig
Factor configuration carrying optional overrides.
- Returns:
- LiteratureAlphaParameters
Validated immutable parameters.
- Raises:
- ValueError
If a key is unknown or a value is invalid.
- required_panel_columns(outputs)[source]#
Return panel inputs needed by
outputs, preserving stable order.Fama-French inputs are omitted when
fama_french_csvis set because the factor broadcasts them into the batch graph itself.- Parameters:
- outputstuple of str
Selected factor or diagnostic output names.
- Returns:
- tuple of str
Exact set of columns
FactorConfig.data_columnsmust name.