Skip to content

Commit d73119e

Browse files
committed
kwargs and done
1 parent 2dc270e commit d73119e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

backtesting/backtesting.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1692,7 +1692,7 @@ def initialize(self, **kwargs):
16921692
self._step_time = start
16931693
self._step_indicator_attrs = indicator_attrs
16941694

1695-
def next(self):
1695+
def next(self, done:bool|None=None, **kwargs):
16961696
"""
16971697
Move the backtest one time step forward and return the results for the current step.
16981698
@@ -1718,9 +1718,10 @@ def next(self):
17181718
pass
17191719

17201720
# Next tick, a moment before bar close
1721-
self._step_strategy.next()
1721+
self._step_strategy.next(**kwargs)
17221722
self._step_time += 1
1723-
else:
1723+
1724+
if done==True:
17241725
# Close any remaining open trades so they produce some stats
17251726
for trade in self._step_broker.trades:
17261727
trade.close()

0 commit comments

Comments
 (0)