quantlab.portfolio.decision_inputs.PanelReads#

class quantlab.portfolio.decision_inputs.PanelReads(tradable, factors=None, risk_exposures=None, risk_estimates=None)[source]#

Bases: object

What DecisionInputs.panel reads besides the predictions and prices, for a range of bars.

DecisionInputs.panel_reads reads it once over many blocks; each panel call slices its block’s bars from it.

Attributes:
tradablexr.DataArray

Booleans on (timestamp, symbol): the dataset’s tradable_bars.

factorsxr.Dataset or None

The rule’s declared factors on (timestamp, symbol), None when it declares none.

risk_exposures, risk_estimatesxr.Dataset or None

A declared factor risk model’s exposures and its estimate store’s rows (None when the store has none in the range); both None without a declared risk model.

Examples

>>> reads = inputs.panel_reads(ts[0], ts[3])
>>> reads.tradable.dims
('timestamp', 'symbol')