@lin-ding said in Sizer based on ATR error I need help:

cerebro.addsizer(AtrBasedPositionSize)

Please take a look at the sizers documentation, there is an example of how to define the sizer with custom parameters.

https://www.backtrader.com/docu/sizers/sizers/

On a different matter:

Please use the backtick or grave accent to wrap you code - this way it will be easier for everybody to read you posts (see the header on this page)