TradeFlag#

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

class TradeFlag[source]#

Bases: Enum

Trade execution flags.

Added on TradeExecution.flags to give the execution more context about this trade.

A trade can have multiple flags. E.g. open and increase should be always set together.

__init__()#

Attributes

open

This trade opens a position

close

This trade closes a position

increase

Increase existing position exposure

reduce

Reduce existing position exposure

close_protocol_last

This trade closes a last position in the protocol.

test_trade

This is a test trade made when testing out trade executor infrastructure.

open = 'open'#

This trade opens a position

close = 'close'#

This trade closes a position

increase = 'increase'#

Increase existing position exposure

reduce = 'reduce'#

Reduce existing position exposure

close_protocol_last = 'close_protocol_last'#

This trade closes a last position in the protocol.

Used to release collateral interest from Aave.

test_trade = 'test_trade'#

This is a test trade made when testing out trade executor infrastructure.

The trade was performed by perform-test-trade command line command, not a strategy itself.

Test trades should not count towards strategy success metrics.