Learn-Quant¶
138 small, runnable lessons on quantitative finance and the Python it is written in. Each folder covers one idea. The README explains it, the code implements it without leaning on a library to do the hard part, and a test checks the code does what the README says.
Where to start¶
- New to Python. Begin with Python Basics - Numbers and work down the Python Fundamentals tab.
- Comfortable with Python, new to finance. Read Quantitative Methods - Statistics, then Black-Scholes Option Pricing.
- Looking for one topic. Press / to search, or scan the module index.
There are also reading orders for a few common goals.
Tracks¶
| Track | Lessons | Covers |
|---|---|---|
| Python Fundamentals | 10 | Numbers, strings, functions, NumPy and pandas, using market data as the running example. |
| Data Structures | 4 | Arrays, lists, dicts and sets, and when each one is the right container. |
| Algorithms | 8 | Sorting, searching, graphs and dynamic programming applied to prices and orders. |
| Advanced Python | 6 | Async, OOP, multiprocessing and error handling for code that has to keep running. |
| Quantitative Methods | 27 | Statistics, time series, stochastic processes and numerical methods, built from scratch. |
| Options, Derivatives & Finance | 27 | Option pricing and Greeks, bonds and yield curves, valuation and sizing. |
| Risk & Performance | 12 | VaR, drawdowns and the ratios used to judge whether a track record is any good. |
| Portfolio Management | 8 | Mean variance, risk parity, Black Litterman and other ways to size a book. |
| Strategies | 9 | Signals, backtests and execution for the standard strategy families. |
| AI & Machine Learning | 14 | Classifiers, clustering, trees and reinforcement learning, with the leakage traps spelled out. |
| Market Microstructure | 3 | Order books, spreads, liquidity and the cost of actually trading. |
| Utilities & Tools | 10 | Data feeds, logging, FX conversion, calendars and other plumbing. |
Recently added¶
- Portfolio Management - Hierarchical Risk Parity: Markowitz optimisation needs the inverse of the covariance matrix, and the inverse of a noisy matrix is mostly noise.
- Quantitative Methods - Kernel Density Estimation: A histogram of returns looks different every time you move the bin edges.
- Market Microstructure - Liquidity Measures: Every strategy pays to trade, and the size of that bill decides whether a backtest survives contact with a real market.
- Strategies - Optimal Execution: A signal tells you what to own. It does not tell you how to get there.
Running a lesson¶
git clone https://github.com/MeridianAlgo/Learn-Quant
cd Learn-Quant
pip install -r requirements.txt
cd "Quantitative Methods - GARCH"
python garch.py
The getting started page covers virtual environments, the JavaScript lessons and running the tests.