modular_trader.framework.order_execution.instant#

Classes#

InstantOrderExecution

Instantly execute orders from allocations

Module Contents#

class modular_trader.framework.order_execution.instant.InstantOrderExecution#

Bases: modular_trader.framework.order_execution.base.BaseOrderExecution

Inheritance diagram of modular_trader.framework.order_execution.instant.InstantOrderExecution

Instantly execute orders from allocations

Iterate through all allocations and place the corresponding orders. If an order is already pending, skip it. If the allocation is an AllocationTarget, close the position if weight is 0, otherwise place an order to set the weight to the target value. If the allocation is an AllocationAdjustment, place an order to adjust the weight by the target value.

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