Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
TA-Lib Volume Error

Keep getting an error [AssertionError: volume is not double] when using ta-lib on a dataframe (see link below). Any idea why?

df['Chaikin A/D'] = talib.AD(high, low, close, volume)  

http://imgur.com/W94bcxj


AssertionError Traceback (most recent call last)
in ()
----> 1 ta_ind(apl)

in ta_ind(df)
67
68 # Volume
---> 69 df['Chaikin A/D'] = talib.AD(high, low, close, volume)
70
71 df = df.sort(ascending=False)

C:\Anaconda\lib\site-packages\talib\func.pyd in talib.func.AD (talib\func.c:3321)()

AssertionError: volume is not double

3 responses

Hello Michael,

That's not much to go on - can you post something more?

P.

The AD function in TA-Lib is expecting volume to have type double but from your screenshot it seems that volume has integer type. Try casting the volume array type to floats:

df['Chaikin A/D'] = talib.AD(high, low, close, np.asarray(volume, dtype='float'))  

Thanks Aidan, in was dtype = int, so just casted to float64