Lock execute_entry to prevent timing hickups

This commit is contained in:
Matthias 2022-11-25 14:50:48 +01:00
parent c593cdc438
commit 1b3e62bcbc
2 changed files with 22 additions and 20 deletions

View File

@ -381,6 +381,7 @@ class FreqtradeBot(LoggingMixin):
trades = Trade.get_open_trades_without_assigned_fees()
for trade in trades:
with self._exit_lock:
if trade.is_open and not trade.fee_updated(trade.entry_side):
order = trade.select_order(trade.entry_side, False)
open_order = trade.select_order(trade.entry_side, True)

View File

@ -789,6 +789,7 @@ class RPC:
if not order_type:
order_type = self._freqtrade.strategy.order_types.get(
'force_entry', self._freqtrade.strategy.order_types['entry'])
with self._freqtrade._exit_lock:
if self._freqtrade.execute_entry(pair, stake_amount, price,
ordertype=order_type, trade=trade,
is_short=is_short,