Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Python for Algorithmic Trading Cookbook

You're reading from   Python for Algorithmic Trading Cookbook Recipes for designing, building, and deploying algorithmic trading strategies with Python

Arrow left icon
Product type Paperback
Published in Aug 2024
Publisher Packt
ISBN-13 9781835084700
Length 404 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Jason Strimpel Jason Strimpel
Author Profile Icon Jason Strimpel
Jason Strimpel
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

Preface 1. Chapter 1: Acquire Free Financial Market Data with Cutting-Edge Python Libraries 2. Chapter 2: Analyze and Transform Financial Market Data with pandas FREE CHAPTER 3. Chapter 3: Visualize Financial Market Data with Matplotlib, Seaborn, and Plotly Dash 4. Chapter 4: Store Financial Market Data on Your Computer 5. Chapter 5: Build Alpha Factors for Stock Portfolios 6. Chapter 6: Vector-Based Backtesting with VectorBT 7. Chapter 7: Event-Based Backtesting Factor Portfolios with Zipline Reloaded 8. Chapter 8: Evaluate Factor Risk and Performance with Alphalens Reloaded 9. Chapter 9: Assess Backtest Risk and Performance Metrics with Pyfolio 10. Chapter 10: Set Up the Interactive Brokers Python API 11. Chapter 11: Manage Orders, Positions, and Portfolios with the IB API 12. Chapter 12: Deploy Strategies to a Live Environment 13. Chapter 13: Advanced Recipes for Market Data and Strategy Management 14. Index 15. Other Books You May Enjoy

Acquire Free Financial Market Data with Cutting-Edge Python Libraries

A May 2017 Economist cover declared data to be the world’s most valuable resource. It’s none truer than in algorithmic trading. As algorithmic traders, it’s our job to acquire and make sense of billions of rows of market data for use in trading algorithms. In this context, it’s crucial to gather high-quality, reliable data that can adequately support trading algorithms and market research. Luckily for us, it’s possible to acquire high-quality data for free (or nearly free).

This chapter offers recipes for a series of different Python libraries—including the cutting-edge OpenBB Platform—to acquire free financial market data using Python. One of the primary challenges most non-professional traders face is getting all the data required for analysis together in one place. The OpenBB Platform addresses this issue. We’ll dive into acquiring data for a variety of assets, including stocks, options, futures (both continuous and individual contracts), and Fama-French factors.

One crucial point to remember is that data can vary across different sources. For instance, prices from two sources might differ due to distinct data sourcing methods or different adjustment methods for corporate actions. Some of the libraries we’ll cover might download data for the same asset from the same source. However, libraries vary in how they return that data based on options that help you preprocess the data in preparation for research.

Lastly, while we’ll focus heavily on mainstream financial data in this chapter, financial data is not limited to prices. The concept of “alternative data,” which includes non-traditional data sources such as satellite images, web traffic data, or customer reviews, can be an important source of information for developing trading strategies. The Python tools to acquire and process this type of data are outside the scope of this book. We’ve intentionally left out the methods of acquiring and processing this type of data since it’s covered in other resources dedicated to the topic.

In this chapter, we’ll cover the following recipes:

  • Working with stock market data with the OpenBB Platform
  • Fetching historic futures data with the OpenBB Platform
  • Navigating options market data with the OpenBB Platform
  • Harnessing factor data using pandas_datareader
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 $19.99/month. Cancel anytime
Banner background image