Hello everyone! I am relatively new to Python and Quantopian, so this may be a basic question.
I have been playing around with a sample algorithm for TA-lib using RSI. My goal is to create a moving average for RSI. This was fairly straightforward to do in the notebook environment:
import talib
import matplotlib.pyplot as pyplot
data = get_pricing(
'FANG',
fields='close_price',
start_date="2016-01-01",
end_date="2018-06-15",
frequency='daily'
)
data.plot(use_index=False)
pyplot.title('FANG Close Price')
FANG_RSI = talib.RSI(data)
FANG_RSIMovingAVG = talib.SMA(FANG_RSI, timeperiod=10)
pyplot.plot(FANG_RSI)
pyplot.plot(FANG_RSIMovingAVG)
pyplot.title('FANG')
The problem comes when carrying this over to an algorithm. I have tried several approaches, but none have worked so far. I suspect I need to use data.history somehow, but I was unsure if this is only for price data.
Any help would be much appreciated.
Andrew