Hedge Tech

Beta Calculation

Beta measures a stock's sensitivity to index moves. We compute it using 20-day rolling returns against Nifty 50, sourced via Yahoo Finance (yfinance). The formula is OLS regression:

Beta (OLS)

β = Cov(R_stock, R_index) / Var(R_index)

Where R = daily % returns on close prices. Computed on the last 20 trading days.

Betas refresh every 30 minutes during market hours. If live data is unavailable the system falls back to curated seed betas. The results page shows a LIVE / SEED badge so you always know the source.

Lookback

20 trading days

Benchmark

Nifty 50 (^NSEI)

Return type

Daily close-to-close

Refresh

30 min (mkt hours)

Exposure & Contract Count

Beta-adjusted market exposure

Exposure = β × Position Value = β × (Quantity × Entry Price)

This is the equivalent Nifty/BankNifty notional that moves in sync with your stock.

Raw contracts required

Raw Contracts = Exposure / (Index Price × Lot Size)

Lot sizes are NSE standard: Nifty 50 = 75 shares, Bank Nifty = 15 shares.

Final contracts (conservative)

Contracts = max(1, floor(Raw Contracts))

We round DOWN for conservative sizing. Minimum is always 1 contract.

Index routing logic

Stocks in Banking or Financial Services sectors route to Bank Nifty. All other sectors use Nifty 50. This matches the index most correlated with your sector.

Protection Score

The Protection Score (0–85) estimates how well the hedge covers your position. It reflects theoretical coverage given current beta and contract sizing — not a guarantee.

Coverage ratio

Coverage = (Contracts × Lot Size × Index Price) / Exposure

A ratio of 1.0 = perfectly sized hedge. > 1 = over-hedged. < 1 = under-hedged.

Protection Score

Score = min(85, round(Coverage × Hedge Efficiency × 85))

Hedge Efficiency accounts for slippage and beta instability (typically 0.90–0.96).

70–85ExcellentCoverage ratio near 1.0, efficient sizing
40–69GoodSlight rounding gap or mild over-hedge
0–39PartialPosition too small for full contract coverage

Limitations & Assumptions

  • Historical beta

    Computed on past 20-day returns. Does not predict future correlation, especially during tail events or circuit breakers.

  • Index price delay

    Yahoo Finance data has a ~15-minute delay. For precision, verify current prices against NSE directly before placing orders.

  • Hardcoded lot sizes

    Nifty 75, Bank Nifty 15. Any NSE-mandated lot-size change requires a code update to stay accurate.

  • Systematic risk only

    The hedge covers market-wide (systematic) risk. Company-specific events — earnings, fraud, regulatory action — are not covered.

  • Margin approximation

    Margin estimates use ~13% of notional. Actual broker margins depend on daily SPAN+Exposure calculations and may differ by ±15%.

  • Intraday scope

    Designed for NSE intraday trades only. Overnight carries, international exposure, and options strategies are out of scope.