Compare >= instead of =
This commit is contained in:
parent
3208f30c30
commit
c649f9844e
@ -705,7 +705,7 @@ class FreqtradeBot:
|
|||||||
if trade.stop_loss > float(order['info']['stopPrice']):
|
if trade.stop_loss > float(order['info']['stopPrice']):
|
||||||
# we check if the update is neccesary
|
# we check if the update is neccesary
|
||||||
update_beat = self.strategy.order_types.get('stoploss_on_exchange_interval', 60)
|
update_beat = self.strategy.order_types.get('stoploss_on_exchange_interval', 60)
|
||||||
if (datetime.utcnow() - trade.stoploss_last_update).total_seconds() > update_beat:
|
if (datetime.utcnow() - trade.stoploss_last_update).total_seconds() >= update_beat:
|
||||||
# cancelling the current stoploss on exchange first
|
# cancelling the current stoploss on exchange first
|
||||||
logger.info('Trailing stoploss: cancelling current stoploss on exchange (id:{%s})'
|
logger.info('Trailing stoploss: cancelling current stoploss on exchange (id:{%s})'
|
||||||
'in order to add another one ...', order['id'])
|
'in order to add another one ...', order['id'])
|
||||||
|
@ -1449,8 +1449,8 @@ def test_tsl_on_exchange_compatible_with_edge(mocker, edge_conf, fee, caplog,
|
|||||||
# setting stoploss
|
# setting stoploss
|
||||||
freqtrade.strategy.stoploss = -0.02
|
freqtrade.strategy.stoploss = -0.02
|
||||||
|
|
||||||
# setting stoploss_on_exchange_interval to -1 second since this test runs fast
|
# setting stoploss_on_exchange_interval to 0 seconds
|
||||||
freqtrade.strategy.order_types['stoploss_on_exchange_interval'] = -1
|
freqtrade.strategy.order_types['stoploss_on_exchange_interval'] = 0
|
||||||
|
|
||||||
patch_get_signal(freqtrade)
|
patch_get_signal(freqtrade)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user