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

Got an exception when using some analyzers



  • When I use cerebro.optstrategy(...) and cerebro.run(), I got an exception if using some analyzers( PeriodStats, SharpeRatio) :

    File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\threading.py", line 917, in _bootstrap_inner
    self.run()
    File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\threading.py", line 865, in run
    self._target(*self._args, **self._kwargs)
    File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\multiprocessing\pool.py", line 470, in _handle_results
    task = get()
    File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\multiprocessing\connection.py", line 251, in recv
    return _ForkingPickler.loads(buf.getbuffer())
    AttributeError: Can't get attribute 'Lines_LineSeries_LineIterator_DataAccessor_ObserverBase_Observer_DataTrades_5991202d0983450997d03f799478a7ad' on <module 'backtrader.lineseries' from 'c:\users\kaima\source\repos\PythonHello\PythonHello\env37\lib\site-packages\backtrader\lineseries.py'>



  • Common issue, essentially means no line data is being received through the function. there might be a error in the way you are calling some attributes. if you post your code, it will help identify the problem better.


  • administrators

    Disable stdstats=False in Cerebro. Essentially your code is breaking something, and that's only the symptom.

    Docs - Cerebro