From 47d322b8d0221ba57ed2ee4af6a028f4bd7a65d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nathan=20Ramos=2C=20CFA=C2=AE?= <86393277+nathanramoscfa@users.noreply.github.com> Date: Wed, 13 Sep 2023 14:24:47 -0500 Subject: [PATCH 1/3] Update backtest.py Add progress bars to backtest.py --- bt/backtest.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bt/backtest.py b/bt/backtest.py index e9e919cd..36686be0 100644 --- a/bt/backtest.py +++ b/bt/backtest.py @@ -9,6 +9,7 @@ import numpy as np from matplotlib import pyplot as plt import pyprind +from tqdm import tqdm def run(*backtests): @@ -24,7 +25,7 @@ def run(*backtests): """ # run each backtest - for bkt in backtests: + for bkt in tqdm(backtests): bkt.run() return Result(*backtests) @@ -66,7 +67,7 @@ def benchmark_random(backtest, random_strategy, nsim=100): data = backtest.data.dropna() # create and run random backtests - for i in range(nsim): + for i in tqdm(range(nsim)): random_strategy.name = "random_%s" % i rbt = bt.Backtest(random_strategy, data) rbt.run() From b4febd1a0dd0f47c1d846cf8a50f21b1a75b6ce7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nathan=20Ramos=2C=20CFA=C2=AE?= <86393277+nathanramoscfa@users.noreply.github.com> Date: Wed, 13 Sep 2023 17:22:11 -0500 Subject: [PATCH 2/3] Update setup.py --- setup.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index f991fb62..70cf3b49 100644 --- a/setup.py +++ b/setup.py @@ -39,7 +39,11 @@ def local_file(filename): keywords="python finance quant backtesting strategies", url="https://github.com/pmorissette/bt", license="MIT", - install_requires=["ffn>=0.3.7", "pyprind>=2.11"], + install_requires=[ + "ffn>=0.3.7", + "pyprind>=2.11", + "tqdm==4.65.0" # <-- Added this line + ], extras_require={ "dev": [ "black>=20.8b1", From a1a21b0126f38400e2f5c75a802cb2063f7973c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nathan=20Ramos=2C=20CFA=C2=AE?= <86393277+nathanramoscfa@users.noreply.github.com> Date: Thu, 14 Sep 2023 09:51:51 -0500 Subject: [PATCH 3/3] Update setup.py Modified the pinned version of tqdm as requested. --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 70cf3b49..481a1d5d 100644 --- a/setup.py +++ b/setup.py @@ -42,7 +42,7 @@ def local_file(filename): install_requires=[ "ffn>=0.3.7", "pyprind>=2.11", - "tqdm==4.65.0" # <-- Added this line + "tqdm>=4.65.0" ], extras_require={ "dev": [