modular_trader.framework.signal_generation#
Submodules#
Classes#
Abstract base class for signal generation. |
|
Constant signal generator. |
|
Signal generation strategy that doesn't generate any signals. |
Package Contents#
- class modular_trader.framework.signal_generation.BaseSignalGeneration#
Bases:
abc.ABC
Abstract base class for signal generation.
- Attributes:
- context: Context
The framework context.
- universe: AssetUniverse
The asset universe to generate signals for.
- Methods:
- run(context: Context, universe: AssetUniverse) -> Iterable[Signal]:
Must be implemented by subclasses. Called by __call__() to generate signals.
- __call__(context: modular_trader.context.Context, universe: modular_trader.universe.AssetUniverse)#
Generate signals.
- Args:
- context: Context
The framework context.
- universe: AssetUniverse
The asset universe to generate signals for.
- Returns:
- Iterable[Signal]:
An iterable of signals.
- Parameters:
context (modular_trader.context.Context)
universe (modular_trader.universe.AssetUniverse)
- abstract run(context: modular_trader.context.Context, universe: modular_trader.universe.AssetUniverse) Iterable[modular_trader.signal.Signal] #
Must be implemented by subclasses.
Called by __call__() to generate signals.
- Parameters:
context (modular_trader.context.Context)
universe (modular_trader.universe.AssetUniverse)
- Return type:
Iterable[modular_trader.signal.Signal]
- class modular_trader.framework.signal_generation.ConstantSignalGeneration#
Bases:
modular_trader.framework.signal_generation.base.BaseSignalGeneration
Constant signal generator.
Generates a signal for each symbol in the universe with a constant direction.
- run(context: modular_trader.context.Context, universe: modular_trader.universe.AssetUniverse) Iterable[modular_trader.signal.Signal] #
Returns an iterable of constant signals.
- Args:
context: Context universe: AssetUniverse
- Returns:
An iterable of signals.
- Parameters:
context (modular_trader.context.Context)
universe (modular_trader.universe.AssetUniverse)
- Return type:
Iterable[modular_trader.signal.Signal]
- direction: modular_trader.signal.SignalDirection = None#
- class modular_trader.framework.signal_generation.NullSignalGeneration#
Bases:
modular_trader.framework.signal_generation.base.BaseSignalGeneration
Signal generation strategy that doesn’t generate any signals.
This signal generation strategy is useful for testing or debugging purposes.
- run(context: modular_trader.context.Context, universe: modular_trader.universe.AssetUniverse) Iterable[None] #
Returns an empty iterable of signals.
- Parameters:
context (modular_trader.context.Context)
universe (modular_trader.universe.AssetUniverse)
- Return type:
Iterable[None]