freeze_position_on_failed_trade#

freeze_position_on_failed_trade(ts, state, trades)[source]#

Move positions of failed sell trades to freeze list.

Iterate through all resolved trades. If any of the trades is failed, freeze its trading position and move the position under the frozen position management. Any base tokens will be added to the blacklist.

Returns:

Tuple List of succeeded trades, List of failed trades

Parameters:
Return type:

Tuple[List[TradeExecution], List[TradeExecution]]