import talib
import matplotlib.pyplot as pyplot
import pandas as pd
# Get year-to-date closing price data for TSLA
data = get_pricing(
'TSLA',
fields='close_price',
start_date="2017-01-01",
end_date="2017-06-15",
frequency='daily'
)
data.plot(use_index=False)
pyplot.title('TSLA Close Price')
# Compute RSI using TSLA closing price Series
tsla_RSI = talib.RSI(data)
# Plot RSI
pyplot.plot(tsla_RSI)
pyplot.title('TSLA RSI')
s2 = pd.Series(tsla_RSI)
s2.index = data.index
s2.plot()