Reader small image

You're reading from  Python Algorithmic Trading Cookbook

Product typeBook
Published inAug 2020
Reading LevelIntermediate
PublisherPackt
ISBN-139781838989354
Edition1st Edition
Languages
Right arrow
Author (1)
Pushpak Dagade
Pushpak Dagade
author image
Pushpak Dagade

Pushpak Dagade is working in the area of algorithmic trading with Python for more than 3 years. He is a co-founder and CEO of AlgoBulls, an algorithmic trading platform.
Read more about Pushpak Dagade

Right arrow

Fetching historical data using Quandl

So far, in all the recipes in this chapter, you have used the broker connection to fetch historical data. In this recipe, you will fetch historical data using a third-party tool, Quandl (https://www.quandl.com/tools/python). It has a free to use Python version which can be easily installed using pip. This recipe demonstrates the use of quandl to fetch historical data of FAAMG stock prices (Facebook, Amazon, Apple, Microsoft, and Google).

Getting ready

Make sure you have installed the Python quandl package. If you haven't, you can install it using the following pip command:

$ pip install quandl

How to do it…

We execute the following steps for this recipe:

  1. Import the necessary modules:
>>> from pyalgotrading.utils.func import plot_candlestick_chart, PlotType
>>> import quandl
  1. Plot a chart for the historical data of Facebook with a 1-day candle interval:
>>> facebook = quandl.get('WIKI/FB', 
...
lock icon
The rest of the page is locked
Previous PageNext Chapter
You have been reading a chapter from
Python Algorithmic Trading Cookbook
Published in: Aug 2020Publisher: PacktISBN-13: 9781838989354

Author (1)

author image
Pushpak Dagade

Pushpak Dagade is working in the area of algorithmic trading with Python for more than 3 years. He is a co-founder and CEO of AlgoBulls, an algorithmic trading platform.
Read more about Pushpak Dagade