6.1.5 · HinglishAlgorithmic & Quant Trading

Understand statistical arbitrage basics

2,350 words11 min readRead in English

6.1.5 · Stock-Market › Algorithmic & Quant Trading

Statistical Arbitrage Kya Hai?

Teen Pillars

YEH kyun matter karte hain:

  1. Pair Selection — galat pairs = koi mean reversion nahi = losses
  2. Spread Calculation — entry/exit signals define karta hai
  3. Position Sizing — har trade par risk control karta hai

Derivation: Statistical Arbitrage Spread

Step 1: Spread Define Karo

Do assets A aur B ke liye jinke prices aur hain, spread yeh hai:

β·P_B kyun subtract karein? Hum ek stationary series chahte hain. Raw price difference trend karta hai agar ek zyada tezi se badhta hai. Hedge ratio β us trend ko neutralize karta hai.

β kaise find karein? ka par linear regression:

Yeh step kyun? ka variance minimize karta hai — spread ko constant mean ke around oscillate karata hai, drift nahi karne deta.

Step 2: Spread Standardize Karo (Z-Score)

Raw spread ke arbitrary units hote hain. Z-score mein convert karo:

jahan:

  • (lookback window par mean spread)
  • (standard deviation)

Z-score kyun? Dimensionless units se hum universal thresholds set kar sakte hain: "Enter when |z| > 2" kisi bhi pair ke liye kaam karta hai. Yeh yeh bhi measure karta hai ki current divergence kitni "extreme" hai.

2 kyun? Normal distribution assume karte hue, |z| > 2 approximately 5% time hota hai — mispricing signal karne ke liye rare enough, liquidity ke liye common enough.

Step 3: Trading Logic

Entry signals:

  • : Spread bahut zyada high → Short A, Long B (bet ki spread giregi)
  • : Spread bahut zyada low → Long A, Short B (bet ki spread badhegi)

Exit signals:

  • : Position close karo (mean reversion complete)
  • : Stop-loss (relationship break ho gayi hogi)

Yeh step kyun? High |z| temporary dislocation signal karta hai. z=0 par close karna mean reversion profit capture karta hai. Stop-loss structural breaks ke through hold karne se bachata hai.

Worked Example 1: Coca-Cola vs. Pepsi

Setup

  • Historical data: 250 trading days
  • KO prices: mean 3
  • PEP prices: mean 6
  • Correlation: 0.85
  • β calculate karo:

Yeh step kyun? β = ρ·(σ_A/σ_B) regression theory se. KO approximately 0.43 dollars move karta hai har dollar PEP move ke liye.

Day 251: Entry

  • KO = 150
  • Spread:
  • Historical: ,
  • Z-score:

Interpretation: Spread mean se 2.67 SD upar hai (KO, PEP ke relative overpriced hai).

Action: 100 shares KO short karo, 42.5 shares PEP long karo (β·100 = 42.5 dollar neutrality ke liye).

Yeh step kyun? Position sizes equal dollar exposure create karte hain: vs. (rounding ke saath close enough).

Day 260: Exit

  • KO = 148
  • New spread:
  • New z-score:

Exit kyun? z 2.67 se 1.23 par aa gaya (substantial mean reversion). Profit lock in karo.

Profit calculation:

  • KO short: 59 par cover kiya → +$300
  • PEP long: 148 par becha → -$85
  • Net: 215** (costs se pehle)

Profitable kyun? Spread narrow hua (mean reverted) jaise predict kiya tha. Market-neutral: dono stocks gir bhi sakte the — hum phir bhi profit karte agar spread converge hota.

Figure — Understand statistical arbitrage basics

Worked Example 2: Failed Trade (Learning Opportunity)

Setup

  • Gold miners: GDX vs. individual stock GOLD
  • Entry z = -2.5 (GOLD, GDX ke relative underpriced)
  • Action: GOLD long, GDX short

Outcome

  • Gold price industry-wide 15% crash karta hai
  • GOLD 18% girta hai, GDX 14% girta hai
  • Spread aur wide hota hai: z → -3.8
  • Stop-loss z = -3.0 par trigger hota hai
  • Loss: -$450

Yeh fail kyun hua?

  1. Structural break: Cointegration ne stable relationship assume ki thi, lekin GOLD ne poor earnings announce ki
  2. Beta instability: Crashes ke dauran, correlations 1 ki taraf spike karte hain (sab kuch saath girata hai)
  3. Liquidity: Illiquid conditions mein widening spreads

Key lesson: StatArb stationarity assume karta hai. Cointegration check karo (Engle-Granger test) aur structural changes ke liye news monitor karo.

Key Formulas

Realistic Picture

Win Rate vs. Profit Factor

Typical StatArb performance:

  • Win rate: 55–65% (coin flip se barely better!)
  • Avg win: $150
  • Avg loss: $100
  • Profit factor: (0.60 × 150) / (0.40 × 100) = 2.25

Low win rate kyun kaam karta hai: Asymmetric payoff. Mean reversion chhote consistent wins deta hai; stop-loss bade losses cap karta hai. Yeh expectancy ke baare mein hai, accuracy ke baare mein nahi.

Upar ke liye: (0.6 \times 150) - (0.4 \times 100) = 90 - 40 = +\50$ per trade.

Risk: Mean Reversion Ka Half-Life

Half-life = spread ko mean ki taraf 50% decay hone mein lagaane wala time. AR(1) model se calculate karo:

Yeh kyun matter karta hai: Short half-life (minutes–hours) = fast profit/loss. Long half-life (weeks) = capital zyada der ke liye tied up, opportunity cost. Typical pairs trading: half-life 2–10 days.

Example: Agar (previous value ka 90% persist karta hai), half-life = periods.

Recall Feynman Explanation (ELI12)

Socho tumhare paas ek doosre ke saamne do lemonade stands hain. Usually, Stand A 50¢ charge karta hai aur Stand B 45¢ — 5¢ ka consistent fark hota hai kyunki Stand A ki location better hai.

Ek garmi wale din, Stand A panic ho jaata hai aur prices 70¢ tak badha deta hai jabki Stand B 45¢ par rehta hai. Ab fark 25¢ hai — aam se kaafi zyada! Tum jaante ho ki customers Stand B ki taraf jayenge jab tak Stand A prices nahi girata ya Stand B nahi badhaata.

StatArb aisa hai: "Main bet lagata hoon ki Stand A ki price neeche aayegi." Toh tum kisi ko Stand A lemonade (short) aaj ke high price par dene ka promise karte ho, saath mein Stand B lemonade (long) normal price par khareedte ho. Jab prices 5¢ fark par normalize ho jaati hain, tum change pocket kar lete ho.

"Statistical" part ka matlab hai tum pattern (5¢ fark) par bet laga rahe ho, guaranteed profit nahi hai. Kabhi kabhi pattern toot jaata hai (Stand A band ho jaata hai!), isliye tum "stop-loss" set karte ho — maximum loss jo tum accept karoge pattern change maan lene se pehle.

Connections

  • 6.1.01-Introduction-to-algorithmic-trading — StatArb ek quantitative strategy hai jo execution ke liye algos chahti hai
  • 6.1.04-Mean-reversion-strategies — StatArb, mean reversion ka pairs-trading implementation hai
  • 6.2.03-Correlation-vs-cointegration — Pair selection ke liye distinguish karna critical hai
  • 6.2.05-Backtesting-trading-strategies — Stationarity, costs, aur slippage ke liye backtest zaroori hai
  • 5.3.02-Beta-and-systematic-risk — Yahan β hedge ratio hai; CAPM β se related hai lekin context alag hai
  • 7.1.03-Value-at-Risk-VaR — StatArb position-level risk management ke liye VaR use karta hai

#flashcards/stock-market

Statistical arbitrage kya hai? :: Ek market-neutral strategy jo cointegrated asset pairs ke beech spreads ke mean reversion se profit karti hai, simultaneous long/short positions lekar jab spread >N standard deviations deviate kare.

Pairs trading mein hedge ratio β kya hai?
β = Cov(P_A, P_B) / Var(P_B), asset B ke shares ka ratio jo per share of A hold karna hai directional market risk eliminate karne ke liye (portfolio ko market-neutral banane ke liye).
Entry signals ke liye raw spread ki jagah z-score kyun use karein?
Z-score dimensionless aur normalized hota hai, jo kisi bhi pair ke liye universal thresholds allow karta hai (jaise |z| > 2) price scale se regardless, aur divergence ki statistical extremity measure karta hai.
Correlation aur cointegration mein key difference kya hai?
Correlation co-movement measure karta hai (permanently alag drift ho sakta hai); cointegration matlab hai prices ka ek linear combination stationary hai (mean-reverts), jo StatArb profitability ke liye required hai.
Dollar neutrality ke liye position sizes kaise calculate karte hain?
Shares of B = β × Shares of A, ensure karta hai ki A mein invested dollar value approximately B mein dollar value ke barabar ho market direction hedge karne ke liye.
Mean reversion mein half-life kya hai aur yeh kyun matter karta hai?
Half-life woh time hai jisme spread mean ki taraf 50% decay kare (AR(1) model se -ln(2)/ln(φ) se calculate hota hai). Short half-life = fast profit/loss; long half-life = capital zyada der ke liye tied up.
StatArb sirf 55-60% win rate ke saath profitable kyun ho sakta hai?
Expectancy = (P_win × Avg win) - (P_loss × Avg loss). Chhote consistent mean-reversion wins + stop-loss capped losses positive expectancy create karte hain low win rate ke baawajood bhi.
Typical entry aur exit z-score thresholds kya hain?
Entry: |z| > 2 (spread mean se 2 SD door); Exit: z → 0 (mean reversion) ya |z| > 3 (stop-loss, possible structural break).

Concept Map

drives

is

means

requires

requires

requires

needs

defined as

uses hedge ratio

standardized to

threshold triggers

threshold triggers

captures

extreme

Mean Reversion Assumption

Statistical Arbitrage

Market-Neutral Strategy

Beta approx 0 hedged

Pair Selection

Spread Calculation

Position Sizing

Cointegration/Correlation

Spread S = PA - beta times PB

Beta from Regression

Z-Score

Entry when abs z > 2

Exit when z to 0

Convergence Profit

Stop-Loss abs z > 3