Quant Lab · free · 44 modules
Quantitative finance, from first principles.
Quantitative finance from first principles, in Python, on real Indian market data. Each module is one idea: the intuition, the maths, a short program you can run and edit in your browser, and what it shows on real NSE data.
LEVEL I
Money, Time and Chance
Returns, compounding, present value and the probability every model is built on.
- MODULE 1 · SOONReturns: Simple, Log and Annualisedwhy log returns add up over time and simple returns don't; annualising a daily return
- MODULE 2 · SOONCompounding and Present Valuefuture value, discounting a cash flow to today, why time beats rate
- MODULE 3 · SOONInflation and Real Returnsnominal vs real return, the Fisher relation, what 6% inflation does to a fixed deposit
- MODULE 4 · SOONExpected Valueprobability-weighted average outcome; positive-EV bets can still lose; the house edge
- MODULE 5 · SOONConditional Probability and Bayes' Ruleupdating beliefs with evidence; why a 90%-accurate signal on a rare event is mostly wrong
- MODULE 6 · SOONThe Random Walkprices as a sum of random steps; why charts of random walks look like trends
- MODULE 7 · SOONThe Square-Root-of-Time Rulevolatility grows with the square root of the horizon; daily to annual
- MODULE 8 · SOONThe Bell Curvemean, standard deviation, the 68-95-99.7 rule, z-scores
LEVEL II
Risk and Reward
Volatility, drawdowns, risk-adjusted returns and the maths of mixing investments.
- MODULE 9 · SOONVolatilitystandard deviation of returns, annualising, rolling volatility
- MODULE 10DrawdownsThe loss that hurts is measured from the peak, and recovering costs more than the fall.
- MODULE 11 · SOONThe Sharpe and Sortino Ratiosreturn per unit of risk; downside-only risk; the risk-free rate in India
- MODULE 12 · SOONVolatility Dragarithmetic vs geometric mean; why +50% then -50% loses money; sigma squared over two
- MODULE 13 · SOONCovariance and Correlationhow two return series move together; correlation is not causation and is unstable
- MODULE 14 · SOONDiversificationportfolio variance with two assets; how low correlation cuts risk
- MODULE 15 · SOONThe Efficient Frontierall mixes of a few assets, the minimum-variance portfolio, why estimates make it fragile
- MODULE 16 · SOONBeta and the CAPMbeta as a regression slope, expected return under CAPM, alpha
LEVEL III
Bets, Sizing and Bad Days
Simulation, fat tails, Value at Risk and how much to bet.
- MODULE 17 · SOONMonte Carlo Simulationsimulating thousands of futures; percentiles of outcomes for a SIP
- MODULE 18 · SOONFat Tailskurtosis; how often 4-sigma days happen vs what the bell curve says
- MODULE 19 · SOONValue at Risk and Expected Shortfallhistorical and parametric VaR, why expected shortfall is better
- MODULE 20The Kelly CriterionHow much should you bet when you have an edge? The answer that maximises long-run growth.
- MODULE 21 · SOONRisk of Ruinprobability of losing a set fraction of capital given win rate, payoff and bet size
- MODULE 22 · SOONPosition Sizingfixed-fractional and volatility-targeted sizing; the same strategy with different sizes
- MODULE 23 · SOONSequence-of-Returns Risksame returns in a different order; why withdrawals make order matter
LEVEL IV
Evidence from Data
Telling skill from luck, and backtests that don't lie to you.
- MODULE 24 · SOONEstimates and Error Barsstandard error of a mean return; why years of data give wide error bars
- MODULE 25 · SOONLuck or Skill?how many coin-flipping fund managers beat the market by chance; multiple testing
- MODULE 26 · SOONFitting a Line to Returnsleast squares, slope and intercept, R squared, residuals
- MODULE 27 · SOONMemory in Pricesautocorrelation of returns and of squared returns; trends vs volatility clustering
- MODULE 28 · SOONHonest Backtestslook-ahead bias, survivorship bias, costs and out-of-sample testing
- MODULE 29 · SOONOverfittingtrying many parameters until one works; in-sample vs out-of-sample decay
- MODULE 30 · SOONTrading Costs in Indiabrokerage, STT, exchange charges, GST, stamp duty and slippage on equity and F&O; turnover kills edges
LEVEL V
Bonds and Derivatives
Yields, futures, options and the models that price them, with NSE examples.
- MODULE 31 · SOONBonds, Yields and Durationprice as discounted coupons, yield to maturity, modified duration, convexity
- MODULE 32 · SOONFutures and the Cost of Carryfair futures price = spot x (1 + r - dividend yield) over time; basis and arbitrage
- MODULE 33 · SOONThe Binomial Option Modelreplicating portfolio, risk-neutral probability, pricing a call on a one- and many-step tree
- MODULE 34 · SOONBrownian Motion and Stock Price Pathsgeometric Brownian motion, simulating paths, the log-normal distribution of prices
- MODULE 35 · SOONBlack-Scholesthe formula for a European call and put, inputs, put-call parity
- MODULE 36 · SOONThe Greeks and Hedgingdelta, gamma, theta, vega; delta-hedging an option
- MODULE 37 · SOONImplied Volatility and the Smilebacking volatility out of a price with Newton's method; why the smile exists
- MODULE 38 · SOONThe Maths of Option Sellinghigh win rate, fat left tail; expected value of a short strangle in a simulation
LEVEL VI
Signals and Portfolios
Momentum, mean reversion, volatility models, factors and regimes.
- MODULE 39 · SOONMomentumtime-series momentum; twelve-minus-one; why it works sometimes and crashes
- MODULE 40 · SOONMean Reversion and Pairsz-score of a spread, half-life, cointegration intuition
- MODULE 41 · SOONVolatility Clustering and GARCHcalm and stormy periods; a GARCH(1,1) recursion by hand
- MODULE 42 · SOONFactor Models and PCAa few common drivers explain many assets; principal components of sector returns
- MODULE 43 · SOONMarket Regimescalm vs stressed states; a two-state mixture; why regime labels are only clear in hindsight
- MODULE 44 · SOONRisk Parity and Risk Budgetingweights that equalise risk contributions instead of capital
Education only. Not investment, tax or trading advice. We never tell you what to buy or sell.