Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
TAlib's AROON doesn't seem to be working

Hello,

When I try to use TAlib's AROON like this

def handle_data(context, data):  
    #Get a trailing window of data  
    prices = history(PERIOD + 1, '1d', 'price')  
    # Use pandas dataframe.apply to get the last RSI value  
    # for each stock in our basket  
    rsi_data = prices.apply(ta.RSI, timeperiod=PERIOD).iloc[-1]  
    aroon_data = prices.apply(ta.AROON, timeperiod=PERIOD).iloc[-1]  

it keeps returning a build error
Runtime exception: TypeError: AROON() takes at least 2 positional arguments (1 given)

but in the docs it only needs timeperiod.

Any ideias?

Thanks,

JM

1 response

JM,

I dont think you will be able to use apply on that indicator. If you use the debugger you can find out more information:

talib.AROON.func_doc  

gives:

AROON(high, low[, timeperiod=?])

    Aroon (Momentum Indicators)

    Inputs:  
        prices: ['high', 'low']  
    Parameters:  
        timeperiod: 14  
    Outputs:  
        aroondown  
        aroonup  

Hope that helps :)