November 2017
Intermediate to advanced
304 pages
6h 58m
English
Let's start by grabbing some data. For the purposes of this chapter, we'll use data from Quandl, a longtime favorite of technically adept independent investors. Quandl makes data available on many stocks using a number of mechanisms. One easy mechanism is via a URL API. To get stock data on, say, Google Stock, we can click on https://www.quandl.com/api/v3/datasets/WIKI/GOOG/data.json. Similarly, we can replace GOOG with other index codes to grab data on other stocks.
This is fairly easy to automate via Python; we will use the following code to do so:
import requests API_KEY = '<your_api_key>' start_date = '2010-01-01' end_date = '2015-01-01' order = 'asc' column_index = 4 stock_exchange = 'WIKI' index = 'GOOG' data_specs ...
Read now
Unlock full access