Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Mastering Python for Finance. - Second Edition

You're reading from  Mastering Python for Finance. - Second Edition

Product type Book
Published in Apr 2019
Publisher Packt
ISBN-13 9781789346466
Pages 426 pages
Edition 2nd Edition
Languages
Author (1):
James Ma Weiming James Ma Weiming
Profile icon James Ma Weiming

Table of Contents (16) Chapters

Preface Section 1: Getting Started with Python
Overview of Financial Analysis with Python Section 2: Financial Concepts
The Importance of Linearity in Finance Nonlinearity in Finance Numerical Methods for Pricing Options Modeling Interest Rates and Derivatives Statistical Analysis of Time Series Data Section 3: A Hands-On Approach
Interactive Financial Analytics with the VIX Building an Algorithmic Trading Platform Implementing a Backtesting System Machine Learning for Finance Deep Learning for Finance Other Books You May Enjoy

Financial analytics of the S&P 500 and the VIX

In this section, we will study the relationship between the VIX and the S&P 500 Market Index.

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:

  1. 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...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}