QQuant, Built

Labs

One lab per part, written on the House library. Each is seeded, runs in seconds on simulated data, checks its own result against the theory it illustrates, and ends with three things to change.

pip install numpy scipy matplotlib numba
python -m videos.quant.labs --list
python -m videos.quant.labs 26 --show
python -m pytest -q tests/test_quant_labs.py
Lab 1 · The Fair GameIs it a random walk, and is it Gaussian?Lab 2 · The Machinery of MarketsMargin, leverage and the liquidation priceLab 3 · Value, Accounting and the FirmA DCF, its duration, and the rate a price impliesLab 4 · Martingales and MeasureThe doubling system against a fair coinLab 5 · Stochastic CalculusQuadratic variation, and the order of a simulation schemeLab 6 · Financial EconometricsA predictive regression that predicts nothingLab 7 · Time Series and VolatilityFit a GARCH, then race the forecastsLab 8 · Decisions and ControlHow much to bet: Kelly, half Kelly, double KellyLab 9 · No ArbitrageNo arbitrage is a linear programLab 10 · Black–Scholes–MertonManufacture an option by delta hedgingLab 11 · Trading OptionsGamma against theta: explain a day's P&LLab 12 · The Volatility SurfaceFit a smile, read its density, break itLab 13 · Stochastic Volatility and JumpsHeston: the smile from a characteristic functionLab 14 · Rough and Path-Dependent VolatilityRough volatility: estimate H, then price the skewLab 15 · Exotics and Structured ProductsBarriers, and what a snowball buyer has soldLab 16 · Computing PricesMonte Carlo, variance reduction and Sobol: the raceLab 17 · Deep Pricing and HedgingLearn a price from payoffs, with and without their derivativesLab 18 · Money, Bonds and the CurveDuration, convexity, and three factors from one assumptionLab 19 · Term-Structure ModelsOne short rate, a whole yield curveLab 20 · CreditCorrelation decides who loses: the pool and its tranchesLab 21 · Counterparty Risk, XVA and ClearingExposure, collateral and CVA on one swapLab 22 · FX, Commodities and the BasisCarry: the forward curve and what the roll paysLab 23 · Risk and ReturnThe efficient frontier, true and estimatedLab 24 · FactorsDoes the model price the portfolios? The GRS testLab 25 · The Factor ZooThree hundred factors, thirty real: four hurdlesLab 26 · Backtesting Without Fooling YourselfThe best backtest of nothing, and the deflated Sharpe ratioLab 27 · Machine Learning for ReturnsDouble descent, and why returns need the ridgeLab 28 · Text, LLMs and Alternative DataScreening for the words that carry sentimentLab 29 · Alpha Mining and Automated ResearchMining alphas out of noiseLab 30 · Portfolio ConstructionThe minimum-variance portfolio and its broken promiseLab 31 · Risk Models, Costs and Trading Through TimeFrom IC to information ratio to capacityLab 32 · Systematic Macro and Alternative PremiaWhy trend following has positive skewLab 33 · Statistical ArbitrageThe optimal band for a mean-reverting spreadLab 34 · Inside a Quant FirmHow long does a portfolio manager's seat last?Lab 35 · Who Trades With WhomWhy there is a spread: Glosten-Milgrom and KyleLab 36 · The Limit Order BookThe next tick from the queues, and clustered order flowLab 37 · Market Impact and ExecutionOptimal execution: urgency against impactLab 38 · Market Making, ETFs and the Speed RaceThe speed race sets the spreadLab 39 · Crypto and DeFiAn AMM's liquidity provider: loss versus rebalancingLab 40 · Measuring RiskBacktest a risk modelLab 41 · Leverage, Liquidity and CrisesSpirals and contagionLab 42 · Machines in the MarketHerding and the stylized factsLab 43 · Can You Beat the Market?Skill or luck? Counting the funds with real alpha