I'm porting a script from Pine on TradingView to Quantopian.
Their "history" is in 30-minute increments instead of the tiny one-minute views. I'm trying to replicate the functionality of doing their RSI(close, input(11)) function, but I haven't made any progress. I'm not familiar with Quantopian, but I am familiar with Python in general, so explanations about the types of anything related to data.history would be great.
This is what I have so far:
def handle_data(context, data):
hist = data.history(symbol('XIV'), "price", 390, '1m')
hist = hist.groupby(lambda d: d.date()).resample('30T')
rsi = talib.RSI(hist.values, timeperiod=11)[-1]
print 'RSI: %s' % (rsi,)