Exercise

Visualize the RSI

The RSI is a momentum indicator that oscillates between 0 and 100. Typically an RSI over 70 indicates an overbought market condition, which means the asset is overvalued and the price may reverse. An RSI below 30 suggests an oversold market condition, which means the asset is undervalued and the price may rally. To better understand it, you will calculate the RSI and plot it along with the price data.

As you did in the previous exercise, you will use historical daily price data of the Google stock, which has been loaded as stock_data. Also, talib has been imported for you and matplotlib.pyplot has been imported as plt.

Instructions 1/2

undefined XP
    1
    2
  • Calculate a 14-day (by default) RSI, and save it in column called RSI.
  • Create two subplots named ax1 and ax2.
  • Plot the Close price in the subplot ax1 on top, and the RSI in the subplot ax2 on the bottom.