File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff 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 ()
You can’t perform that action at this time.
0 commit comments