Set initial stoploss when creating the order

This ensures that a trade never has "None" as stoploss
This commit is contained in:
Matthias
2023-03-24 07:27:45 +01:00
parent 150c5510c7
commit 469166636c
3 changed files with 12 additions and 20 deletions

View File

@@ -810,6 +810,9 @@ class FreqtradeBot(LoggingMixin):
precision_mode=self.exchange.precisionMode,
contract_size=self.exchange.get_contract_size(pair),
)
stoploss = self.strategy.stoploss if not self.edge else self.edge.get_stoploss(pair)
trade.adjust_stop_loss(trade.open_rate, stoploss, initial=True)
else:
# This is additional buy, we reset fee_open_currency so timeout checking can work
trade.is_open = True