Skip to content

Commit f569f04

Browse files
committed
Add progress bar during backtesting
1 parent 6411c7d commit f569f04

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

backtesting/backtesting.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
import numpy as np
2222
import pandas as pd
23+
import tqdm
2324
from numpy.random import default_rng
2425

2526
try:
@@ -1252,7 +1253,7 @@ def run(self, **kwargs) -> pd.Series:
12521253
# np.nan >= 3 is not invalid; it's False.
12531254
with np.errstate(invalid='ignore'):
12541255

1255-
for i in range(start, len(self._data)):
1256+
for i in tqdm.tqdm(range(start, len(self._data))):
12561257
# Prepare data and indicators for `next` call
12571258
data._set_length(i + 1)
12581259
for attr, indicator in indicator_attrs:

0 commit comments

Comments
 (0)