ta-lib-python
ta-lib-python copied to clipboard
TA-Lib BBands Indicator in Backtrader Strategy Faild
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)
`
What is bt?
The error is that you need to pass a float instead of an int to nbdevup.