TradeType#

API documentation for tradeexecutor.state.trade.TradeType Python class in Trading Strategy framework.

class TradeType[source]#

Bases: Enum

What kind of trade execution this was.

__init__(*args, **kwds)#

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

market_limit

Market limit position opening

repair

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

accounting_correction

Internal state balances are updated to match on-chain balances

flexible_trigger

Partial take profit, etc.

rebalance = 'rebalance'#

A normal trade with strategy decision

Trigger trades are also rebalances.

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

market_limit = 'market_limit'#

Market limit position opening

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

flexible_trigger = 'flexible_trigger'#

Partial take profit, etc.