modular_trader.framework.order_execution.threshold#

Classes#

ThresholdDeviationOrderExecution

Execute orders when any current positions deviate from the allocation targets by certain threshold in percentage.

Module Contents#

class modular_trader.framework.order_execution.threshold.ThresholdDeviationOrderExecution#

Bases: modular_trader.framework.order_execution.instant.InstantOrderExecution

Inheritance diagram of modular_trader.framework.order_execution.threshold.ThresholdDeviationOrderExecution

Execute orders when any current positions deviate from the allocation targets by certain threshold in percentage.

The threshold is in decimal format; e.g. 0.05 = 5%

Args:

threshold (float, optional): The threshold in decimal format. Defaults to 0.05.

run(context: modular_trader.context.Context, allocations: modular_trader.allocation.AllocationCollection) None#

Execute orders from the given allocations.

This method is called by __call__() and should not be called directly.

Parameters:
Return type:

None

threshold: float = None#