Skip to content

Commit 1715c91

Browse files
committed
BUG: Fix computing indicator start offset for 2d indicators
1 parent f54fd76 commit 1715c91

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

backtesting/backtesting.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ def run(self, **kwargs) -> pd.Series:
698698

699699
# Skip first few candles where indicators are still "warming up"
700700
# +1 to have at least two entries available
701-
start = 1 + max((np.isnan(indicator.astype(float)).argmin()
701+
start = 1 + max((np.isnan(indicator.astype(float)).argmin(axis=-1).max()
702702
for _, indicator in indicator_attrs), default=0)
703703

704704
# Disable "invalid value encountered in ..." warnings. Comparison

0 commit comments

Comments
 (0)