hftbacktest
hftbacktest copied to clipboard
Any Progress bar?
TL;DR: Feature request: progress bar for backtesting.
What I did:
- Downloaded data using https://github.com/nkaz001/collect-binancefutures
- Tried to run https://github.com/nkaz001/hftbacktest/blob/master/examples/Market%20Making%20with%20Alpha%20-%20Order%20Book%20Imbalance.ipynb on my dataset.
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.
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