In this section, we will study the relationship between the VIX and the S&P 500 Market Index.
Financial analytics of the S&P 500 and the VIX
Gathering the data
We will be using Alpha Vantage as our data provider. Let's download the SPX and VIX datasets in the following steps:
- Query for the all-time S&P 500 historical data with the ticker symbol ^GSPC:
In [ ]:
from alpha_vantage.timeseries import TimeSeries
# Update your Alpha Vantage API key here...
ALPHA_VANTAGE_API_KEY = 'PZ2ISG9CYY379KLI'
ts = TimeSeries(key=ALPHA_VANTAGE_API_KEY, output_format='pandas')
df_spx_data, meta_data = ts.get_daily_adjusted(
symbol='^GSPC', outputsize=&apos...