Share E-Book
Scan to open this page

Scan with your phone to open this page

Author: Peng Liu

Rating No ratings yet

Build and implement trading strategies using Python. This book will introduce you to the fundamental concepts of quantitative trading and shows how to use Python and popular libraries to build trading models and strategies from scratch. It covers practical trading strategies coupled with step-by-step implementations that touch upon a wide range of topics, including data analysis and visualization, algorithmic trading, backtesting, risk management, optimization, and machine learning, all coupled with practical examples in Python. Part one of Quantitative Trading Strategies with Python covers the fundamentals of trading strategies, including an introduction to quantitative trading, the electronic market, risk and return, and forward and futures contracts. Part two introduces common trading strategies, including trend-following, momentum trading, and evaluation process via backtesting. Part three covers more advanced topics, including statistical arbitrage using hypothesistesting, optimizing trading parameters using Bayesian optimization, and generating trading signals using a machine learning approach. Whether you're an experienced trader looking to automate your trading strategies or a beginner interested in learning quantitative trading, this book will be a valuable resource. Written in a clear and concise style that makes complex topics easy to understand, and chock full of examples and exercises to help reinforce the key concepts, you’ll come away from it with a firm understanding of core trading strategies and how to use Python to implement them. Who This Book Is For Aspiring quantitative traders and analysts, data scientists interested in finance, and researchers or students studying quantitative finance, financial engineering, or related fields.

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
【One-Line Pitch】 A hands-on guide that takes you from the vocabulary of electronic markets to working Python implementations of trend-following, momentum, statistical arbitrage, and machine-learning-driven strategies. Best for aspiring quants, data scientists moving into finance, and students who want code-first exposure to quantitative trading rather than pure theory. 【Book Arc】 - **Opening (~0%–10%)**: Frames what quantitative trading is, the role of a quant trader, and the core workflow—data collection, feature engineering, model development, backtesting, optimization, execution. Solves the "what am I actually building?" question before any code. - **Early (~10%–30%)**: Moves into market microstructure and instruments: cash vs. derivative markets, options payoff shapes, order types (market, limit, stop, stop-limit), and the electronic plumbing of brokers, exchanges, and clearing. Solves the "how does an order actually reach the market?" gap. - **Early–Middle (~30%–45%)**: Introduces forward and futures contracts, leverage, margin, and the clearing house as central counterparty. Also begins practical data work—acquiring, summarizing, and visualizing price/volume with Python and Plotly, including limit order book snapshots. - **Middle (~45%–60%)**: Shifts from market mechanics to strategy construction, covering log returns, technical indicators, moving averages, and the trend-following strategy with step-by-step implementation. Solves the "how do I turn a price series into signals?" problem. - **Late (~60%–80%)**: Extends into momentum trading—lookback windows, monthly returns, terminal return calculation, signal generation, out-of-sample evaluation, and comparison against buy-and-hold. Backtesting becomes the evaluation backbone. - **Ending (~80%–100%)**: Advanced material: statistical arbitrage via hypothesis testing, parameter optimization with Bayesian methods, and generating trading signals with machine learning. Excerpts do not cover the detailed code for these final chapters. 【Key Takeaways】 - **Quantitative trading is a pipeline, not a single model** (Opening): data collection → preprocessing → feature engineering → model → backtesting → optimization → execution. Understanding this sequence prevents treating any one step as the whole job. - **Order type choice is a risk decision** (Early): market orders guarantee execution but not price; limit orders guarantee price but not execution; stop-limit orders combine both and can "miss the market" entirely. Slippage assumptions (e.g., three ticks) drive algorithmic rules. - **The clearing house removes counterparty risk** (Middle): it interposes itself between every buyer and seller, so traders face the exchange rather than each other. This is why futures can function as a zero-sum, daily-settled game. - **Leverage amplifies both directions** (Middle): margin requirements and stop-losses are not optional extras—they are the risk controls that keep a leveraged position survivable. - **Log returns are the working unit for price analysis** (Middle): they make multi-period aggregation and comparison tractable, and they underpin the trend-following implementations. - **Trend-following and momentum are related but distinct** (Late): the book explicitly contrasts them and shows how lookback window length changes signal behavior and out-of-sample results. - **Backtesting must include out-of-sample evaluation and a buy-and-hold benchmark** (Late): in-sample performance alone is not evidence; the momentum chapter demonstrates the comparison workflow. - **Advanced strategies layer statistics and ML on the same foundation** (Ending): hypothesis testing for statistical arbitrage, Bayesian optimization for parameters, and ML for signal generation—each assumes the earlier pipeline is already solid. 【Reading Tips】 - **Deep-read the order-type and clearing-house sections** (Early–Middle): these are the conceptual load-bearing walls; skimming them makes later strategy code feel arbitrary. - **Run the code, don't just read it**: the book is implementation-heavy, and the Plotly visualizations (price/volume overlays, order book animations) are meant to be executed and tweaked. - **Treat the exercises as mandatory**: they reinforce the strategy logic, especially around signal generation and evaluation. - **Skim the data-acquisition boilerplate** (Early): API calls and dataframe setup are necessary but not conceptually dense; focus on what the data represents. - **Pause at the trend-following vs. momentum contrast** (Late): this is where the book's strategy taxonomy clicks; make sure you can articulate the difference in your own words. 【Coverage Limits】 This guide is based on stratified excerpts covering roughly the first half of the book in detail, with only chapter-title-level visibility into the statistical arbitrage, Bayesian optimization, and machine-learning chapters. Specific code, results, and figures from the advanced chapters are not covered here.
Page 1
ring, or related fields. Quantitative Trading Strategies Using Python Technical Analysis, Statistical Testing, and Machine Learning — Peng Liu Table of ConTe...
View in text
Excerpt 2
tify the underlying patterns, trends, and relationships in the data, which will be used to support more informed financial decisions. The interval of stock d...
View in text
Excerpt 3
ot be executed at a price worse than the limit price, thus mitigating the risk associated with market orders. A stop-limit order is a conditional trade that...
View in text
Excerpt 4
the underlying asset to the buyer at the expiration date. Both are derivative products because they depend on another underlying asset: grain, livestock, ene...
View in text
Excerpt 5
each individual asset has its own risk and return profile, and a group of assets can form a portfolio with new risk and return characteristics. At the portfo...
View in text
Excerpt 6
ding risk and retUrn Calculating the Annualized Volatility Following the formula for annualizing the single-period volatility to annual volatility, we can ca...
View in text
Excerpt 7
lative returns of each period for both trading strategies. Specifically, we would like to obtain the final percentage return at the end of 2022 if we started...
View in text
Excerpt 8
1 Firefox/101.0', 'Accept': 'application/json', 'Accept-Language': 'en-US,en;q=0.5', } 183 Chapter 6 MoMentuM trading Strategy Figure 6-3. Illustrating the m...
View in text
Tags
AI categories
PythonData ScienceBackend
ISBN: 1484296745
Publisher: Apress
Publish Year: 2023
Language: English
Pages: 341
File Format: PDF
File Size: 9.1 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…