Track trade entries canceled by user.
This commit is contained in:
parent
c54919e4ce
commit
fb7c0792c0
@ -297,6 +297,7 @@ class Backtesting:
|
|||||||
self.rejected_trades = 0
|
self.rejected_trades = 0
|
||||||
self.timedout_entry_orders = 0
|
self.timedout_entry_orders = 0
|
||||||
self.timedout_exit_orders = 0
|
self.timedout_exit_orders = 0
|
||||||
|
self.canceled_trade_entries = 0
|
||||||
self.dataprovider.clear_cache()
|
self.dataprovider.clear_cache()
|
||||||
if enable_protections:
|
if enable_protections:
|
||||||
self._load_protections(self.strategy)
|
self._load_protections(self.strategy)
|
||||||
@ -884,6 +885,7 @@ class Backtesting:
|
|||||||
return True
|
return True
|
||||||
elif self.check_order_replace(trade, order, current_time, row):
|
elif self.check_order_replace(trade, order, current_time, row):
|
||||||
# delete trade due to user request
|
# delete trade due to user request
|
||||||
|
self.canceled_trade_entries += 1
|
||||||
return True
|
return True
|
||||||
# default maintain trade
|
# default maintain trade
|
||||||
return False
|
return False
|
||||||
@ -1087,6 +1089,7 @@ class Backtesting:
|
|||||||
'rejected_signals': self.rejected_trades,
|
'rejected_signals': self.rejected_trades,
|
||||||
'timedout_entry_orders': self.timedout_entry_orders,
|
'timedout_entry_orders': self.timedout_entry_orders,
|
||||||
'timedout_exit_orders': self.timedout_exit_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']),
|
'final_balance': self.wallets.get_total(self.strategy.config['stake_currency']),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user