ta-lib-python icon indicating copy to clipboard operation
ta-lib-python copied to clipboard

bollinger bands are the same for middle and lower

Open mrojz opened this issue 4 years ago • 0 comments

Hi,

I tried to get the bollinger bands, i'm extracting values from binance and getting correct value for rsi and ema.

		ub, mb, lb = talib.BBANDS(numpy.asarray(closes),20,2,0, matype=MA_Type.SMA)
		print(closes[-5:])
		print(lb[-5:])
		print(mb[-5:])
		print(rsi[-2])
		print(list(talib.EMA(np_closes, timeperiod=30))[-2])

result: [74793.0, 75024.0, 75188.0, 75076.0, 75012.0] [75552.1 75504.2 75436.15 75365.9 75303.6 ] [75552.1 75504.2 75436.15 75365.9 75303.6 ] 45.54082764233271 (value for 13:30 ) 75351.3107129909 (value for 13:30 ) ETHBTC 15m

09/09/2021 12:45 to 09/09/2021 13:45 (the last value is not exact because the live price is considered as close price)

the problem is that lower band and middle band are the same. but the upper band is correct. i saw similar issues, suggestions were multiplying by 10000, i tried it but same result.

so any suggestion to solve this problem ?

mrojz avatar Sep 09 '21 14:09 mrojz