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

problems when using cerebro.optstrategy

  • I am new to backtrader. I tried to use the the optimizer and changed the code from:
    maperiod=range(10, 11))

    But after changing the code, it stuck at the step after running the code. In the cmd windows, there are some print as below. I appricate it very much if someone could solve my issue.

    Starting Portfolio Value: 10000.00
    Starting Portfolio Value: 10000.00
    Starting Portfolio Value: 10000.00
    Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "C:\Python27\lib\multiprocessing\", line 380, in main
    File "C:\Python27\lib\multiprocessing\", line 510, in prepare
    'parents_main', file, path_name, etc
    File "C:\Python27\Scripts\tu_back_trader\", line 103, in <module>
    File "build\bdist.win32\egg\backtrader\", line 1142, in run
    File "C:\Python27\lib\", line 232, in Pool
    return Pool(processes, initializer, initargs, maxtasksperchild)
    File "C:\Python27\lib\multiprocessing\", line 161, in init
    File "C:\Python27\lib\multiprocessing\", line 225, in _repopulate_pool
    File "C:\Python27\lib\multiprocessing\", line 130, in start
    self._popen = Popen(self)

  • administrators

    By the looks of it ... it could a problem with your Python installation. The error is deep in the stack.

    It could of course have to do with your code snippet, but the sample you post is too small to conclude anything.

Log in to reply