quantlab.label.config.ForwardConfig#

class quantlab.label.config.ForwardConfig(*, factor, span, delay=1, name=None)[source]#

Bases: FrozenConfig

Config of a Forward label: the factor it shifts and by how much.

The label at bar t is factor at bar t + delay + span. A Forward owns no store, so the config has no path or warm-up of its own; the wrapped factor keeps its config. factor is a component field, so to_dict() nests the factor’s config dict under it and Forward.from_config rebuilds it.

Examples

With factor a factor built earlier:

>>> cfg = ForwardConfig(factor=factor, span=5)
>>> cfg.span, cfg.delay
(5, 1)
delay = 1#

Bars between the bar a signal forms on and the first bar the label counts; 1 because a signal at t fills at t+1’s open.

factor#

The factor shifted forward to make the label.

name = None#

Dotted import path of the label class; filled by the config setter.

span#

Bars the label accumulates over, such as the n bars of an n-bar forward return.