Use helper-method to modify trades_open

This commit is contained in:
Matthias 2022-10-16 13:19:42 +02:00
parent 2b70106019
commit e82baf5f60
2 changed files with 5 additions and 1 deletions

View File

@ -1125,7 +1125,7 @@ class Backtesting:
open_trade_count -= 1 open_trade_count -= 1
open_trade_count_start -= 1 open_trade_count_start -= 1
open_trades[pair].remove(t) open_trades[pair].remove(t)
LocalTrade.trades_open.remove(t) LocalTrade.remove_bt_trade(t)
self.wallets.update() self.wallets.update()
# 2. Process entries. # 2. Process entries.

View File

@ -1077,6 +1077,10 @@ class LocalTrade():
else: else:
LocalTrade.trades.append(trade) LocalTrade.trades.append(trade)
@staticmethod
def remove_bt_trade(trade):
LocalTrade.trades_open.remove(trade)
@staticmethod @staticmethod
def get_open_trades() -> List[Any]: def get_open_trades() -> List[Any]:
""" """