Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Python for Algorithmic Trading Cookbook
  • Table Of Contents Toc
Python for Algorithmic Trading Cookbook

Python for Algorithmic Trading Cookbook - Second Edition

By : Jason Strimpel
close
close
Python for Algorithmic Trading Cookbook

Python for Algorithmic Trading Cookbook

By: Jason Strimpel

Overview of this book

Get practical Python code for algorithmic trading from Jason Strimpel, founder of PyQuant News and a veteran of global trading, risk management, and machine learning. This hands-on guide shows you how to turn market data into tested, automated trading strategies using modern Python tools. You’ll source equities, options, and futures data with OpenBB and FMP, then accelerate Python for data analysis workflows with Pandas, Polars, Parquet, DuckDB, and ArcticDB. You’ll visualize market data with Matplotlib, Seaborn, and Plotly Dash before moving into alpha research and quantitative trading techniques. Detailed recipes help you engineer alpha factors with PCA, regression, Fama-French models, SciPy, and statsmodels. You’ll design and evaluate quantitative trading strategies using VectorBT, Zipline Reloaded, Alphalens Reloaded, and PyFolio, including walk-forward analysis and risk-aware performance review. For execution, you’ll connect to the Interactive Brokers API to stream ticks, manage orders, retrieve portfolio state, and monitor live trading workflows. By the end, you’ll have reusable Python templates for researching, backtesting, evaluating, and operating algorithmic trading strategies.
Table of Contents (19 chapters)
close
close
17
Other Books You May Enjoy
18
Index

Resampling data for different time frames

Two types of resampling are upsampling, where data is converted into a higher frequency (such as daily data to hourly data), and downsampling, where data is converted into a lower frequency (such as daily data to monthly data). In financial data analysis, resampling can help in various ways. For instance, if you have daily stock prices, you can resample this data to calculate monthly or yearly average prices, which can be useful for long-term trend analysis. A common use case is when aligning trade and quote data. There are a lot more quotes than trades – often an order of magnitude more – and we may need to align the open, high, low, and closing quote prices to the open, high, low, and closing trade data. Since the quotes and trades will have different timestamps, resampling to a 1-second resolution is a great way to align these disparate data sources.

How to do it…

We'll work on resampling stock price data from one...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Python for Algorithmic Trading Cookbook
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon