ApprovalModel#

tradeexecutor.strategy.approval.ApprovalModel Python class in Trading Strategy framework.

class ApprovalModel[source]#

Bases: ABC

A model that defines a checkpoint for trades before they are executd.

Approval can be get in various ways - CLI confirmation by human - Web interface confirmation by human - A third party automated risk management system

__init__()#

Methods

__init__()

confirm_trades(state, trades)

This function may wait forever and block the trade execution thread.

confirm_trades(state, trades)[source]#

This function may wait forever and block the trade execution thread. It is up to the approval internals to decide when to timeout and what to od in such situation.

Parameters:
  • state (State) – Current portfolio management states

  • trades (List[TradeExecution]) – Trades suggested bt the strategy

Returns:

Filtered list of trades that should be executed

Return type:

List[TradeExecution]