Update ftx stoploss logic to properly detect correct trades

closes #5045
This commit is contained in:
Matthias
2021-06-13 11:06:34 +02:00
parent a05e38dbd3
commit d35b2e3b8f
3 changed files with 33 additions and 6 deletions

View File

@@ -816,8 +816,13 @@ class FreqtradeBot(LoggingMixin):
logger.warning('Stoploss order was cancelled, but unable to recreate one.')
# Finally we check if stoploss on exchange should be moved up because of trailing.
if stoploss_order and (self.config.get('trailing_stop', False)
or self.config.get('use_custom_stoploss', False)):
# Triggered Orders are now real orders - so don't replace stoploss anymore
if (
stoploss_order
and stoploss_order.get('status_stop') != 'triggered'
and (self.config.get('trailing_stop', False)
or self.config.get('use_custom_stoploss', False))
):
# if trailing stoploss is enabled we check if stoploss value has changed
# in which case we cancel stoploss order and put another one with new
# value immediately