mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-12-03 10:33:08 +00:00
chore: improve left open trades handling
This commit is contained in:
@@ -1166,9 +1166,13 @@ class Backtesting:
|
||||
"""
|
||||
for pair in open_trades.keys():
|
||||
for trade in list(open_trades[pair]):
|
||||
if trade.has_open_orders and trade.nr_of_successful_entries == 0:
|
||||
if (
|
||||
trade.has_open_orders and trade.nr_of_successful_entries == 0
|
||||
) or not not trade.has_open_position:
|
||||
# Ignore trade if entry-order did not fill yet
|
||||
LocalTrade.remove_bt_trade(trade)
|
||||
continue
|
||||
|
||||
exit_row = data[pair][-1]
|
||||
self._exit_trade(
|
||||
trade, exit_row, exit_row[OPEN_IDX], trade.amount, ExitType.FORCE_EXIT.value
|
||||
|
||||
Reference in New Issue
Block a user