Leanpub Header

Skip to main content

Intelligent Markets

Building AI-Driven Algorithmic Trading Systems from First Principles to Production

This book is 100% completeLast updated on 2026-07-30

Artificial intelligence is reshaping financial markets. Intelligent Markets shows you how to build production-ready AI trading systems from first principles, combining market fundamentals, practical architecture, and fully runnable code to create autonomous agents that can research, execute, and manage trades in live markets.

Minimum price

$19.00

$29.00

You pay

Author earns

$

Also available for 1 book credit with a Reader Membership

PDF
EPUB
WEB
APP
396
Pages
About

About

About the Book

The intersection of artificial intelligence and financial markets is the defining technological frontier of modern trading. This book bridges the enormous gap between academic research and production systems, taking you from foundational concepts in market microstructure through to deploying autonomous AI agents that research, plan, and execute trades in live markets. Every concept is explained before implementation; every code example is production-oriented, fully runnable, and thoroughly annotated. By the end of this book, you will have built a complete AI-driven trading system from data acquisition through live execution, with professional-grade architecture, risk management, monitoring, and continuous improvement baked in throughout.

Bundle

Bundles that include this book

Author

About the Author

Steve Publications

Steve is a technology professional with more than 20 years of experience in software development, server infrastructure, cybersecurity, vulnerability research and reverse engineering. Throughout his career, he has designed, secured, analyzed and tested complex software and infrastructure, with a particular focus on understanding how systems fail and how they can be made more secure.

Outside of work, Steve enjoys sharing knowledge with the technology community. He collaborates with researchers, industry experts and technology professionals to write practical books covering software development, cybersecurity, cloud computing, networking, DevOps, artificial intelligence and enterprise technologies. His books focus on practical learning through clear explanations, real-world examples and hands-on exercises. With more than two decades of industry experience, his goal is to help IT professionals, students and technology enthusiasts build useful skills and stay current in a rapidly changing industry.

We believe readers deserve to know how our books are created. Most of our authors are not native English speakers, so we use AI to help translate, proofread manuscripts, fix grammar, improve sentence structure and make technical explanations easier to read. AI is used as an editing tool only. It does not replace the research, technical knowledge or hands-on experience behind our books. Some of our authors also prefer to remain anonymous for privacy or professional reasons. In those cases, we publish their work under a different name. The author's name may be different, but the quality of the content and our review process remain the same.

Every book is written, reviewed and maintained by experienced technology professionals, with contributions from our private technical community of more than 420 engineers and researchers. We spend far more time validating technical accuracy and keeping our content up to date than generating text. We are always interested in working with experienced professionals who have deep expertise in a particular technology or domain. If you would like to publish a book with us or help review an existing manuscript, we'd love to hear from you. Send us a message describing your area of expertise. We are especially interested in niche technologies, specialized skills and emerging topics that are underrepresented in existing technical literature.

If you look through the contents of our books, you'll see practical examples, detailed explanations and material that is regularly updated. Our goal is to publish books that professionals can actually rely on, not low-effort AI-generated content. If you ever feel that one of our books does not meet that standard, Leanpub offers a 60-day money-back guarantee. Feel free to request a refund if you are not satisfied with your purchase.

Contents

Table of Contents

Building AI-Driven Algorithmic Trading Systems from First Principles to Production

Introduction: The Intelligent Market

  1. What This Book Is (and Is Not)
  2. The Gap Between Research and Production
  3. How to Read This Book
  4. Prerequisites and Tools
  5. A Note on Reproducibility
  6. The Cumulative Project: Building a Modular Trading Framework
  7. What Lies Ahead

Chapter 1: Markets and Microstructure — Where Money Moves

  1. How Financial Markets Work
  2. Market Instruments and Asset Classes
  3. Order Types and Execution Mechanics
  4. Price Formation and Market Microstructure
  5. Market Efficiency Hypothesis and Its Limits

Chapter 2: The Quantitative Foundation — Statistics and Probability for Trading

  1. Probability Distributions in Finance
  2. Expected Value, Variance, and Higher Moments
  3. Statistical Inference for Financial Data
  4. Time-Series Properties
  5. Bayesian Thinking for Trading Decisions

Chapter 3: Market Data — Acquisition, Cleaning, and Feature Engineering

  1. Data Sources and APIs
  2. Project Structure, Configuration, and Dependency Injection
  3. Building a Data Pipeline
  4. Cleaning Real-World Financial Data
  5. Feature Engineering for Trading
  6. Alternative Data and Sentiment Features

Chapter 4: Quantitative Trading Strategies — From Alpha to Execution

  1. What Is Alpha?
  2. Trend Following and Momentum Strategies
  3. Mean Reversion and Statistical Arbitrage
  4. Market Microstructure Strategies
  5. Multi-Factor Models and Cross-Sectional Strategies

Chapter 5: Machine Learning for Financial Prediction

  1. Why Standard ML Fails in Finance (and How to Fix It)
  2. Supervised Learning for Price Prediction
  3. Ensemble Methods and Gradient Boosting for Trading
  4. Unsupervised Learning for Market Regimes
  5. Walk-Forward Validation and Avoiding Overfitting

Chapter 6: Deep Learning and Temporal Models

  1. Neural Networks for Time Series (Feedforward Networks, MLPs)
  2. Recurrent Architectures (LSTMs, GRUs for Temporal Dependencies)
  3. Attention Mechanisms and Transformers in Finance
  4. Convolutional Approaches (1D CNNs for Pattern Recognition)

Chapter 7: Reinforcement Learning — Learning to Trade

  1. The RL Formulation of Trading (States, Actions, Rewards, MDPs)
  2. Q-Learning and Deep Q-Networks for Trading
  3. Policy Gradient Methods (REINFORCE, PPO for Portfolio Management)
  4. Building Market Environments for RL Training
  5. Challenges and Practical Considerations in Financial RL

Chapter 8: Large Language Models and Autonomous AI Agents

  1. LLMs for Market Analysis (Sentiment Extraction, News Summarization, Report Analysis)
  2. Building Autonomous Trading Agents (Tool Use, Function Calling, Memory)
  3. Agent Architecture Patterns (ReAct, Planning Loops, Reflection)
  4. Multi-Agent Systems for Trading (Specialized Agents, Coordination, Debate)
  5. Safety Guards and Human-in-the-Loop Design

Chapter 9: Portfolio Optimization and Risk Management

  1. Modern Portfolio Theory and Mean-Variance Optimization
  2. Beyond MVO (Black-Litterman, Risk Parity, Hierarchical Risk Parity)
  3. Position Sizing Methods (Kelly Criterion, Fractional Kelly, Volatility Targeting)
  4. Risk Metrics and Limits (VaR, CVaR, Drawdown Control, Exposure Limits)
  5. Stress Testing and Scenario Analysis

Chapter 10: Backtesting — The Bridge Between Research and Reality

  1. Designing a Backtesting Engine (Event-Driven vs Vectorized Architectures)
  2. Implementing a Complete Backtester in Python
  3. Common Backtesting Pitfalls (Look-Ahead Bias, Survivorship Bias, Overfitting)
  4. Realistic Cost Modeling (Commissions, Slippage, Market Impact)
  5. Performance Attribution and Strategy Diagnostics

Chapter 11: From Paper Trading to Live Execution

  1. Paper Trading and Simulation (Simulated Environments, Latency Modeling)
  2. Broker and Exchange API Integration (REST APIs, WebSocket Feeds, Authentication)
  3. Execution Algorithms (TWAP, VWAP, Implementation Shortfall)
  4. Building a Production Execution Engine (Order Management, Reconciliation)
  5. Cloud Infrastructure and Deployment Patterns

Chapter 12: Monitoring, MLOps, and Continuous Improvement

  1. Real-Time Monitoring and Alerting (P&L Dashboards, Position Monitors)
  2. Model Drift Detection and Retraining Pipelines
  3. MLOps for Trading Systems (Versioning, CI/CD, Model Registries)
  4. Testing Strategies for Trading Systems (Unit, Integration, and Backtest Validation)
  5. Regulatory Compliance and Ethical Considerations

Chapter 13: End-to-End Case Studies

  1. Case Study 1: Cross-Sectional ML Momentum Strategy
  2. Case Study 2: Statistical Arbitrage Pairs Trading System
  3. Wiring Components into Production

Conclusion: The Future of Intelligent Markets

  1. Where the Field Is Heading
  2. What Cannot Be Automated
  3. Final Thoughts

References

Get the free sample chapters

Click the buttons to get the free sample in PDF or EPUB, or read the sample online here

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $15 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub