---
title: "Python Trading Course: from scratch to quant"
description: "Python trading course in 8 levels: data, honest backtesting, derivatives, risk, machine learning, LLMs and production. From scratch to advanced quant."
url: "https://pythonparatrading.com/en/python-trading-course/"
lang: "en"
image: "https://pythonparatrading.com/og/en/python-trading-course.png"
---

# Python Trading Course

> Eight modular, cumulative levels, from Python from scratch to a system in production. The common thread is not indicators but a method: clean data, hypothesis, honest backtest, statistical validation, risk, execution and monitoring.

- Levels: 8
- Hours: 750–850
- Routes: 4

## Level map

0. [Python from scratch and a data mindset](https://pythonparatrading.com/en/python-trading-course/level-0/) · 80–100 h · Prerequisite: None · Profile: No programming experience
1. [Financial data, markets and analysis](https://pythonparatrading.com/en/python-trading-course/level-1/) · 90–100 h · Prerequisite: Basic Python, high-school statistics · Profile: Programmer without finance, or trader with some Python
2. [Systematic strategies and rigorous backtesting](https://pythonparatrading.com/en/python-trading-course/level-2/) · 110–120 h · Prerequisite: Solid pandas, OHLCV, returns and drawdown · Profile: Data analyst, technical discretionary trader
3. [Derivatives: futures, spreads, forex and options](https://pythonparatrading.com/en/python-trading-course/level-3/) · 110–120 h · Prerequisite: Level 2; basic calculus · Profile: Futures or options trader who wants to systematise
4. [Portfolios, risk, execution and live trading](https://pythonparatrading.com/en/python-trading-course/level-4/) · 90–100 h · Prerequisite: Levels 2 and 3; basic linear algebra · Profile: Manager or trader who wants to trade live
5. [Machine learning and deep learning (Keras/PyTorch)](https://pythonparatrading.com/en/python-trading-course/level-5/) · 120–140 h · Prerequisite: Levels 1 and 2; linear algebra, probability · Profile: Data scientist, junior quant
6. [Generative AI, LLMs, agents, big data and alternative data](https://pythonparatrading.com/en/python-trading-course/level-6/) · 90–110 h · Prerequisite: Level 5 or equivalent ML · Profile: Quant or ML engineer
7. [Production, MLOps, regulation, career and capstone](https://pythonparatrading.com/en/python-trading-course/level-7/) · 60–80 h · Prerequisite: Levels 4 to 6 · Profile: Quant who wants a professional system

*Fig. — Estimated hours per level and for the capstone.* Range bars with the hours of each level: level 0, 80 to 100; level 1, 90 to 100; level 2, 110 to 120; level 3, 110 to 120; level 4, 90 to 100; level 5, 120 to 140, the longest; level 6, 90 to 110; level 7, 60 to 80; capstone, 40 to 80. About 750 to 850 hours in total.

## Routes by profile

- **Complete beginner.** About 12 to 18 months at 10–15 hours a week. Risk and execution (level 4) before derivatives (level 3). [Level 0](https://pythonparatrading.com/en/python-trading-course/level-0/) → [Level 1](https://pythonparatrading.com/en/python-trading-course/level-1/) → [Level 2](https://pythonparatrading.com/en/python-trading-course/level-2/) → [Level 4](https://pythonparatrading.com/en/python-trading-course/level-4/) → [Level 3](https://pythonparatrading.com/en/python-trading-course/level-3/) → [Level 5](https://pythonparatrading.com/en/python-trading-course/level-5/) → [Level 6](https://pythonparatrading.com/en/python-trading-course/level-6/) → [Level 7](https://pythonparatrading.com/en/python-trading-course/level-7/)
- **Experienced discretionary trader.** Entry test and an accelerated level 0. Levels 5 and 6 are optional. Entry test → [Level 0](https://pythonparatrading.com/en/python-trading-course/level-0/) → [Level 1](https://pythonparatrading.com/en/python-trading-course/level-1/) → [Level 2](https://pythonparatrading.com/en/python-trading-course/level-2/) → [Level 3](https://pythonparatrading.com/en/python-trading-course/level-3/) → [Level 4](https://pythonparatrading.com/en/python-trading-course/level-4/) → [Level 5](https://pythonparatrading.com/en/python-trading-course/level-5/) (optional) → [Level 6](https://pythonparatrading.com/en/python-trading-course/level-6/) (optional)
- **Programmer or data scientist.** Entry test. From level 1, the markets part; from level 5, the finance part. Entry test → [Level 1](https://pythonparatrading.com/en/python-trading-course/level-1/) → [Level 2](https://pythonparatrading.com/en/python-trading-course/level-2/) → [Level 3](https://pythonparatrading.com/en/python-trading-course/level-3/) → [Level 4](https://pythonparatrading.com/en/python-trading-course/level-4/) → [Level 5](https://pythonparatrading.com/en/python-trading-course/level-5/) → [Level 6](https://pythonparatrading.com/en/python-trading-course/level-6/) → [Level 7](https://pythonparatrading.com/en/python-trading-course/level-7/)
- **Advanced quant.** Individual modules: spreads and volatility (level 3), financial ML (level 5), LLMs and alternative data (level 6) and MLOps (level 7). individual modules: [Level 3](https://pythonparatrading.com/en/python-trading-course/level-3/), [Level 5](https://pythonparatrading.com/en/python-trading-course/level-5/), [Level 6](https://pythonparatrading.com/en/python-trading-course/level-6/), [Level 7](https://pythonparatrading.com/en/python-trading-course/level-7/)

*Fig. — Routes through the course by starting point.* Grid of four profiles by levels. From scratch: levels 0, 1, 2, 4, 3, 5, 6 and 7, in that order. Discretionary trader: entry test and levels 0 to 4, with 5 and 6 optional. Programmer or data scientist: test and levels 1 to 7. Advanced quant: individual modules from levels 3, 5, 6 and 7.

## Approach

This is an open course: every lesson is published and you can follow it at your own pace, with no sign-up. The full course takes about 750–850 hours, plus the final project. Each level has explicit prerequisites and an entry self-assessment to place yourself: a beginner starts at level 0 with Python from scratch, an experienced programmer can start at level 2 and a quant at levels 5 to 7. Each level ends with an integrating project you build on your own.

AI (machine learning, deep learning, LLMs and agents) is presented as a powerful tool, but its results are judged with scepticism. Anti-overfitting validation (purged CV, deflated Sharpe, walk-forward, paper trading) runs through the whole syllabus: it is not an isolated module.

Design principles:

- **Multiple entry points.** Each level has prerequisites and an entry self-assessment (for example, 20 coding exercises and 20 conceptual questions) to decide for yourself whether you can skip it.
- **Two tracks in parallel.** Programming, data and AI on one side; markets, instruments and risk on the other. Each level combines both so you never program in a vacuum.
- **Learning by doing.** Each module ends with a notebook or script and a self-assessment quiz, and each level with an integrating project. A single Git repository grows throughout the course until it becomes the student's personal framework.
- **Statistical rigour throughout.** Biases (look-ahead, survivorship, data snooping, overfitting) appear from level 1 and recur at every level.
- **Research is not production.** Research tools (vectorbt, notebooks) versus production tools (NautilusTrader, LEAN, typed code, tests, Docker).
- **AI with quantified scepticism.** Every ML, DL or LLM technique is compared against naive baselines (random walk, buy & hold, simple momentum) and against transaction costs.
- **Spain/EU context without losing the global view.** Brokers accessible from Spain, ESMA/MiFID II, PRIIPs, MiCA and IRPF (Spanish personal income tax) taxation, in a block of its own and in notes within each asset class.
- **AI coding assistants, with rules.** First you learn to write and read code unaided (level 0). Then assistants (Copilot, Claude Code, Codex, Cursor) with mandatory review, tests and version control.

## What changes in 2026

What has changed compared with the 2020–2023 courses, and what the syllabus reflects:

- **Python.** Python 3.14 (7 October 2025) made free-threaded mode (no GIL) official, although it remains optional. Python 3.15 was released on 9 October 2026 with lazy imports, UTF-8 by default and an improved experimental JIT. Python 3.10 reaches end of support on 31 October 2026. The course teaches 3.13/3.14 as the stable base and shows 3.15; some key libraries, such as NautilusTrader, required Python 3.12–3.14 in September 2026.
- **Environments.** uv has become the de facto standard: according to the PyCharm blog (March 2026), about 124 million monthly downloads. In March 2026 Astral announced it was joining OpenAI, with a commitment to keep uv, Ruff and ty open source. uv 0.13.0 (9 October 2026) already uses Python 3.15 by default. The course teaches uv and Ruff; conda and pip only as context.
- **DataFrames.** pandas 3.0 (21 January 2026) makes Copy-on-Write mandatory, introduces a PyArrow-backed `str` type and requires Python 3.11+. Many old tutorials (chained assignment, `dtype == object` checks) no longer work. Polars and DuckDB on Parquet/Arrow are the natural route for large data on a single machine.
- **Backtesting.** backtrader has not published a release since April 2023 (1.9.78.123) and is frozen in practice. NautilusTrader (Rust core, the same code in backtest and live, LGPL-3.0) and vectorbt (vectorised, for parameter sweeps) are the references. backtrader remains a teaching tool.
- **Brokers.** ib_async is the community-maintained successor to ib_insync, after the death of its creator, Ewald de Wit.
- **Data.** Polygon.io was renamed Massive on 30 October 2025. Databento has established itself as a professional provider for CME, US equities and OPRA: historical data is pay-per-use and real-time data is by subscription. yfinance is still unofficial and suffers recurring rate-limit errors.
- **Deep learning.** Keras 3 is multi-backend (JAX, TensorFlow, PyTorch). It allows teaching Keras as a high-level API and PyTorch as a research framework without duplicating the syllabus.
- **New mandatory blocks.** Time series foundation models (Chronos-2, TimesFM-2.5, Moirai-2.0), LLMs, RAG and agents, MCP (Model Context Protocol), alternative data and MLOps.

*Fig. — The course's recommended 2026 stack, by layer.* Table of twelve layers and their tools: environment, Python 3.13/3.14, uv and Ruff; data, pandas 3.0, Polars, DuckDB and Parquet; econometrics, statsmodels and arch; backtesting, vectorbt and NautilusTrader; derivatives, QuantLib and py_vollib; portfolios, Riskfolio-Lib and PyPortfolioOpt; ML and DL, scikit-learn, LightGBM, Keras 3 and PyTorch; time-series foundation models, Chronos-2 and TimesFM-2.5; LLMs and agents, transformers, LangGraph and MCP; brokers, ib_async, Alpaca, MetaTrader5, OANDA and ccxt; data providers, Massive, Databento, FRED and EDGAR; production, Docker, Prefect and MLflow.

## Mistakes it prevents

The syllabus covers them explicitly, at the level where they appear and in the following ones:

- Look-ahead bias: signals executed at the same close they are computed from, fundamentals used before they are published.
- Survivorship bias.
- Data snooping without multiple-testing correction.
- Ignored costs: spread, slippage, financing, roll, funding.
- Badly built continuous futures series.
- Information leakage in ML: normalising with the full history, random k-fold, overlapping labels.
- Confusing an LLM's general capability with investment capability.
- Moving to real money without paper trading or automatic risk limits.

## Reference programmes

- **QuantInsti EPAT.** A 6-month online programme with more than 120 hours of live classes and about 150 of self-study: seven preliminary levelling modules (Python, statistics, markets…) and 11 core modules. In 2026 it added an options backtesting module and a quant and HFT systems track; the firm also launched “Agentic AI for Trading”, an 8-hour course on Quantra. The education market now includes options and AI agents as blocks of their own.
- **CQF (Certificate in Quantitative Finance).** Six core modules, from the foundations of stochastic calculus to two data science and machine learning modules (supervised, unsupervised, deep learning, NLP and reinforcement learning), plus fixed income and credit, with electives in algorithmic trading, advanced machine learning and generative AI. More mathematical and derivatives-oriented than operational.
- **Spain.** IEB has a specialisation programme in quantitative trading and market microstructure, with Python for trading, pairs trading, algorithmic scalping, data skills and AI as an accelerator acting as a “junior dev”. Instituto BME offers the MIAX master's, focused on AI in investment management, and the MFIA. Udemy and training academies are full of beginner and intermediate courses centred on indicators, MetaTrader 5 and Interactive Brokers.

*Fig. — Course hours versus QuantInsti's EPAT.* Horizontal bars: this course, 750 to 850 hours plus the capstone; EPAT, about 270 hours, 120 or more of live classes and about 150 of self-study.

No programme covers both the path from scratch to quant and every asset class. Spanish-language courses tend to stop at technical indicators and basic ML, with little statistical validation and almost nothing on futures spreads, volatility surfaces, alternative data or MLOps. That is the gap this syllabus fills.

## Resources

| Block | Books | Libraries and data |
|---|---|---|
| Python and data (levels 0–1) | Fluent Python (Ramalho); Python for Data Analysis (McKinney); Trading and Exchanges (Harris); Python for Finance (Hilpisch) | uv, pandas, Polars, DuckDB; yfinance, FRED, Massive, Databento, EDGAR |
| Strategies and backtesting (level 2) | Algorithmic Trading and Quantitative Trading (Chan); Systematic Trading (Carver); Python for Algorithmic Trading (Hilpisch) | vectorbt, NautilusTrader, statsmodels, arch; LEAN |
| Futures, spreads and options (level 3) | Advanced Futures Trading Strategies (Carver); Hull; Natenberg; Volatility Trading and Positional Option Trading (Sinclair) | pysystemtrade, QuantLib, py_vollib; CME and OPRA via Databento, Deribit |
| Portfolios, risk and execution (level 4) | Active Portfolio Management (Grinold and Kahn); Machine Learning for Asset Managers (López de Prado); Algorithmic and High-Frequency Trading (Cartea et al.) | Riskfolio-Lib, PyPortfolioOpt, skfolio, QuantStats; ib_async, alpaca-py, ccxt |
| ML and DL (level 5) | Advances in Financial Machine Learning (López de Prado); Machine Learning for Algorithmic Trading (Jansen); Deep Learning with Python (Chollet) | scikit-learn, LightGBM, Optuna, SHAP, Keras 3, PyTorch, Chronos/TimesFM |
| LLMs, alternative data and production (levels 6–7) | Alternative Data (Denev and Amen); TradingAgents and LiveTradeBench papers; Designing Data-Intensive Applications (Kleppmann) | transformers, LangGraph, FAISS/pgvector, Playwright; Docker, Prefect, MLflow |

## Recommendations

- **Do not start with indicators or with AI.** Levels 0 to 2 (Python, data, honest backtesting) separate a serious course from a commercial one. Without them, ML and LLMs only produce more expensive overfitting.
- **Two backtesting engines, not five.** vectorbt for research and NautilusTrader (or LEAN) for production. backtrader only as a teaching tool, with a warning that it is not maintained.
- **Data.** yfinance for learning, because it is free though unstable. For serious projects, a paid provider suited to the asset class: Massive for US equities and options, Databento for CME futures and OPRA, and exchange APIs via ccxt for crypto. Learning to read licences is part of the job.
- **Keras and PyTorch, without duplication.** Keras 3 as a fast modelling API (it can use the PyTorch backend) and PyTorch for custom architectures and foundation models.
- **LLMs as assistant analysts and engineers, not as autonomous traders.** The 2025–2026 evidence (LiveTradeBench, AlphaCrafter, time series foundation model benchmarks) justifies this approach. Execution and risk stay in deterministic code.
- **Mandatory, short EU/Spain block (8–10 hours).** It prevents expensive mistakes: trying to buy US ETFs, trading CFDs without understanding ESMA leverage limits, using crypto exchanges not authorised under MiCA or ignoring the two-month rule.
- **Project work and paper trading before real money.** Nobody should finish without having seen the gap between their backtest and their live execution.
- **Annual syllabus review.** pandas 3.0, Python 3.15, the Polygon rename, OpenAI's acquisition of Astral and the end of the MiCA transitional period all happened in just 12 months: the syllabus is reviewed every year to keep up with that pace.

## Caveats

- **Estimated hours.** They are indicative and come from comparison with EPAT (about 270 hours of classes and self-study) and the CQF. The real pace depends heavily on each person's mathematical background.
- **Alternative data figures.** Market size estimates vary widely. According to its report “The state of the alternative data market in 2026” (February 2026), Neudata estimates that managers spent about 2,800 million dollars in 2025, 17% more than the previous year; some consultancies publish figures of 17,000–30,000 million for 2026 with much broader definitions. Treat them as indicative and cite specialist sources.
- **Evidence on AI.** Much of it comes from recent preprints (arXiv 2025–2026), with short samples or few assets, and it can change quickly. Positive results published by the authors of a framework (for example, TradingAgents) do not include audited live trading.
- **Prices and project status.** Data provider prices and library maintenance status are as of October 2026 and change often. Massive prices come from independent trackers and have not been verified on its website.
- **Taxation and regulation.** These are general notes for Spain and the EU, not advice. The foral territories (Basque Country and Navarre) have their own scales and the rules change: check with an adviser and with the official sources (AEAT, CNMV, ESMA).
- **Risk.** Trading with leverage, derivatives and crypto carries a risk of significant loss. No syllabus guarantees returns: the realistic goal of the course is to build judgement and method.

## Capstone

At the end of level 7, a 40 to 80 hour project you build on your own: a multi-asset futures system, a systematic options book, an equity portfolio with ML, a research platform with LLMs and alternative data, or crypto market making and arbitrage. Common guidance: reproducible repository, anti-overfitting validation, risk report and at least four weeks of paper trading.
