hftbacktest icon indicating copy to clipboard operation
hftbacktest copied to clipboard

Any Progress bar?

Open ohld opened this issue 2 years ago • 3 comments

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.

ohld avatar Sep 10 '23 20:09 ohld

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

nkaz001 avatar Sep 12 '23 14:09 nkaz001