Track trade entries canceled by user.

This commit is contained in:
eSeR1805 2022-05-17 01:41:01 +03:00
parent c54919e4ce
commit fb7c0792c0
No known key found for this signature in database
GPG Key ID: BA53686259B46936

View File

@ -297,6 +297,7 @@ class Backtesting:
self.rejected_trades = 0
self.timedout_entry_orders = 0
self.timedout_exit_orders = 0
self.canceled_trade_entries = 0
self.dataprovider.clear_cache()
if enable_protections:
self._load_protections(self.strategy)
@ -884,6 +885,7 @@ class Backtesting:
return True
elif self.check_order_replace(trade, order, current_time, row):
# delete trade due to user request
self.canceled_trade_entries += 1
return True
# default maintain trade
return False
@ -1087,6 +1089,7 @@ class Backtesting:
'rejected_signals': self.rejected_trades,
'timedout_entry_orders': self.timedout_entry_orders,
'timedout_exit_orders': self.timedout_exit_orders,
'canceled_trade_entries': self.canceled_trade_entries,
'final_balance': self.wallets.get_total(self.strategy.config['stake_currency']),
}