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
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 FREE CHAPTER 2. Chapter 2: Analyze and Transform Financial Market Data with pandas 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

What this book covers

Chapter 1, Acquire Free Financial Market Data with Cutting-edge Python Libraries, provides an in-depth exploration of acquiring various types of financial market data. You will learn to work with stock market, historic futures, and options market data using the OpenBB Platform, and harness factor data using pandas-datareader.

Chapter 2, Analyze and Transform Financial Market Data with pandas, dives into the powerful pandas library for data manipulation. This chapter explains pandas index types, building series and DataFrames, and transforming data. You will learn to calculate asset returns, measure volatility, generate cumulative returns, resample data, address missing data issues, and apply custom functions to analyze time series data.

Chapter 3, Visualize Financial Market Data with Matplotlib, Seaborn, and Plotly Dash, covers techniques for visualizing financial data. You will quickly visualize data using pandas, animate yield curve evolution with Matplotlib, plot options implied volatility surfaces, visualize statistical relationships with Seaborn, and create an interactive PCA analytics dashboard with Plotly Dash.

Chapter 4, Store Financial Market Data on Your Computer, discusses methods for efficiently storing financial data. You will learn to store data in CSV format, SQLite, a networked Postgres database, and the ultra-fast HDF5 format, ensuring your data is easily accessible and well organized for analysis and backtesting.

Chapter 5, Build Alpha Factors for Stock Portfolios, focuses on creating alpha factors. It covers identifying latent return drivers with principal component analysis, hedging portfolio beta using linear regression, analyzing portfolio sensitivities to Fama-French factors, assessing market inefficiency based on volatility, and preparing a factor ranking model using Zipline pipelines.

Chapter 6, Vector-Based Backtesting with VectorBT, introduces vector-based backtesting. This chapter guides you through experimenting with millions of strategy combinations, conducting walk-forward optimization, and implementing a risk parity backtest using VectorBT, providing a robust framework for strategy evaluation.

Chapter 7, Event-Based Backtesting Factor Portfolios with Zipline Reloaded, explores event-based backtesting. You will backtest a momentum factor strategy and explore a mean reversion strategy using Zipline Reloaded, helping you understand the dynamics and performance of various trading strategies.

Chapter 8, Evaluate Factor Risk and Performance with Alphalens Reloaded, examines factor risk and performance. You will prepare backtest results, evaluate the information coefficient, examine factor return performance, and evaluate factor turnover, ensuring a comprehensive analysis of your trading strategies.

Chapter 9, Assess Backtest Risk and Performance Metrics with Pyfolio, covers risk and performance assessment. This chapter explains preparing Zipline backtest results for pyfolio, generating strategy performance analytics, building a drawdown and rolling risk analysis, analyzing strategy holdings, leverage, exposure, sector allocations, and breaking down performance to the trade level.

Chapter 10, Set Up the Interactive Brokers Python API, provides a guide to building an algorithmic trading app. You will create contract and order objects with the IB API, fetch historical market data, get market data snapshots, stream live tick data, and store live tick data in a local SQL database, enabling real-time trading and data management.

Chapter 11, Manage Orders, Positions, and Portfolios with the IB API, explains managing trades and portfolios. You will learn to execute orders, manage placed orders, get portfolio details, inspect positions, and compute portfolio profit and loss, providing comprehensive tools to manage your trading operations.

Chapter 12, Deploy Strategies to a Live Environment, focuses on live trading strategy deployment. This chapter covers calculating real-time performance and risk indicators, sending orders based on portfolio targets, and deploying monthly factor, options combo, and intraday multi-asset mean reversion strategies, ensuring your strategies are effective and responsive in live markets.

Chapter 13, Advanced Recipes for Market Data and Strategy Management, offers advanced techniques for managing market data and strategies. You will learn to stream real-time options data with ThetaData, use the ArcticDB DataFrame database for tick storage, trigger real-time risk limit alerts, and store trade execution details in a SQL database, enhancing your data management and strategy implementation capabilities.

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