Connecting to market data...
6

Level 6 of 7

Advanced Quantitative

Apply machine learning, factor models, and advanced derivatives pricing to financial markets.

18 hours4 modules

Learning Objectives

  • Apply machine learning techniques for return prediction and risk estimation
  • Build and evaluate multi-factor models for Indian equities
  • Price options using Black-Scholes and understand its limitations
  • Model and forecast volatility using GARCH and implied volatility surfaces
  • Design and train deep learning models for financial time series prediction
  • Implement advanced volatility models and stochastic processes for derivatives pricing
1

ML for Finance

4h · 6 topics

Apply machine learning methods for return prediction, risk classification, and pattern detection.

Gradient boostingRandom forestsNeural networksFeature engineeringCross-validationOverfitting detection

Machine learning has transformed quantitative finance, enabling models that capture complex non-linear relationships in market data. However, applying ML to financial markets is fundamentally different from applying it to image recognition or natural language processing — financial data has low signal-to-noise ratio, non-stationary distributions, and severe overfitting risks.

Gradient boosting machines (GBM) — particularly XGBoost, LightGBM, and CatBoost — are the workhorses of quantitative ML. They handle mixed data types, missing values, and non-linear relationships naturally. For predicting Nifty 500 stock returns, a well-tuned GBM with 500-1000 trees typically outperforms neural networks while being more interpretable and faster to train. The key hyperparameters: learning rate (0.01-0.1), max depth (3-8), subsample ratio (0.5-0.8), and column sample ratio (0.5-0.8).

Feature engineering is where domain expertise matters most. Raw price data is rarely predictive — the signal comes from transformations. Effective features for Indian stocks include: momentum (1, 3, 6, 12-month returns), volatility (5, 20, 60-day rolling), volume patterns (delivery percentage, volume relative to 20-day average), technical indicators (RSI, MACD, Bollinger %B), fundamental ratios (PE, PB, ROE, earnings yield), and macro inputs (FII flows, VIX changes, USD/INR changes, G-Sec yield changes).

Purged cross-validation (described by Marcos Lopez de Prado) is essential for financial ML. Standard k-fold cross-validation randomly splits data — this leaks future information into training when the data is a time series. Purged CV ensures that training data does not include any observations occurring after test observations. A gap (purge) between train and test windows prevents leakage from autocorrelated features.

Overfitting detection in ML requires multiple layers of validation. The training set will always show impressive results. The validation set (used for hyperparameter tuning) shows moderated results. The test set (never used during development) shows realistic results. If test set performance is significantly worse than validation, the model is overfit. A performance drop of more than 20% from validation to test is a red flag.

Neural networks can capture deeper patterns but require significantly more data. For Indian stocks, a simple feedforward network with 2-3 hidden layers and dropout (0.2-0.5) can work with 5+ years of daily data for 100+ stocks. LSTMs and transformers are generally inferior to GBM for return prediction tasks — the sequential structure of financial data is different from NLP. Deep learning excels in areas like options pricing and volatility surface modeling where the relationship between inputs and outputs is smoother.

Practical ML pipeline for Indian quant: (1) Feature generation: compute 50-200 features per stock per day; (2) Cleaning: winsorize at 1st and 99th percentile, fill missing values; (3) Cross-sectional ranking: rank features to remove market-wide biases; (4) Model training: LightGBM with purged 5-fold CV, early stopping at 100 rounds; (5) Evaluation: Information Coefficient (IC), rank IC, hit rate, Sharpe ratio of predicted decile portfolios; (6) Production: retrain weekly with a rolling 3-year window.

Key pitfalls to avoid: using future information in features (like future returns or future fundamentals), target leakage (like using price-based features to predict the same price), and ignoring transaction costs (ML models that predict 10 bp per trade are often unprofitable after costs).

2

Factor Models

4h · 6 topics

Build and evaluate factor-based models to explain and predict stock returns.

Fama-French factorsMomentum factorLow volatility anomalyQuality factorFactor construction methodologyFactor correlation analysis

Factor models are the foundation of modern quantitative investing. A factor is a characteristic that explains differences in stock returns. The central insight: instead of analyzing individual stocks, factors capture systematic sources of return that persist across markets and time periods.

The Fama-French three-factor model — market, size, and value — was developed in 1993 and remains the starting point for factor analysis. In Indian markets, researchers have found that the market factor dominates (explaining 70-80% of return variance for individual stocks), with size and value adding marginal but significant explanatory power. The market factor is simply the excess return of the Nifty 500 over the risk-free rate. The size factor (SMB = Small Minus Big) goes long small-cap stocks and short large-cap. The value factor (HML = High Minus Low) goes long high book-to-market (value) stocks and short low book-to-market (growth) stocks.

Momentum is arguably the strongest and most persistent factor across global markets. The momentum factor (WML = Winners Minus Losers) goes long stocks with the best 12-month returns (excluding the last month to avoid short-term reversal) and short the worst performers. In India, momentum has delivered a positive premium of approximately 8-12% annually since 2000, though with significant drawdowns during market reversions — particularly in 2009 and 2020 when the market sharply reversed after crashes.

The low volatility anomaly — the finding that low-volatility stocks outperform high-volatility stocks on a risk-adjusted basis — contradicts the CAPM and is one of the most studied anomalies. In Indian markets, the lowest volatility quintile of Nifty 500 stocks has delivered similar or better absolute returns than the highest volatility quintile with dramatically lower risk. This is explained by the lottery preference (investors overpay for volatile stocks) and leverage constraints (institutions prefer high-beta stocks).

The quality factor captures profitability, stability, and good governance. Quality metrics include: high ROE (return on equity), low debt-to-equity, stable earnings growth, and strong corporate governance scores. In the Indian context, quality has been a strong factor, particularly during market downturns when quality stocks exhibit resilience. The BSE Quality index and other factor indices available in India provide benchmarks for factor performance.

Factor construction methodology is critical. Academic factors use market-capitalization weighting and annual rebalancing. Practical factors for trading use equal weighting and monthly rebalancing. The portfolio approach to factors: rank all stocks by the characteristic, go long the top decile/quintile and short the bottom decile/quintile. The spread between these portfolios represents the factor return.

Factor correlation analysis reveals that factors are not independent. Momentum and value tend to be negatively correlated — momentum works when trends persist, value works when they reverse. Size and value are positively correlated — small-cap stocks tend to be value stocks. Quality and low volatility are highly correlated. Building a multi-factor portfolio requires understanding these correlation structures to achieve true diversification.

For Indian quants, factor-based strategies must account for market structure: the small number of liquid stocks (about 200-300 tradable without high impact), dominance of FII flows in driving factor returns, sector concentration (financials are 35-40% of Nifty 50), and regulatory changes that can disrupt factor premiums. Despite these challenges, factor investing in India offers substantial opportunities for those who can build robust, low-cost factor implementations.

3

Options Pricing

4h · 6 topics

Master options pricing models and their application in Indian markets.

Black-Scholes modelOptions Greeks in depthDividend adjustmentsPut-call parityEarly exerciseAmerican vs European options
This is for educational purposes only. Not investment advice. Options and derivatives trading carries substantial risk and is not suitable for all investors.

Options pricing is the crown jewel of quantitative finance. The Black-Scholes-Merton model, published in 1973, revolutionized financial markets and earned its creators the Nobel Prize. Understanding options pricing — and its limitations — is essential for advanced quant work.

This is for educational purposes only. Not investment advice. Options trading carries substantial risk and is not suitable for all investors.

The Black-Scholes formula for a European call option: C = S x N(d1) - K x e^(-rT) x N(d2), where d1 = [ln(S/K) + (r + s^2/2)T] / (s x sqrt(T)) and d2 = d1 - s x sqrt(T). The terms: S is the current underlying price, K is the strike price, r is the risk-free rate, T is time to expiry, s is volatility, and N() is the cumulative normal distribution function.

Despite its elegance, Black-Scholes makes assumptions that are violated in practice: constant volatility (volatility changes over time), lognormal returns (returns have fat tails), continuous trading (markets have gaps), and no transaction costs (STT and brokerage exist). These violations give rise to the volatility smile and skew observed in options markets.

Put-call parity (C - P = S - K x e^(-rT)) is a powerful relationship that must hold regardless of any pricing model. If violated, arbitrage opportunities exist. In Indian markets, temporary violations occur during extreme volatility or near expiry, but they are quickly exploited by algorithmic traders. Monitoring put-call parity is a useful check for market efficiency.

Delta hedging is the practical application of options theory. By holding delta = N(d1) shares of the underlying for each call option sold, the position becomes delta-neutral — theoretically insensitive to small price moves. The profit or loss from delta hedging an option over its life equals the difference between realized and implied volatility. This is how options market makers earn their living: they sell options at high implied volatility, then delta-hedge, profiting if realized volatility is lower.

The Greeks — delta, gamma, theta, vega, and rho — quantify different dimensions of option risk. Gamma (the rate of change of delta) is highest for at-the-money options near expiry. This is why gamma risk explodes on weekly expiry days in Indian markets — a Nifty at-the-money option on expiry Thursday has enormous gamma, meaning its delta can swing from 0.3 to 0.7 on a 50-point move.

Dividend adjustments are critical for options on Indian stocks. The Nifty 50 has a dividend yield of approximately 1.2-1.5%. Each stock within the index pays dividends at different times. The Black-Scholes model must be adjusted: S_adj = S - PV(dividends). For index options, the continuous dividend yield form is used: C = S x e^(-qT) x N(d1) - K x e^(-rT) x N(d2), where q is the dividend yield.

In Indian markets, options pricing faces unique considerations: weekly expiries create complex term structure dynamics; the Rs 25 strike grid means options are not available at every strike; STT on options adds a significant friction that cannot be ignored; and the India VIX futures market provides a traded instrument for volatility exposure. Advanced quants build local volatility models and stochastic volatility models (like Heston) to better capture the dynamics of the Indian options market.

4

Volatility Modeling

4h · 6 topics

Model and forecast volatility using statistical and econometric techniques.

GARCH modelsRealized volatilityIV surface dynamicsVolatility forecastingVolatility risk premiumRegime-switching volatility

Volatility is the single most important variable in quantitative finance. It is the key input for options pricing, the denominator of the Sharpe ratio, the driver of risk measures like VaR, and the primary determinant of position sizing. Modeling and forecasting volatility is therefore a core quant skill.

Volatility clustering — the tendency for high-volatility periods to follow high-volatility periods — is the most robust empirical regularity in financial markets. The Nifty 50's history shows clear volatility regimes: low volatility (VIX 10-15) during calm periods like 2005-2007 and 2015-2017, and high volatility (VIX 25-50) during crises like 2008, 2020, and geopolitical events. This clustering violates the constant volatility assumption of Black-Scholes and necessitates dedicated volatility models.

The GARCH(1,1) model is the workhorse of volatility modeling: s^2_t = w + a x e^2_(t-1) + b x s^2_(t-1). Current volatility (s^2_t) depends on a constant (w), the most recent squared return (e^2), and the previous period's volatility (s^2). The parameters a and b capture the impact of new information and the persistence of volatility. For the Nifty 50, typical estimates are a = 0.08-0.12 and b = 0.85-0.90, indicating high persistence (shocks decay slowly).

The leverage effect — first noted by Black (1976) — describes the asymmetry in volatility response to positive and negative returns. When stock prices fall, leverage increases (debt/equity ratio rises), making equity riskier and increasing volatility. The EGARCH and GJR-GARCH models capture this asymmetry. For Indian stocks, the leverage effect is pronounced — the Nifty's volatility after a 2% down day is approximately 20-30% higher than after a 2% up day.

Realized volatility is the ground truth. Calculated from intraday data: RV = sqrt(sum(r_i^2)), where r_i are intra-period returns. Using 5-minute or 10-minute returns provides a much more accurate volatility measure than daily data. The ratio of implied volatility (from options) to realized volatility is a key signal — when IV significantly exceeds RV, options are expensive, suggesting short volatility strategies; when IV is below RV, options are cheap, favoring long volatility.

The volatility risk premium (VRP) = implied volatility - realized volatility. In Indian markets, the VRP is typically positive, averaging 2-4 volatility points. This means that option sellers are systematically compensated: they charge more for options than the actual volatility realized. However, the VRP is not constant — it expands during crises (when IV spikes far above RV) and compresses during calm periods. Systematic short VRP strategies (selling options and delta-hedging) have positive expected returns but face severe tail risk.

Volatility forecasting combines GARCH with additional predictors: the level of VIX (which has predictive power for future volatility), trading volume (high volume often precedes high volatility), and macroeconomic variables. Simple combination forecasts — averaging GARCH forecasts with the current VIX level — often outperform more complex models.

In the Indian context, volatility modeling must account for: the strong intraweek pattern (volatility increases on expiry days), the pre-budget volatility spike (typically 2-3 weeks before Feb 1), the monsoon session effect (agricultural price volatility in Jun-Sep), and the tendency for FII flow shocks to trigger volatility regime shifts. A practical approach: maintain separate GARCH models for different market regimes, switching between them based on the current VIX level and FII flow trend.

Ready to Compete?

Apply what you have learned in the QuantX competition. Submit your strategies, climb the leaderboard, and build your Quanta Score.

Enter Competition