Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any Progress bar? #38

Open
ohld opened this issue Sep 10, 2023 · 1 comment
Open

Any Progress bar? #38

ohld opened this issue Sep 10, 2023 · 1 comment

Comments

@ohld
Copy link

ohld commented Sep 10, 2023

TL;DR:
Feature request: progress bar for backtesting.

What I did:

  1. Downloaded data using https://github.com/nkaz001/collect-binancefutures
  2. Tried to run https://github.com/nkaz001/hftbacktest/blob/master/examples/Market%20Making%20with%20Alpha%20-%20Order%20Book%20Imbalance.ipynb on my dataset.
  3. obi_mm(hbt, ...) became silent after the data was loaded.

So I don't understand if the backtest is even working. And what if it would require several days to backtest on my laptop?

It would be great to include a progress bar somewhere. tqdm package is a great tool to have pretty progressbars in raw python and in jupyter environments.

@nkaz001
Copy link
Owner

nkaz001 commented Sep 12, 2023

I will consider showing progress. But, due to Numba limitations, displaying a progress bar might be challenging. Printing progress is acceptable, even if it might be a bit verbose. In the meantime, you can display progress as follows:

progress = 0
print('Start')
while hbt.elapse(interval):
    if hbt.local.data is not None:
        progress_update = int(hbt.local.row_num / len(hbt.local.data) * 100)
        if progress_update != progress:
            print(progress_update, '%')
            progress = progress_update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants