Hi,
I've got this code:
daily_prices = history(bar_count=365, frequency='1d', field='price')
weekly_prices = daily_prices.resample('1W')
weekly_close = np.array(weekly_prices[sid].values.tolist())
weekly_sma30 = ta.SMA(weekly_close, timeperiod=30)
direction = priceDirection(weekly_sma30[-5:])
where I'm trying to limit the number of values of the weekly_sma30 array sent to a function called priceDirection. I've done this type of thing before but this time I'm getting the followin error and don't understand what I"m doing wrong:
Error Runtime exception: TypeError: list indices must be integers, not builtins.Security
-5 is an integer as far as I understand it.
Any help will be appreciated.
Thanks,
Andrew