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

TypeError: __init__() got an unexpected keyword argument 'size'

  • Hi, normally i can solve these sorts of problems for myself but this time i just can't work it out, hopefuly someone here can help. i get this error when trying to run a simple backtest, no optimisation or anything

    Traceback (most recent call last):
    File "C:/Users/ross_/PycharmProjects/MA-Cross/", line 60, in <module>
    strat_list =
    File "C:\Users\ross_\AppData\Local\Programs\Python\Python38\lib\site-packages\backtrader\", line 1127, in run
    runstrat = self.runstrategies(iterstrat)
    File "C:\Users\ross_\AppData\Local\Programs\Python\Python38\lib\site-packages\backtrader\", line 1217, in runstrategies
    strat = stratcls(*sargs, **skwargs)
    File "C:\Users\ross_\AppData\Local\Programs\Python\Python38\lib\site-packages\backtrader\", line 88, in call
    _obj, args, kwargs = cls.doinit(obj, *args, **kwargs)
    File "C:\Users\ross\AppData\Local\Programs\Python\Python38\lib\site-packages\backtrader\", line 78, in doinit
    _obj.init(*args, **kwargs)
    TypeError: init() got an unexpected keyword argument 'size'


  • administrators

    See here:

Log in to reply