For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See:

cerebro.plot() error

  • I've got below errors when trying to do cerebro.plot().
    My data files is normal csv with date/high/low/open/close.
    File "C:\ProgramData\Anaconda3\envs\Yiqin\lib\site-packages\backtrader\", line 991, in plot
    start=start, end=end, use=use)
    File "C:\ProgramData\Anaconda3\envs\Yiqin\lib\site-packages\backtrader\plot\", line 262, in plot
    self.mpyplot.setp(ax.get_xticklabels(), visible=False)
    File "C:\ProgramData\Anaconda3\envs\Yiqin\lib\site-packages\matplotlib\", line 63, in wrapper
    return get_method(self)(*args, **kwargs)
    File "C:\ProgramData\Anaconda3\envs\Yiqin\lib\site-packages\matplotlib\", line 1255, in get_ticklabels
    return self.get_majorticklabels()
    File "C:\ProgramData\Anaconda3\envs\Yiqin\lib\site-packages\matplotlib\", line 1207, in get_majorticklabels
    ticks = self.get_major_ticks()
    File "C:\ProgramData\Anaconda3\envs\Yiqin\lib\site-packages\matplotlib\", line 1378, in get_major_ticks
    numticks = len(self.get_majorticklocs())
    File "C:\ProgramData\Anaconda3\envs\Yiqin\lib\site-packages\matplotlib\", line 1283, in get_majorticklocs
    return self.major.locator()
    File "C:\ProgramData\Anaconda3\envs\Yiqin\lib\site-packages\matplotlib\", line 1320, in call
    return locator()
    File "C:\ProgramData\Anaconda3\envs\Yiqin\lib\site-packages\matplotlib\", line 1731, in call
    return self.tick_values(dmin, dmax)
    File "C:\ProgramData\Anaconda3\envs\Yiqin\lib\site-packages\matplotlib\", line 1741, in tick_values
    ticks = self._wrapped_locator.tick_values(nmin, nmax)
    File "C:\ProgramData\Anaconda3\envs\Yiqin\lib\site-packages\matplotlib\", line 2009, in tick_values
    locs = vmin - step + np.arange(n + 3) * step
    MemoryError: Unable to allocate 70.8 GiB for an array with shape (9504000003,) and data type float64

  • Not enough memory for the operations you want to make. I doubt that this is related to bt, you may want to google this error and check out what are the recommendations.

  • I encountered the exact same error. Any solutions here?

Log in to reply