Closed
Description
Expected Behavior
Plots, where data was resampled due to >10,000 bars, should calculate max drawdowns and drawdown periods similar to those computed in the _compute_stats method
Actual Behavior
It appears when plots are downsampled in the Backtest.plot(resample=True) the drawdown calculations and possibly drawdown duration (beginning and ending periods) are miscalculated.
Here are two examples of such charts:
https://www.realitysharesadvisors.com/fund_dash/fix_this_eth.html
https://www.realitysharesadvisors.com/fund_dash/fix_this.html
Note the legend in one of the charts showing 0 days of max drawdown
Here is an example where the red line is misplaced on an incorrect drawdown.
Steps to Reproduce
- I was using 5-minute candles on multiple years of data.
- Run Backtest.plot() on a large dataset and it should reproduce the result...Hopefully, if not, I am happy to privately share my datafiles and strategy class for you to reproduce on your system.
Additional info
This was also referenced in a different issue #156 (comment)
- Backtesting version: 0.2.3
- bokeh 2.2.3
- python 3.8.5
- pandas 1.1.3