You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TA-Lib BBands Indicator in Backtrader Strategy Faild #430
Hello
I am a new python user and got annoying error "" TypeError: Invalid parameter value for nbdevup (expected float, got int) "" When I use bt.talib.bband in my strategy class at backtrader .
What Should I do? Would you please help me. Here is my Initiation of strategy which error get occurred
`import backtrader as bt
import talib
class TestStrategy(bt.Strategy):
def __init__(self): ## initialize function
self.bb = bt.talib.BBANDS(self.data.close, timeperiod = 14)
# or even : a,b,c = bt.talib.BBANDS()
# or even : a,b,c = bt.talib.BBANDS(self or self.data)
Activity
mrjbq7 commentedon Jun 5, 2021
What is
bt?The error is that you need to pass a
floatinstead of aninttonbdevup.mario4tier commentedon Oct 24, 2026
Fixed in #780: an abstract function now takes an int (or a numpy number) for a real parameter, as
talib.funcdoes, soBBANDS(..., nbdevup=2)works.Accept any number of a parameter's kind in the abstract API
Accept any number of a parameter's kind in the abstract API