Leading With Data· a Bicycle Guide

Partial book profile

Reinforcement Learning for Finance A Python-Based Introduction

A concise, Python-based introduction to applying reinforcement learning—especially deep Q-learning—to canonical dynamic decision problems in finance.

The full book profile is not available yet.

Get the book →

What it’s about

This book bridges the gap between reinforcement learning theory and practical financial application by teaching readers how to build self-contained deep Q-learning (and actor-critic) agents in Python and apply them to real financial problems. Starting from the fundamentals of learning through interaction, Bayesian updating, and dynamic programming, it progresses through data augmentation techniques (Monte Carlo simulation and generative adversarial networks) that overcome finance's chronic data-scarcity problem, and culminates in fully worked applications: algorithmic trading, dynamic option hedging, dynamic asset allocation, and optimal execution of large trades. Written by Yves Hilpisch, founder of The Python Quants, the book keeps theory minimal and code central, giving ML practitioners, traders, portfolio managers, and analysts a reusable framework they can adapt to their own ideas.

The through-line

Who it’s for
A machine learning practitioner, quant, trader, portfolio manager, or analyst who wants to apply reinforcement learning to real financial decision problems.
The problem
Financial problems are dynamic decision problems that are hard to solve, and there is little applied, code-focused resource material on using RL for finance. They feel behind the cutting edge and uncertain whether powerful RL breakthroughs from games can translate to finance.
The plan
  1. Learn the basics of learning through interaction, Bayesian updating, and deep Q-learning.
  2. Understand dynamic programming and implement a DQL agent on the CartPole benchmark.
  3. Build a financial environment and train the DQL agent on a prediction game.
  4. Augment scarce financial data using noise addition, Monte Carlo simulation, and GANs.
  5. Apply DQL and actor-critic agents to algorithmic trading, dynamic hedging, asset allocation, and optimal execution.
The payoff
The reader builds working RL agents that learn trading, hedging, allocation, and execution strategies. · They generate unlimited synthetic training data and enrich state representations for better performance. · They possess a reusable framework and reference they return to whenever working with RL for finance.

See our guide

Additional reading

  • Reinforcement Learning: An Introduction · Sutton, Richard S., and Andrew G. Barto

    Cited as the comprehensive and foundational textbook on RL, providing the deep theoretical background for the algorithms implemented and applied throughout the book.

  • Generative Adversarial Nets · Goodfellow, Ian et al.

    The seminal paper that introduced GANs, the technology used in Chapter 5 to generate synthetic financial data, which is a critical step for overcoming data limitations when training RL agents in finance.

  • Optimal Execution of Portfolio Transactions · Almgren, Robert, and Neil Chriss

    A foundational paper on optimal execution cited in Chapter 9. It provides the mathematical model (AC99) that serves as the basis for the execution environment and the benchmark against which the RL agent's performance is measured.

  • The Book of Why: The New Science of Cause and Effect · Pearl, Judea, and Dana Mackenzie

    Referenced in Chapter 3 to highlight a key limitation of simple financial prediction models: the agent's actions often have no causal impact on the environment, which challenges a core principle of interactive learning in RL.

Featured in these guides

Co-cited books