@@ -34,7 +34,7 @@ def _tqdm(seq, **_):
3434
3535from ._plotting import plot # noqa: I001
3636from ._stats import compute_stats
37- from ._util import _as_str , _Indicator , _Data , try_
37+ from ._util import _as_str , _Indicator , _Data , _indicator_warmup_nbars , _strategy_indicators , try_
3838
3939__pdoc__ = {
4040 'Strategy.__init__' : False ,
@@ -1290,14 +1290,11 @@ def run(self, **kwargs) -> pd.Series:
12901290 data ._update () # Strategy.init might have changed/added to data.df
12911291
12921292 # Indicators used in Strategy.next()
1293- indicator_attrs = {attr : indicator
1294- for attr , indicator in strategy .__dict__ .items ()
1295- if isinstance (indicator , _Indicator )}.items ()
1293+ indicator_attrs = _strategy_indicators (strategy )
12961294
12971295 # Skip first few candles where indicators are still "warming up"
12981296 # +1 to have at least two entries available
1299- start = 1 + max ((np .isnan (indicator .astype (float )).argmin (axis = - 1 ).max ()
1300- for _ , indicator in indicator_attrs ), default = 0 )
1297+ start = 1 + _indicator_warmup_nbars (strategy )
13011298
13021299 # Disable "invalid value encountered in ..." warnings. Comparison
13031300 # np.nan >= 3 is not invalid; it's False.
0 commit comments