add filled time
This commit is contained in:
@@ -534,7 +534,7 @@ class Backtesting:
|
||||
if sell.sell_flag:
|
||||
trade.close_date = sell_candle_time
|
||||
|
||||
trade_dur = int((trade.close_date_utc - trade.filled_date_utc).total_seconds() // 60)
|
||||
trade_dur = int((trade.close_date_utc - trade.buy_filled_date_utc).total_seconds() // 60)
|
||||
try:
|
||||
closerate = self._get_close_rate(sell_row, trade, sell, trade_dur)
|
||||
except ValueError:
|
||||
@@ -960,6 +960,7 @@ class Backtesting:
|
||||
if order and self._get_order_filled(order.price, row):
|
||||
order.close_bt_order(current_time)
|
||||
trade.open_order_id = None
|
||||
trade.buy_filled_date = current_time
|
||||
LocalTrade.add_bt_trade(trade)
|
||||
self.wallets.update()
|
||||
|
||||
|
Reference in New Issue
Block a user