#NEWLINE# def test_BBANDS( ) : #NEWLINE# #INDENT# ( upper , middle , lower ) = func . BBANDS ( series , timeperiod = 20 , nbdevup = 2.0 , nbdevdn = 2.0 , matype = talib . MA_Type . EMA ) #NEWLINE# i = np . where ( ( ~ np . isnan ( upper ) ) ) [ 0 ] [ 0 ] #NEWLINE# assert_true ( ( len ( upper ) == len ( middle ) == len ( lower ) == len ( series ) ) ) #NEWLINE# assert_true ( ( abs ( ( middle [ ( lower + 0 ) ] - 92.891 ) ) < 0.001 ) ) #NEWLINE# assert_true ( ( abs ( ( lower [ ( i + 0 ) ] - 87.7086 ) ) < 0.001 ) ) #NEWLINE# assert_true ( ( abs ( ( middle [ ( i + 13 ) ] - 87.679 ) ) < 0.001 ) ) #NEWLINE# assert_true ( ( abs ( ( lower [ ( i + 13 ) ] - 81.685 ) ) < 0.001 ) )