quantlab.factor.predefined.intraday.IntradayParameters#

class quantlab.factor.predefined.intraday.IntradayParameters(session_bars=390, edge_bars=30, min_returns=60)[source]#

Bases: object

Parameters of IntradayStats, read from config.kwargs.

Parameters:
session_barsint, default 390

Bars of the longest session (390 one-minute bars, 09:30-16:00); a longer session is refused, and the first session_bars - 1 bars computed are NaN.

edge_barsint, default 30

Bars of the opening and closing part of the session in ret_open30, ret_close30 and volume_close30.

min_returnsint, default 60

Fewest bars with a trade a session needs for its statistics.

Examples

>>> IntradayParameters.from_kwargs({"min_returns": 120}).min_returns
120
classmethod from_kwargs(kwargs)[source]#

Build the parameters from kwargs, refusing unknown keys.

Raises:
ValueError

If a key is unknown or a value is not a positive integer, or edge_bars is not below session_bars.

Examples

>>> IntradayParameters.from_kwargs(None) == IntradayParameters()
True