Perhaps a stupid question, but I've ran into several issues with plotting with my default setup - Win 10, Python 3.8.5 32-bit, BT 1.9.76.123, Matplotlib 3.3.3 (tried 3.3.0, 3.3.1 earlier as well with the same results). Pretty sure it's something on my end but for the life of me I can't figure out.
Issue 1 (solvable) - when plotting, bt\plot\locator.py craps out on line 39 complaining about the module 'warnings' not being found:
from matplotlib.dates import (HOURS_PER_DAY, MIN_PER_HOUR, SEC_PER_MIN,
MONTHS_PER_YEAR, DAYS_PER_WEEK,
SEC_PER_HOUR, SEC_PER_DAY,
num2date, rrulewrapper, YearLocator,
MicrosecondLocator, warnings)
...solution: remove 'warnings' from the list, without (seemingly) any ill effects.
Issue 2 (NOT able to solve so far) - if I configure Cerebro like this:
cerebro = bt.Cerebro()
...or like this (note that .Trades is the culprit here):
cerebro = bt.Cerebro(stdstats=False)
cerebro.addobserver(bt.observers.Trades)
... I get the following when doing 'cerebro.plot()' later:
...
File "...\Python38\site-packages\matplotlib\dates.py", line 1748, in tick_values
ticks = self._wrapped_locator.tick_values(nmin, nmax)
File "...\Python38\site-packages\matplotlib\ticker.py", line 2009, in tick_values
locs = vmin - step + np.arange(n + 3) * step
ValueError: Maximum allowed size exceeded
...which I was able to trace to the fact that the last line is getting some insanely high values as inputs for vmin and vmax (just added a debug 'print()' in place here)
print(vmax, vmin, n)
locs = vmin - step + np.arange(n + 3) * step
>>> 91152000000.0 81648000000.0 9504000000.0
So, the question is -- what am I doing wrong AND/OR is there a different, recommended Python version (and or Matplotlib version, perhaps) that the community is using to run Backtrader? The docs say testing is done up to Python 3.5, but even 3.5.10 is end of life as of Sep 2020 (there's not even a Windows installer available for download anymore). So whats the recommendation here?
Would appreciate any help.