Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Python for Algorithmic Trading Cookbook
  • Toc
  • feedback
Python for Algorithmic Trading Cookbook

Python for Algorithmic Trading Cookbook

By : Jason Strimpel
4.2 (19)
close
Python for Algorithmic Trading Cookbook

Python for Algorithmic Trading Cookbook

4.2 (19)
By: Jason Strimpel

Overview of this book

Discover how Python has made algorithmic trading accessible to non-professionals with unparalleled expertise and practical insights from Jason Strimpel, founder of PyQuant News and a seasoned professional with global experience in trading and risk management. This book guides you through from the basics of quantitative finance and data acquisition to advanced stages of backtesting and live trading. Detailed recipes will help you leverage the cutting-edge OpenBB SDK to gather freely available data for stocks, options, and futures, and build your own research environment using lightning-fast storage techniques like SQLite, HDF5, and ArcticDB. This book shows you how to use SciPy and statsmodels to identify alpha factors and hedge risk, and construct momentum and mean-reversion factors. You’ll optimize strategy parameters with walk-forward optimization using VectorBT and construct a production-ready backtest using Zipline Reloaded. Implementing all that you’ve learned, you’ll set up and deploy your algorithmic trading strategies in a live trading environment using the Interactive Brokers API, allowing you to stream tick-level data, submit orders, and retrieve portfolio details. By the end of this algorithmic trading book, you'll not only have grasped the essential concepts but also the practical skills needed to implement and execute sophisticated trading strategies using Python.
Table of Contents (16 chapters)
close

Technical Requirements

We installed Zipline Reloaded in Chapter 5, Build Alpha Factors for Stock Portfolios. In case you missed it, follow along with the instructions here. The steps to install Zipline Reloaded differ depending on your operating system.

For Windows, Unix/Linux, and Mac Intel users

If you’re running on an Intel x86 chip, you can use conda:

conda install -c conda-forge zipline-reloaded pyfolio-reloaded alphalens-reloaded -y

For Mac M1/M2 users

If you have a Mac with an M1 or M2 chip, you need to install some dependencies first. The easiest way is to use Homebrew (https://brew.sh).

Install the dependencies with Homebrew:

brew install freetype pkg-config gcc openssl hdf5 ta-lib

Install the Python dependencies with conda:

conda install -c conda-forge pytables h5py -y

Install the Zipline Reloaded ecosystem:

pip install zipline-reloaded pyfolio-reloaded alphalens-reloaded

In this example, we’ll use the free data bundle provided...

bookmark search playlist download font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete