Fix backtesting bug where trade.amount didn't equal the filled order amount

This commit is contained in:
Matthias
2022-07-21 20:33:30 +02:00
parent 395e9e46c1
commit 9382c4bd75
2 changed files with 3 additions and 4 deletions

View File

@@ -178,10 +178,9 @@ class Order(_DECL_BASE):
self.remaining = 0
self.status = 'closed'
self.ft_is_open = False
if (self.ft_order_side == trade.entry_side
and len(trade.select_filled_orders(trade.entry_side)) == 1):
if (self.ft_order_side == trade.entry_side):
trade.open_rate = self.price
trade.recalc_open_trade_value()
trade.recalc_trade_from_orders()
trade.adjust_stop_loss(trade.open_rate, trade.stop_loss_pct, refresh=True)
@staticmethod