TradeFlag#
API documentation for tradeexecutor.state.trade.TradeFlag Python class in Trading Strategy framework.
- class TradeFlag[source]#
Bases:
EnumTrade execution flags.
Added on
TradeExecution.flagsto give the execution more context about this trade.A trade can have multiple flags. E.g.
openandincreaseshould be always set together.- __init__(*args, **kwds)#
Attributes
This trade opens a position
This trade closes a position
Increase existing position exposure
Reduce existing position exposure
This trade closes a last position in the protocol.
This is a test trade made when testing out trade executor infrastructure.
This trade is a trigger order.
The trade was made to associate unknown tokens to a position
This trade is a partial take profit
If there is an existing open position, do not try to match the trade for an open position.
- 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.
- triggered = 'triggered'#
This trade is a trigger order.
Set when
TradeExecution.triggersis filled
- missing_position_repair = 'missing_position_repair'#
The trade was made to associate unknown tokens to a position
- partial_take_profit = 'partial_take_profit'#
This trade is a partial take profit
- ignore_open = 'ignore_open'#
If there is an existing open position, do not try to match the trade for an open position.
We trade by pair. If in same cycle we close and open position for the same pair, the trade would count against the closed pair and not correctly accounted for.
This is for the case that we recall all Aave credit at the start of the cycle, then put it back at the end of the cycle.