TradeType#

tradeexecutor.state.trade.TradeType Python class in Trading Strategy framework.

class TradeType[source]#

Bases: Enum

What kind of trade execution this was.

__init__()#

Attributes

rebalance

A normal trade with strategy decision

stop_loss

The trade was made because stop loss trigger reached

take_profit

The trade was made because take profit trigger reached

repair

This is an accounting counter trade to cancel a broken trade.

accounting_correction

Internal state balances are updated to match on-chain balances

rebalance = 'rebalance'#

A normal trade with strategy decision

stop_loss = 'stop_loss'#

The trade was made because stop loss trigger reached

take_profit = 'take_profit'#

The trade was made because take profit trigger reached

repair = 'repair'#

This is an accounting counter trade to cancel a broken trade.

  • The original trade is marked as repaied

  • This trade contains any reverse accounting variables needed to fix the position total

accounting_correction = 'accounting_correction'#

Internal state balances are updated to match on-chain balances