Backtesting-Trading-Strategies-with-Python icon indicating copy to clipboard operation
Backtesting-Trading-Strategies-with-Python copied to clipboard

backtest.plot() is not working

Open rahulmr opened this issue 4 years ago • 1 comments

backtest.plot() is not working

I am getting below error.

Traceback (most recent call last):
  File "D:\trading\angel_py\btpy_eg.py", line 85, in <module>
    backtest.plot()
  File "D:\Apps\Scoop\apps\python\current\lib\site-packages\backtesting\backtesting.py", line 1704, in plot
    plot(
  File "D:\Apps\Scoop\apps\python\current\lib\site-packages\backtesting\_plotting.py", line 591, in plot
    _plot_superimposed_ohlc()
  File "D:\Apps\Scoop\apps\python\current\lib\site-packages\backtesting\_plotting.py", line 445, in _plot_superimposed_ohlc
    raise ValueError('Invalid value for `superimpose`: Upsampling not supported.')
ValueError: Invalid value for `superimpose`: Upsampling not supported.
PS D:\trading\angel_py>

rahulmr avatar Feb 03 '21 08:02 rahulmr

Hi, I think that you have already found the answer but you should add this to your data: data = data.iloc[:-1]

With this you drop the last row of your data because it shows the real time with other format.

Regards. Sara

SaraStemPro avatar Feb 03 '23 16:02 SaraStemPro