Ledger & Candle
Chapter 11 · Risk & Systems

Risk Management & Trading Psychology

Reading time ~110 min · Data as of 30 Sep 2026 · Based on Zerodha Varsity Module 9 (Risk Management & Trading Psychology) and Module 13 (Innerworth – Mind over Markets)

1. What you'll learn and why it matters

Chapters 2 to 10 were about finding trades and investments. This chapter covers the part that decides whether you are still in the game after five years: how much you bet, how much you can lose, and how you behave while losing. Most traders spend 90% of their effort on entries. Most of the damage comes from the other 10%.

The numbers are stark. SEBI's study of individual traders in equity derivatives for FY25–FY26 found that 87.7% of individual F&O traders made a net loss in FY26, with aggregate net losses of about ₹91,685 crore. Even before transaction costs, 82.1% were losing. Few of those people lacked information or chart patterns. What most lacked was position sizing, a stop they respected, and a process that kept their emotions out of the order window.

By the end of this chapter you will be able to:

How to read this long chapter

The chapter has three parts. You don't need to read them in one sitting.

Short on time? Read Sections 7, 9.2, 10, 11, 13.1 and 14 first, then come back for the rest. The formulas look heavy in places, but every one has a worked example with real numbers right below it.

Why this matters for each kind of market participant

Swing traders take dozens of trades a year. Over that many trades, bet size matters more than any single entry. Long-term investors face a different risk: concentration and deep drawdowns. Several blue chips in our data fell 50% or more in 2024–26. Futures traders run on 5–9x leverage, so the arithmetic of ruin arrives fast: one bad day can wipe out a quarter of the margin. The tools differ a little for each group. The principle is the same: decide the loss before you decide the trade.

About the data: every number in this chapter comes from course/scripts/ch11_figures.py, which reads the course's daily NSE data (to 30 Sep 2026), the NSE futures bhavcopy and SPAN file for 30 Sep 2026, and the 2,187 completed historical trades from the four swing setups of Chapter 5 (S1 trend pullback, S2 52-week breakout, S3 support bounce, S4 weekly trend + daily trigger, all with R net of costs; R means a trade's profit or loss measured in units of the risk planned at entry, so −1R is a normal stop-out, defined fully in Section 11). All the numbers are saved in data/extra/ch11_results.json.

2. What "risk" means, and the kinds you will face

In everyday language risk means "something bad might happen". In markets it has two working meanings. Keep both in mind:

2.1 Systematic vs unsystematic risk

Varsity starts the module with this split, and it is the most useful one to learn first.

Two horizontal bar charts of one-day returns for 36 stocks. Left, 7 April 2025: 35 of 36 fell, Nifty -3.24%. Right, 27 February 2025: Nifty flat, POLYCAB -18.8%
Figure 11.1: Two kinds of bad day. Left: on 7 Apr 2025 (global tariff sell-off) the Nifty fell 3.24% and 35 of our 36 stocks fell. Diversification within Indian equities did not help. Right: on 27 Feb 2025 the Nifty was flat (−0.01%), but POLYCAB fell 18.8% on news of a large new competitor entering wires and cables. A 15-stock portfolio would have felt that as about a 1.3% hit. Source: NSE data via Yahoo Finance.
Real example · POLYCAB · 27 Feb 2025

Company-specific risk, measured

  1. Previous close (25 Feb 2025; 26 Feb was a market holiday): ₹5,765.60. Open on 27 Feb: ₹5,400.00, already a gap of \(5400/5765.6-1 = -6.3\%\).
  2. Low of the day ₹4,656.00. Close ₹4,679.55. One-day return \(4679.55/5765.6-1=-18.84\%\).
  3. The same day the Nifty moved −0.01% and the median stock in our list moved −0.57%. The loss was almost entirely company-specific.
  4. Held as 1 of 15 equal-weight positions (6.67% each), the hit to the portfolio is about \(0.0667\times(-18.84\%) \approx -1.26\%\). As a 30% position it is −5.65%. Position weight is what turns company risk into portfolio risk.
Real example · Nifty 50 & India VIX · 7 Apr 2025

Systematic risk: nowhere to hide inside equities

On 7 Apr 2025 the Nifty fell 3.24%, India VIX jumped 65.6% to 22.79, 35 of 36 stocks fell, and the median stock lost 2.70%. TRENT fell 14.77% (₹5,562.85 to ₹4,740.95), the market sell-off plus the reaction to its own quarterly business update. Holding more Indian stocks would not have helped that day. Lower equity exposure, cash, gold or a hedge would have.

2.2 The other risks a trader actually meets

RiskWhat it isReal example from our dataMain control
Market (systematic)Everything falls togetherNifty −38.4% from 14 Jan to 23 Mar 2020; −15.8% from 26 Sep 2024 to 4 Mar 2025Asset allocation, hedges, regime filter (Ch 5), lower size in high VIX
Company-specificOne business has a bad eventPOLYCAB −18.8% in a day (27 Feb 2025)Diversification, position limits (e.g. max 10–20% per stock)
Gap riskPrice opens beyond your stop, so the stop fills far worse than plannedONGC opened 6.45% below its previous close on 2 Feb 2026 and stopped a trade out at −3.54R instead of −1R (Section 9)Smaller size around results/events; options hedge; assume 2–3R worst case
Liquidity riskYou cannot exit near the screen price in sizeMedian daily traded value Jul–Sep 2026: HDFCBANK ₹1,967.8 cr vs IRCTC ₹34.7 crTrade liquid names; keep position below ~1% of daily value; use limit orders
Leverage riskSmall price moves become large moves on your own moneyThe Nifty's −3.26% day on 19 Mar 2026 equals about −₹48,000 on one NIFTY futures lot at 30 Sep 2026 prices, 28.8% of its margin in one session (Section 10)Size by risk not by margin; keep unused margin; never average down a futures loser
Concentration riskToo much money in one stock or themeAn IT-heavy portfolio: TCS −56.5% and INFY −50.7% peak-to-trough (2024–26)Per-stock and per-sector caps
Correlation risk"Different" positions are really one betFive S4 entries on 21 Sep 2026 were all stopped out within 8 days, −5.25R together (Section 14)Portfolio heat cap, sector limits, count correlated trades as one
Model / regime riskA tested edge stops workingS4 earned +0.30R per trade 2017–2026 overall but −0.10R per trade from 2024 (Section 11)Monitor live expectancy; equity-curve sizing; small size on new systems

The table needs one reading habit: most of these risks are invisible on a chart while you are entering. A clean breakout chart doesn't show that it is your fourth bank trade this week, that results are due in two days, or that the stock trades only ₹30 crore a day. Your risk process has to ask those questions for you.

Real data · median daily traded value, Jul–Sep 2026

Liquidity differs by a factor of 50 even among large caps

StockMedian daily value (₹ crore)1% of daily value (₹)
HDFCBANK1,967.819.68 crore
RELIANCE1,325.313.25 crore
DIXON529.95.30 crore
POLYCAB249.42.49 crore
CDSL148.91.49 crore
IRCTC34.735 lakh

A common rule of thumb is to keep an order below about 1% of the stock's typical daily value so that your own order barely moves the price. For a retail account of ₹5–50 lakh every stock above clears that easily. Liquidity risk bites in small caps, on circuit-limit days, and in far-month futures and deep out-of-the-money options. Those are exactly the places beginners drift into.

3. Diversification maths: variance, covariance, correlation

Varsity spends four chapters building portfolio risk from first principles. The logic is simple even though the algebra looks heavy: portfolio risk depends on each stock's own volatility and on how the stocks move together. The "together" part is what diversification works on.

3.1 Variance and standard deviation of one stock

Variance and standard deviation (sample) \[ \sigma^2 = \frac{1}{n-1}\sum_{t=1}^{n}(r_t-\bar r)^2, \qquad \sigma=\sqrt{\sigma^2}, \qquad \sigma_{\text{annual}}=\sigma_{\text{daily}}\sqrt{252} \]
\(r_t\)
The stock's return on day \(t\), as a fraction: \(P_t/P_{t-1} - 1\), where \(P\) is the closing price (0.01 = +1%).
\(n\)
How many daily returns you have. Six closes give five returns.
\(\bar r\)
The mean (average) of those returns. A bar over a symbol always means "average of".
\(\sum_{t=1}^{n}\)
"Add up the expression for every day from 1 to \(n\)."
\(\sigma^2\)
The variance: the average squared distance of daily returns from their mean. Dividing by \(n-1\) rather than \(n\) is the standard correction for a sample. It makes almost no difference with a year or more of data.
\(\sigma\)
The standard deviation (volatility): the square root of the variance, back in "percent per day" units.
\(\sigma_{\text{daily}},\ \sigma_{\text{annual}}\)
Volatility per trading day and per year. 252 is roughly the number of trading days in a year.
  1. Subtract the average return from each day's return, and square the result. Squaring makes every deviation positive and penalises big moves more heavily.
  2. Add the squares and divide by \(n-1\). That is the variance.
  3. Take the square root to get the daily standard deviation.
  4. Multiply by \(\sqrt{252}\) to annualise. This assumes days are roughly independent, so risk grows with the square root of time.
Worked example · HDFCBANK · last 5 sessions to 30 Sep 2026

Variance by hand

  1. Closes 23–30 Sep 2026: 737.25, 728.90, 735.60, 719.05, 722.70, 708.70.
  2. Daily returns \(r_t = P_t/P_{t-1}-1\): −1.1326%, +0.9192%, −2.2499%, +0.5076%, −1.9372%.
  3. Mean \(\bar r = -0.7786\%\).
  4. Squared deviations: 0.00001253, 0.00028824, 0.00021647, 0.00016543, 0.00013424. Sum = 0.00081691.
  5. Sample variance = 0.00081691 / (5−1) = 0.00020423. Standard deviation = \(\sqrt{0.00020423}=1.429\%\) per day.

Five days is far too few for a real estimate. Varsity suggests at least a year of data, and the rest of this chapter uses two years (1 Oct 2024 to 30 Sep 2026, 495 sessions). The point here is only to see the mechanics.

3.2 Covariance and correlation

Covariance and correlation \[ \text{Cov}(A,B)=\frac{1}{n-1}\sum_{t}(r_{A,t}-\bar r_A)(r_{B,t}-\bar r_B) \] \[ \rho_{A,B}=\frac{\text{Cov}(A,B)}{\sigma_A\,\sigma_B}\in[-1,+1] \]
\(A,\ B\)
Two stocks, for example HDFCBANK and ICICIBANK.
\(r_{A,t},\ r_{B,t}\)
The daily return of stock \(A\) and of stock \(B\) on the same day \(t\).
\(\bar r_A,\ \bar r_B\)
Each stock's average daily return over the period.
\(n\)
The number of days with a return for both stocks.
\(\text{Cov}(A,B)\)
The covariance: positive if the two tend to be above (or below) their averages on the same days, negative if one tends to be up when the other is down.
\(\sigma_A,\ \sigma_B\)
Each stock's standard deviation, from the formula above.
\(\rho_{A,B}\)
The correlation (Greek letter rho): covariance rescaled so it always lies between −1 and +1.
  1. For each day, multiply stock A's deviation from its average by stock B's deviation from its average. Same-direction days give a positive product, opposite-direction days a negative one.
  2. Add the products and divide by \(n-1\). That is the covariance.
  3. Divide by both standard deviations to get the correlation. +1 means lock-step, 0 means no linear relation, −1 means opposite moves.

Covariance asks whether two stocks tend to be above their averages on the same days. The raw number is hard to read, so we scale it into correlation: +1 means they move in lock-step, 0 means no linear relation, −1 means they move in opposite directions. Over the same five days, ICICIBANK's returns gave a covariance with HDFCBANK of −0.0000424 and a correlation of −0.19. Five days of noise, though. Over two years the correlation is +0.51. Always use enough data.

3.3 Two-stock portfolio: where the diversification benefit comes from

Two-asset portfolio variance \[ \sigma_p^2 = w_1^2\sigma_1^2 + w_2^2\sigma_2^2 + 2\,w_1 w_2\,\rho_{12}\,\sigma_1\sigma_2 \]
\(\sigma_p^2,\ \sigma_p\)
The variance and the volatility of the whole portfolio (subscript \(p\)).
\(w_1,\ w_2\)
The weights: the share of the money in stock 1 and stock 2, as fractions that add up to 1 (50/50 is 0.5 and 0.5).
\(\sigma_1,\ \sigma_2\)
Each stock's own volatility. Use daily or annual figures, but the same for both.
\(\rho_{12}\)
The correlation between the two stocks' returns, from the formula above.

How it works: square each weight × volatility and add them. Then add the interaction term, 2 × both weights × correlation × both volatilities. Take the square root of the total for the portfolio's volatility. The lower the correlation, the smaller the interaction term, and the lower the portfolio's risk.

The first two terms are each stock's own risk. The third term is the interaction. If \(\rho=1\), the formula collapses to \(\sigma_p = w_1\sigma_1+w_2\sigma_2\): a plain weighted average, so no benefit at all. Any \(\rho<1\) makes \(\sigma_p\) smaller than the weighted average. That gap is the "free lunch" of diversification.

Worked example · HDFCBANK + SUNPHARMA 50/50 · Oct 2024 – Sep 2026

Plugging real numbers into the formula

  1. Annual volatilities: HDFCBANK \(\sigma_1=19.82\%\), SUNPHARMA \(\sigma_2=20.12\%\). Correlation \(\rho=0.1235\). Weights 0.5 each.
  2. \(w_1^2\sigma_1^2 = 0.25\times0.1982^2 = 0.009821\)
  3. \(w_2^2\sigma_2^2 = 0.25\times0.2012^2 = 0.010120\)
  4. \(2w_1w_2\rho\sigma_1\sigma_2 = 2\times0.25\times0.1235\times0.1982\times0.2012 = 0.002462\)
  5. \(\sigma_p^2 = 0.022404\), so \(\sigma_p=\sqrt{0.022404}=14.97\%\).
  6. Compare: the simple average of the two volatilities is 19.97%. With \(\rho=0\) it would be 14.12%. A low correlation removed about a quarter of the risk without giving up any expected return.
Portfolio volatility against weight for three stock pairs; the low-correlation pair bends furthest below the straight line
Figure 11.2: Two-stock portfolios across all weights. HDFCBANK+ICICIBANK (two private banks, ρ = 0.51) bend only slightly below the dotted straight line. HDFCBANK+SUNPHARMA (bank + pharma, ρ = 0.12) bend much further: the 50/50 mix has 14.97% volatility versus an average of 19.97%. ITC+BEL (ρ = 0.22) reaches its minimum risk of 17.09% at 74% ITC. Data: daily returns 1 Oct 2024 – 30 Sep 2026.

3.4 The correlation matrix: see your hidden bets

With many stocks you need every pairwise correlation. Arranged in a grid, they form the correlation matrix. It is the single most useful risk picture for a swing trader with several open positions, because it shows which "different" trades are really the same trade.

Heatmap correlation matrix of 16 stocks and GOLDBEES; banks and IT form dark red blocks
Figure 11.3: Correlation of daily returns, Oct 2024 – Sep 2026. The five banks average 0.45 with each other, and the three IT names average 0.72 (TCS–INFY 0.75 is the highest pair). ITC–INFY is only 0.12 and HDFCBANK–SUNPHARMA 0.12. The gold ETF (GOLDBEES) averages 0.09 with these stocks. A long TCS and a long INFY trade are close to one double-sized bet on IT.

3.5 How many stocks are enough?

If you hold \(n\) equal-weight stocks, portfolio variance is approximately

Equal-weight n-stock portfolio \[ \sigma_p^2 \approx \frac{1}{n}\,\overline{\sigma^2} + \left(1-\frac{1}{n}\right)\overline{\text{Cov}} \]
\(n\)
The number of stocks, each holding the same share \(1/n\) of the money.
\(\sigma_p^2\)
The portfolio's variance.
\(\overline{\sigma^2}\)
The average variance of the individual stocks (the bar means "average").
\(\overline{\text{Cov}}\)
The average covariance across every pair of stocks: how much they move together on average.

How it works: the first term is divided by \(n\), so it shrinks as you add stocks: with 10 stocks only a tenth of the average variance is left. The weight on the second term, \(1 - 1/n\), heads towards 1, so the portfolio's variance settles at the average covariance and goes no lower. Take the square root for volatility.

As \(n\) grows, the first term (company-specific risk) shrinks towards zero. The second term (average covariance, the market risk) stays. That is the maths behind "diversification removes unsystematic risk but not systematic risk".

Average portfolio volatility falls from 25.5% with one stock to about 14% with 15 stocks and flattens near the Nifty's 13.1%
Figure 11.4: 1,500 random equal-weight portfolios for each size from 1 to 30 stocks, drawn from 35 large caps (Oct 2024 – Sep 2026). Average volatility: 1 stock 25.5%, 5 stocks 16.5%, 10 stocks 14.95%, 15 stocks 14.39%, 20 stocks 14.13%, 30 stocks 13.84%. The theoretical floor (average covariance) is 13.25%, almost exactly the Nifty's 13.12%.
How to use it

Going from 1 to 10 stocks removes most of the avoidable risk. Beyond 15–20 the extra benefit is tiny, and you begin to own "the index with extra steps". For an investor, 12–20 well-chosen stocks across at least 5–6 unrelated sectors is a sensible range, or simply use an index fund for the core. For a swing trader holding 4–8 positions, the job is to make sure those positions are not all from one correlated block.

Limitation

Correlations are measured from the past and they rise in crashes. Section 14 shows the average pairwise correlation of our stocks jumping from a median of 0.22 to 0.57 in March 2020. Diversification is weakest exactly when you need it most. Plan for that.

4. Portfolio variance for many stocks, the equity curve and expected range

Varsity uses matrix algebra to extend the two-stock formula to any number of stocks. The steps are worth knowing once, because Python and Excel then do them for you.

Matrix form (k stocks) \[ \Sigma = \frac{X^{\mathsf T}X}{n} \;\;(\text{variance-covariance matrix of de-meaned returns } X) \] \[ \sigma_p^2 = (w\circ\sigma)^{\mathsf T}\, C\, (w\circ\sigma) = w^{\mathsf T}\Sigma\, w \]
\(k,\ n\)
The number of stocks, and the number of trading days of data.
\(X\)
An \(n\times k\) table (\(n\) rows of days, \(k\) columns of stocks) of daily excess returns: each stock's return minus its own average return.
\(X^{\mathsf T}\)
The transpose of \(X\): the same table turned on its side, so rows become columns. Multiplying \(X^{\mathsf T}X\) adds up "deviation × deviation" for every pair of stocks at once.
\(\Sigma\)
The \(k\times k\) variance-covariance matrix: each stock's variance on the diagonal and each pair's covariance off it. (Same Greek letter as the "add up" sign, but standing on its own it names this matrix.) Varsity divides by \(n\), not \(n-1\). With hundreds of days the difference is negligible.
\(C\)
The \(k\times k\) correlation matrix (Section 3.4).
\(w\)
The list (vector) of portfolio weights, one per stock, adding up to 1.
\(\sigma\)
The list of each stock's daily standard deviation.
\(w\circ\sigma\)
The \(\circ\) means multiply item by item, so this is the list of "weight × standard deviation" for each stock.
\(\sigma_p^2\)
The portfolio's daily variance. Its square root is the daily portfolio volatility.
  1. Build \(X\): subtract each stock's average return from its daily returns.
  2. Compute \(\Sigma = X^{\mathsf T}X / n\).
  3. Divide each entry by the two stocks' standard deviations to get \(C\).
  4. Multiply the weight × SD list by \(C\), and then by the list again. That gives one number, the portfolio variance. (\(w^{\mathsf T}\Sigma\, w\) is the same calculation done straight from \(\Sigma\).)
  5. Take the square root for daily volatility, and multiply by \(\sqrt{252}\) for annual. It is the two-stock formula of Section 3.3 extended to every pair. Python, or Excel's MMULT, does the multiplying for you.
Real example · 5-stock portfolio · 1 Oct 2024 – 30 Sep 2026 (493 common days)

HDFCBANK 25%, INFY 20%, ITC 15%, SUNPHARMA 15%, TITAN 25%

StockWeightDaily SDWeight × SDMean daily returnAnnualised (×252)
HDFCBANK25%1.247%0.3118%−0.0308%−7.76%
INFY20%1.764%0.3528%−0.1001%−25.23%
ITC15%1.183%0.1774%−0.1040%−26.20%
SUNPHARMA15%1.266%0.1899%−0.0035%−0.88%
TITAN25%1.429%0.3571%+0.0445%+11.20%
  1. Pairwise correlations range from 0.118 (INFY–ITC) to 0.307 (HDFCBANK–TITAN), all low.
  2. \((w\circ\sigma)^{\mathsf T} C (w\circ\sigma) = 0.00007283\) (daily variance). Square root: 0.853% per day.
  3. Annualised: \(0.853\%\times\sqrt{252}=13.55\%\). The weighted average of the five annual volatilities is 22.05%, so correlation below 1 cut the risk by about 39%.
  4. Check: computing the SD of the actual daily portfolio returns gives the same 0.853%. The matrix route is just a shortcut.

4.1 The equity curve

Varsity's chapter 6 normalises the portfolio to ₹100 at the start and tracks its value each day. This equity curve is the honest summary of an investment or a trading system: return, path and drawdowns in one picture. Always plot it against a benchmark.

Equity curve of the 5-stock portfolio vs Nifty from Oct 2024 to Sep 2026, with drawdown panel below
Figure 11.5: The 5-stock portfolio (buy and hold) fell from ₹100 to ₹84.42 over two years, while the Nifty fell to ₹87.69. Maximum drawdown: portfolio −16.86%, Nifty −15.18%. Low volatility is not the same as good returns: three of the five stocks fell (INFY −43.5%, ITC −42.2%, HDFCBANK −17.3%; dividend-adjusted).

4.2 Expected return and a realistic range

Varsity's portfolio expected return and range \[ E[R_p] = \sum_i w_i\,\bar r_i \times 252 \] \[ \text{range} = E[R_p] \pm k\,\sigma_{p,\text{annual}} \;\;(k=1,2,3 \to \approx 68\%,95\%,99.7\%) \]
\(E[R_p]\)
The expected annual return of the portfolio, as a %. \(E[\ldots]\) means "expected value", i.e. the average outcome.
\(w_i\)
The weight of stock \(i\) (its share of the money, as a fraction).
\(\bar r_i\)
Stock \(i\)'s average daily return over the data period.
252
Trading days in a year: it turns an average daily return into an annual one.
\(\sum_i\)
"Add up over every stock \(i\) in the portfolio."
\(\sigma_{p,\text{annual}}\)
The portfolio's annual volatility, from the matrix formula above.
\(k\)
How many standard deviations wide the range is. 1 covers about 68% of years if returns were normal, 2 about 95%, 3 about 99.7%.
  1. Multiply each stock's average daily return by its weight, add them up, and multiply by 252. That is the centre of the range.
  2. Add and subtract \(k\) times the portfolio's annual volatility to get the range for that confidence level.
Worked example · same 5-stock portfolio

What the last two years "predict"

  1. Weighted annual contributions: HDFCBANK −1.939%, INFY −5.046%, ITC −3.930%, SUNPHARMA −0.132%, TITAN +2.801%. Sum \(E[R_p] = -8.25\%\).
  2. \(\sigma_p = 13.55\%\). One-SD range: −21.79% to +5.30%. Two-SD: −35.34% to +18.85%. Three-SD: −48.89% to +32.39%.
  3. The realised buy-and-hold CAGR was −8.29%, consistent, since we measured on the same period.

Read this carefully. The "expected" return is simply the past average projected forward. Two years earlier (Oct 2022 – Sep 2024) the same five stocks averaged +13% to +39% a year each. Means estimated from a couple of years of data are extremely noisy. Volatility and correlation estimates are far more stable than return estimates, so use this method to judge the width of the range, not its centre.

5. Portfolio optimisation and the efficient frontier, and its limits

Harry Markowitz's insight, which Varsity's chapters 8–9 walk through with Excel Solver: for any set of stocks you can try every combination of weights and plot each portfolio's risk against its expected return. Two special portfolios stand out:

The optimisation problem \[ \min_{w}\; w^{\mathsf T}\Sigma w \quad\text{s.t.}\quad \sum w_i = 1,\;\; w_i\ge 0,\;\; w^{\mathsf T}\mu = \text{target return} \]
\(\min_{w}\)
"Find the weights \(w\) that make the next expression as small as possible."
\(w^{\mathsf T}\Sigma w\)
The portfolio's variance, from the matrix formula in Section 4.
s.t.
"Subject to": the rules the weights must obey.
\(\sum w_i = 1\)
The weights add up to 100%: all the money is invested.
\(w_i \ge 0\)
No weight is negative, so no short selling.
\(\mu\)
The list of each stock's expected (average past) return. \(w^{\mathsf T}\mu\) is the portfolio's expected return.
target return
The return you ask the portfolio to deliver. Drop this rule and you get the minimum-variance portfolio.

How it works: for one chosen target return, a solver (Excel Solver or Python) tries weights until it finds the mix with the lowest risk. Repeat for many targets and plot each answer's risk against its return: the line traced is the efficient frontier.

Left: efficient frontier with 4000 random portfolios; right: expected vs realised returns out of sample, all negative
Figure 11.6: Left, the frontier for our five stocks using Oct 2024 – Sep 2026 data. Minimum variance: 12.52% volatility (HDFCBANK 22.6%, INFY 10.2%, ITC 28.8%, SUNPHARMA 28.4%, TITAN 10.0%). Our 25/20/15/15/25 mix (13.56% risk, −8.25% return) sits inside the cloud. At the same 13.56% risk, the best mix returned −2.2% and the worst −19.2%. Right, the honest test: weights "optimised" on Oct 2022 – Sep 2024 promised +25% to +30% a year, and all three delivered about −9% to −10% a year over the next two years.
Honest example · optimisation out of sample

Why the frontier is a teaching tool, not a crystal ball

  1. Fit on Oct 2022 – Sep 2024: annual mean returns were HDFCBANK +13.4%, INFY +20.1%, ITC +28.2%, SUNPHARMA +38.9%, TITAN +22.1%. The "max-return at equal-weight risk" mix put 42.1% in SUNPHARMA and expected +29.5% a year.
  2. Hold for Oct 2024 – Sep 2026: that mix actually returned −8.91% a year (max drawdown −17.5%). Minimum-variance returned −9.25% and equal weight −10.09%.
  3. The volatility forecasts held up well: minimum-variance expected 11.18% volatility and realised 12.60%. The return forecasts were useless.

Lesson: optimisers treat noisy past returns as facts and pile into whatever did best recently. Use the frontier's risk insight (combine low-correlation assets, avoid concentration) and treat its return outputs with deep suspicion. Equal weight or simple caps per stock and sector are hard to beat in practice.

6. Value at Risk: historical, variance-covariance and expected shortfall

Value at Risk (VaR) answers one question: "On a normal bad day, how much could this portfolio lose?" Formally, the 95% one-day VaR is the loss that should be exceeded on only 5% of days (about one day in twenty, or 12–13 days a year).

Three ways to estimate it \[ \text{Historical VaR}_{95} = -\,\text{5th percentile of past daily returns} \] \[ \text{Parametric (variance-covariance) VaR}_{95} = -(\mu - 1.645\,\sigma_p) \] \[ \text{VaR}_{99} = -(\mu - 2.326\,\sigma_p) \] \[ \text{Expected shortfall (CVaR)}_{95} = -\,\text{average of the returns below the 5th percentile} \]
\(\text{VaR}_{95},\ \text{VaR}_{99}\)
One-day Value at Risk at 95% and 99% confidence, as a % of the portfolio. Written as a positive loss. Multiply by the portfolio value for ₹.
5th percentile
The return that 5% of days were worse than. With 252 days, sort them from worst to best: it sits around the 13th-worst day.
\(\mu\)
The portfolio's average daily return (Greek letter mu).
\(\sigma_p\)
The portfolio's daily standard deviation (Section 4).
1.645, 2.326
Fixed numbers from the normal (bell) curve: only 5% of outcomes fall more than 1.645 standard deviations below the average, and only 1% more than 2.326 below.
Expected shortfall (CVaR)
The average loss on the days that were worse than the VaR cut-off.
  1. Historical: sort past daily returns and read off the 5th percentile. Flip the sign to report it as a loss.
  2. Parametric: assume returns follow a bell curve. Take the average return and subtract 1.645 standard deviations (2.326 for 99%). Flip the sign.
  3. Expected shortfall: average all the returns worse than the 5th percentile. It is always a bigger loss than VaR, because it looks inside the tail rather than at its edge.

A note on vocabulary: Varsity's VaR chapter sorts the portfolio returns and takes the average of the worst 5%. Textbooks call that number expected shortfall or CVaR, and reserve "VaR" for the 5th-percentile cut-off itself. Both are useful. CVaR is always the larger loss, because it averages the tail beyond the cut-off. We compute both below.

Real example · ₹10 lakh in the 5-stock portfolio · last 252 sessions to 30 Sep 2026

One-day VaR three ways

  1. Historical: sort the 252 daily returns (23 Sep 2025 – 30 Sep 2026). The 5th percentile is −1.41%. 95% VaR = 1.41% × ₹10,00,000 = ₹14,098. The 99% historical VaR is −2.38% = ₹23,814.
  2. Expected shortfall: the 13 worst days averaged −2.03%, so CVaR95 = ₹20,329. (This is "VaR" the way Varsity computes it.)
  3. Parametric: mean \(\mu=-0.0359\%\), \(\sigma=0.9063\%\). \(1.645\sigma = 1.4908\%\). VaR95 \(= -(−0.0359\% − 1.4908\%) = 1.53\%\) = ₹15,267. VaR99 = 2.14% = ₹21,439.
  4. Multi-day: using the square-root-of-time rule, 10-day parametric VaR95 ≈ ₹15,267 × √10 ≈ ₹48,280.
  5. Back-test: parametric VaR95 was breached on 9 of 252 days versus 12.6 expected. That is reasonable in a calm year. The worst day (23 Mar 2026, −3.32%) was a 3.6-sigma move, which "should" almost never happen under a normal curve. Returns have fat tails: extreme days happen more often than the normal curve predicts (excess kurtosis 1.43; a normal distribution has 0).
Histogram of daily portfolio returns with normal curve and three vertical lines for historical VaR, parametric VaR and CVaR
Figure 11.7: Distribution of the portfolio's daily returns over the last 252 sessions, with a normal curve of the same mean and SD. Vertical lines: historical VaR (−1.41%), parametric VaR (−1.53%), CVaR (−2.03%).

6.1 When VaR fails: March 2020

Honest example · Nifty 50 · VaR from 2019, tested in 2020

A fair-weather number

  1. Using all of 2019, the Nifty's daily SD was 0.878% and parametric VaR95 was −1.39%.
  2. In the crash window of 20 Feb – 30 Apr 2020 (45 sessions), a 5% breach rate would predict about 2.25 breaches. There were 15. In the first half of 2020 there were 23 breaches in 122 days.
  3. On 23 Mar 2020 the Nifty fell 12.98%: 9.3 times the VaR, a 14.8-sigma event under 2019's normal distribution. On that model it was essentially impossible. It happened anyway.
  4. A milder repeat: on 7 Apr 2025 the Nifty fell 3.24%, a 3.7-sigma day against the previous year's VaR of −1.43%.
Nifty daily returns Jul 2019 to Jun 2020 with the 2019 VaR line; many red breaches clustered in March 2020
Figure 11.8: Nifty daily returns, Jul 2019 – Jun 2020, against the 95% VaR estimated from 2019. Breaches (red) cluster: in a crisis, bad days come in bunches.
How to use VaR without being fooled by it

VaR is a good "normal weather" gauge: if your ₹10 lakh portfolio routinely loses ₹15,000 on a bad day and that makes you anxious, you hold too much risk. It says nothing about how bad the worst days are. Always pair it with a stress test: "what if the market does a March 2020 (−13% in a day, −38% peak-to-trough) or an April 2025 (−3% in a day with VIX +66%)?" For a futures trader, a stress test is mandatory. The next sections show why.

Checkpoint: Part A in five lines

7. Why position sizing comes first: gambler's fallacy and recovery maths

Varsity opens its position-sizing chapters with a poker story: lose the first two small bets, raise the third to "win it back", lose that too, and the buy-in is gone in ten minutes. Two ideas explain why that happens to traders.

7.1 Gambler's fallacy

The gambler's fallacy is the belief that after a run of losses a win is "due". If your trades are roughly independent, the odds on the next trade are the same as they were on the first. A system with a 38% win rate still has a 62% chance of losing the next trade after eight losses in a row. Raising size after losses ("martingale" thinking) leaves your odds unchanged and puts the biggest bets in the worst stretch.

7.2 Recovery maths: losses and gains are not symmetric

Gain needed to recover a loss \[ \text{Gain needed} = \frac{1}{1-L} - 1 = \frac{L}{1-L} \qquad (L = \text{loss as a fraction}) \]
\(L\)
The loss from the peak, as a positive fraction: a 20% fall is \(L = 0.20\). This fall from a previous high is called a drawdown.
Gain needed
The % rise required from the low to get back to the old peak, as a fraction (0.25 = +25%).

How it works: after losing \(L\), you have \(1 - L\) of your money left. To get back to 1 you must multiply it by \(1/(1-L)\). Subtract 1 to express that as a gain. The gain is always bigger than the loss because it is earned on a smaller base.

Example: ₹5,00,000 falls 20% to ₹4,00,000. Gain needed \(= 0.20 / 0.80 = 0.25\), i.e. +25%, since ₹4,00,000 × 1.25 = ₹5,00,000. At \(L = 0.50\) it is \(0.50/0.50 = 1\), i.e. +100%.

Loss from peakGain needed to get backWhat it feels like
−5%+5.3%A normal month
−10%+11.1%Uncomfortable, recoverable
−15%+17.6%Nifty from Jan 2026 high to 30 Mar 2026
−20%+25.0%Most people start breaking rules here
−25%+33.3%
−30%+42.9%A year or more of good trading to repair
−40%+66.7%
−50%+100%TCS, INFY, IRCTC from their 2024 peaks
−60%+150%
−75%+300%Account effectively ruined
−90%+900%
Left: curve of gain needed vs loss, rising steeply; right: Nifty 50 underwater chart 2016-2026 with COVID crash -38.4% and recent drawdowns
Figure 11.9: Left, the recovery curve. Right, the Nifty's "underwater" chart (distance below its previous peak). COVID crash: −38.44% from 12,362.30 (14 Jan 2020) to 7,610.25 (23 Mar 2020), back above the old peak on 9 Nov 2020, 205 sessions later. The 26 Sep 2024 peak (26,216.05) led to −15.77% by 4 Mar 2025. A new high of 26,328.55 on 2 Jan 2026 was followed by a fall to 22,331.40 on 30 Mar 2026 (−15.18%). On 30 Sep 2026 the Nifty (22,620.45) was 14.08% below its high and needed +16.39% to recover.
Real data · peak-to-trough falls in large caps, 2024–2026 (Close prices)

"Blue chip" does not mean "small drawdown"

StockPeak (date)Trough (date)DrawdownGain needed30 Sep 2026 vs peak
IRCTC₹1,126.0 (22 May 2024)₹452.5 (29 Sep 2026)−59.8%+148.8%−59.6%
TCS₹4,553.8 (30 Aug 2024)₹1,982.6 (1 Jul 2026)−56.5%+129.7%−55.0%
ADANIENT₹3,645.2 (3 Jun 2024)₹1,758.8 (30 Mar 2026)−51.8%+107.3%−20.4%
INFY₹1,999.7 (13 Dec 2024)₹985.3 (1 Jul 2026)−50.7%+103.0%−50.3%
ITC*₹503.4 (26 Sep 2024)₹255.5 (31 Aug 2026)−49.2%+97.0%−47.8%
DIXON₹18,940.2 (17 Dec 2024)₹9,673.0 (30 Mar 2026)−48.9%+95.8%−30.8%
HDFCBANK₹1,012.9 (30 Jul 2025)₹687.1 (9 Sep 2026)−32.2%+47.4%−30.0%
RELIANCE₹1,600.9 (8 Jul 2024)₹1,161.9 (4 Mar 2025)−27.4%+37.8%−25.9%

*In January 2025 ITC demerged its hotels business, and shareholders received ITC Hotels shares separately. In our data, ITC's prices before the demerger are scaled down so the series stays comparable across it. The ITC Hotels shares are not tracked here. Prices are split- and bonus-adjusted (HDFCBANK 1:1 bonus in Aug 2025). The lesson for investors: a concentrated portfolio of "safe" large caps could have sat 50% underwater for two years. Diversification across sectors and a written rule for when a thesis is broken (Chapter 17) are your defence.

The core rule

Because losses compound against you, the first job of position sizing is to keep drawdowns in the shallow part of the curve, where recovery takes months, not years. Small accounts are tempted to take big bets "to make it worthwhile". Varsity warns against exactly that. A small account blown up teaches you nothing a small account sized properly couldn't.

8. How much capital do you really have? Three equity models

Every sizing rule says "risk X% of your capital". So what is your capital while some of it is already tied up in open trades? Varsity (following Van Tharp) gives three models:

ModelEquity = …Character
Core equityStarting capital − capital allocated to open positionsMost conservative. Each new trade shrinks the base for the next one.
Total equityFree cash + margin blocked + mark-to-market P&L of open positionsMost aggressive. Paper profits immediately increase your bet size.
Reduced total equityCore equity + profit already locked in by trailing stopsMiddle ground. Only profit you cannot lose (stop above entry) counts.
Worked example · ₹5,00,000 account · margins from NSE SPAN file, 30 Sep 2026

The same account, three equity numbers

  1. You buy 1 lot of INFY Oct-26 futures (400 shares at ₹1,002.60). Margin blocked (SPAN + 3.5% ELM) = ₹77,008.
  2. Core equity = 5,00,000 − 77,008 = ₹4,22,992. Your next trade is sized off this.
  3. Illustration: suppose INFY later shows an open profit of ₹10,000 and you have trailed the stop so that ₹4,000 of it is locked in. Total equity = 4,22,992 free + 77,008 margin + 10,000 = ₹5,10,000. Reduced total equity = 4,22,992 + 4,000 = ₹4,26,992.
  4. Risking 1% means ₹4,230 (core), ₹5,100 (total) or ₹4,270 (reduced total) on the next trade.

For a beginner, use core equity or reduced total equity. Total equity scales you up on paper profits that can vanish overnight.

9. Position sizing methods for shares

Varsity's chapter 13 says it neatly: with 3 ways to measure equity and 4 ways to size, you have 12 combinations. Here are the methods, from crude to refined, with real numbers. The base case throughout: ₹5,00,000 account, prices as of 30 Sep 2026.

9.1 Unit per fixed amount (and fixed rupee amount)

"Trade 1 lot per ₹2 lakh" or "put ₹1 lakh into every position." Simple, and it scales with the account. Its flaw: it ignores risk. A volatile stock and a sleepy one get the same money, so a stop hit costs very different amounts.

In the table below the stop is placed 2 × ATR(14) below the close. ATR(14), the Average True Range, is the average daily trading range over the last 14 sessions including overnight gaps (Wilder's method, Chapter 4); Section 9.3 uses it for sizing.

Real numbers · ₹1 lakh per position, stop at 2 × ATR(14)

Same rupees in, very different rupees at risk

StockCloseShares for ₹1 lakhLoss if stopped (2 ATR)
SBIN959.50104₹3,477
SUNPHARMA1,816.6055₹3,522
BEL388.30257₹3,657
HDFCBANK708.70141₹3,935
TATASTEEL184.30542₹4,791
ETERNAL320.00312₹5,089
DIXON13,100.007₹5,270
INFY994.10100₹5,386

The risk differs by 55% between SBIN and INFY for the "same" position. Over many trades, your results end up driven by whichever stocks happened to be volatile.

9.2 Percentage risk: the 1–2% rule

This is the method most professionals use and the one this course recommends. Varsity notes that professional traders rarely risk more than 1–3% of capital on one trade. You decide the maximum loss per trade as a percentage of equity, and the distance to your stop then sets the quantity.

Percentage-risk position size \[ \text{Risk budget} = \text{Equity}\times \text{risk\%} \] \[ \text{Quantity} = \left\lfloor \frac{\text{Risk budget}}{\text{Entry} - \text{Stop}} \right\rfloor \] \[ \text{then cap at } \frac{\text{Equity}\times\text{max position\%}}{\text{Entry}} \]
Equity
Your trading capital in ₹, measured by one of the models in Section 8 (core equity for a beginner).
risk%
The most you are willing to lose on this one trade, as a % of equity: 1% in this course's examples.
Risk budget
That maximum loss in rupees.
Entry, Stop
Your planned buy price and stop-loss price, in ₹ per share. Entry − Stop is the rupee risk per share.
\(\lfloor x \rfloor\)
"Round \(x\) down to a whole number". You can't buy part of a share, and rounding up would risk more than the budget.
max position%
The largest share of equity you allow in one stock, for example 25%. Dividing that rupee amount by the entry price gives the most shares you may hold.
  1. Multiply equity by risk% to get the rupees you can afford to lose.
  2. Divide by the risk per share and round down. If the stop is hit, you lose about the risk budget.
  3. Check the position value (quantity × entry). If it is more than your maximum position, use the smaller quantity from the cap.
Real trade · AXISBANK · entry 17 Aug 2026 (Chapter 5 setup)

A winner, sized by the 1% rule

  1. Entry ₹1,220.00, stop ₹1,206.41 (a tight swing-low stop). Risk per share = 1,220.00 − 1,206.41 = ₹13.59.
  2. 1% of ₹5,00,000 = ₹5,000. Quantity = ⌊5,000 / 13.587⌋ = 367 shares. Position value = 367 × 1,220 = ₹4,47,740, which is 89.5% of the account.
  3. At 2% risk the formula says 735 shares = ₹8,96,700: more than the whole account. In a cash account you cannot buy that without leverage. The cap of ₹5,00,000 / 1,220 = 409 shares applies.
  4. Exit on 31 Aug 2026 at ₹1,272.00. Profit at 1% size = 367 × 52 = ₹19,084 = +3.83R gross (+3.61R after costs).

Lesson: a very tight stop produces a very large position. Add a maximum position size (for example 20–25% of equity per stock) as a second limit, and accept a smaller rupee risk on tight-stop trades. framework.risk.position_size(..., max_position_pct=25) does exactly this.

Honest example · ONGC · entry 30 Jan 2026

When the stop does not protect you: a gap

  1. Entry ₹273.89, stop ₹267.40. Risk per share ₹6.49. At 1% of ₹5 lakh: ⌊5,000 / 6.488⌋ = 770 shares. Planned maximum loss ≈ ₹4,996.
  2. 30 Jan closed at ₹268.96, just above the stop. The next session in our data (2 Feb 2026) opened at ₹251.60, 6.45% below the previous close and well below the stop.
  3. Actual loss = 770 × (273.89 − 251.60) = ₹17,163 = 3.43% of the account, or −3.54R after costs, three and a half times the plan.
  4. Across all 2,187 completed Chapter 5 trades, 89 (4.1%) exited via a gap below the stop, averaging −1.14R. Only 0.23% of trades lost more than 2R, but this one did.

This is why the 1% rule must be 1%, not 5%. At 5% risk the same gap would have cost 17% of the account in one morning.

9.3 Percentage volatility (ATR) sizing

Varsity's fourth method, from Van Tharp, sizes the position so that one average day's move (ATR) equals a fixed % of equity. It uses the Average True Range rather than standard deviation, because ATR includes gaps (Chapter 4).

Percentage-volatility size \[ \text{Quantity} = \frac{\text{Equity}\times v\%}{\text{ATR}} \] \[ \text{(or, combined with a stop at } m\times\text{ATR: } \text{Quantity} = \frac{\text{Equity}\times \text{risk\%}}{m\times \text{ATR}}) \]
Equity
Your trading capital in ₹.
ATR
The Average True Range, usually ATR(14): the average daily price range over the last 14 sessions, including overnight gaps, in ₹ per share (Chapter 4).
\(v\%\)
The share of equity you allow one average day's move to cost, for example 1% or 2%.
\(m\)
How many ATRs away from entry you place the stop (2 in this chapter's examples), so \(m \times\) ATR is the risk per share.
risk%
The most you will lose on the trade if the stop is hit, as a % of equity.

How it works: a volatile stock has a large ATR, so you buy fewer shares, and a calm one gets more. Either way, one normal day's move (first version) or a stop-out (second version) costs the same share of your account. Round the result down to whole shares. The second version is just the percentage-risk rule with the stop set at \(m\) ATRs.

Real example · SBIN · 30 Sep 2026

ATR sizing step by step

  1. SBIN close ₹959.50, ATR(14, Wilder) = ₹16.71 (1.74% of price).
  2. Varsity-style with \(v=2\%\): ₹10,000 / 16.71 = 598 shares = ₹5,73,781. Too big for a ₹5 lakh cash account. With \(v=1\%\): 299 shares = ₹2,86,890.
  3. Combined with a 2×ATR stop and 1% risk: stop = 959.50 − 2 × 16.71 = ₹926.07. Risk per share ₹33.43. Quantity = ⌊5,000 / 33.43⌋ = 149 shares (₹1,42,966, 28.6% of the account).
Bar chart of position value for eight stocks sized to the same 5000 rupee risk with 2 ATR stops; calm stocks get larger positions
Figure 11.10: Same ₹5,000 risk, stop 2×ATR(14), 30 Sep 2026. SBIN (ATR 1.74%) gets 149 shares worth ₹1.43 lakh. DIXON (ATR 2.87%) gets 6 shares worth ₹78,600. Every position now costs the same if its stop is hit. That is the whole point.

9.4 Equity-curve sizing

A refinement used by many systematic traders: risk your normal % while your account's equity curve is healthy, and cut size (for example in half) when the equity curve drops below its own moving average. The logic: losing streaks cluster when a system is out of sync with the market (Section 13), so betting less during those stretches limits the damage, and you return to full size once results recover.

Real test · Chapter 5 setup S1 · 906 trades 2017 – Sep 2026

1% fixed vs "1%, or 0.5% when below the 20-trade average equity"

  1. Fixed 1%: the account multiplied by 1.83 overall, with a maximum drawdown of −48.3%. From 2024, when S1's edge turned negative, it lost 29.5%.
  2. Equity-curve rule: multiplied by 2.35, maximum drawdown −30.6%, and only −12.1% from 2024.

The rule helped here because S1's losses came in a long cluster. It is not magic: in choppy periods it can cut size just before a recovery. Test it on your own system (Chapter 12) before relying on it.

Two equity curves of S1 trades: fixed 1% risk with max drawdown 48% and equity-curve rule with max drawdown 31%
Figure 11.11: Equity-curve sizing on the real S1 trade sequence, ₹5 lakh start. The dotted line marks the first trade of 2024.

10. Position sizing for futures lots

Futures add two complications: you trade in whole lots, and the margin is a small fraction of the exposure. Margin is what the exchange asks you to deposit. It is not your risk. Size by the rupee loss at your stop, exactly as for shares, and then check that the margin fits.

Lots by percentage risk \[ \text{Lots} = \left\lfloor \frac{\text{Equity}\times\text{risk\%}}{(\text{Entry}-\text{Stop})\times\text{Lot size}} \right\rfloor \] \[ \text{Minimum equity for 1 lot} = \frac{(\text{Entry}-\text{Stop})\times\text{Lot size}}{\text{risk\%}} \]
Equity × risk%
Your rupee risk budget for the trade, as in Section 9.2.
Entry − Stop
The distance to your stop, in ₹ (or index points) per unit.
Lot size
Units per futures contract: 65 for Nifty, 750 for SBIN, 500 for RELIANCE.
(Entry − Stop) × Lot size
The rupee loss on one lot if the stop is hit.
\(\lfloor x \rfloor\)
Round down to a whole number. Here it can come out as 0.
  1. Work out what one lot loses if the stop is hit.
  2. Divide your risk budget by that and round down. That is the number of lots. A result of 0 means even one lot is too big for your account.
  3. Flip it round to see how much equity one lot needs: the loss per lot divided by your risk% (as a decimal, 1% = 0.01). The last two columns of the table below are these two steps for a 2×ATR stop.
Real data · NSE bhavcopy & SPAN file · October 2026 contracts, 30 Sep 2026

What one lot really risks

ContractFut closeLotNotional ₹Margin ₹LeverageATR(14)2-ATR stop loss per lot ₹Equity needed at 1% risk ₹
NIFTY22,707.306514,75,9741,67,3708.82×209.0327,17327,17,300
SBIN967.207507,25,4001,28,2745.66×16.7125,07125,07,100
TATASTEEL186.072,7505,11,69290,4545.66×4.4224,31924,31,900
INFY1,002.604004,01,04077,0085.21×26.9321,54321,54,300
RELIANCE1,191.805005,95,9001,05,7065.64×20.2520,24820,24,800
HDFCBANK715.556504,65,10782,1375.66×13.9618,14218,14,200

Margin = SPAN margin (the exchange's estimate of a worst-case one-day loss, from NSE Clearing's SPAN file) + extreme-loss margin (2% of notional for index futures, 3.5% for stock futures; see Chapter 9). The ATR used is the underlying's daily ATR. Stock ATRs are from the cash market, Nifty's from the index.

The uncomfortable conclusion

With a normal swing stop (2×ATR), one lot of any of these contracts risks ₹18,000–₹27,000. At 1% risk per trade you need roughly ₹18–27 lakh of trading capital per lot. With ₹10 lakh at 2% risk, only HDFCBANK (₹18,142 per lot ≤ ₹20,000) fits, and only 1 lot. Having enough margin to open a position does not mean you can afford it. If your account is smaller, the right futures position is usually zero: trade the cash market, or wait. Index lot sizes were set large on purpose (SEBI's minimum contract value rules), and the numbers above show the effect.

Real example · NIFTY futures · 19 Mar 2026 and 23 Mar 2020

Leverage turns ordinary bad days into account events

  1. Largest Nifty one-day fall in 2025–Sep 2026: −3.26% on 19 Mar 2026. On one lot (notional ₹14,75,974 at 30 Sep 2026 prices) that is −₹48,147, which is 28.8% of the ₹1,67,370 margin in a single day.
  2. On 23 Mar 2020 the Nifty fell 12.98%. At today's 8.82× leverage that is −114% of margin: more than the entire deposit in one session, before you could act.
  3. Risk on margin = index move × leverage. A 1% Nifty move is ₹14,760 per lot, 8.8% of margin.

10.1 Varsity's percentage-margin model

For futures, Varsity also describes capping the margin used per position at a fixed % of equity (for example 20%), and pairing it with the core or reduced-total equity model.

Worked example · ₹5,00,000 · max 20% of equity as margin per trade

Which contracts fit?

  1. 20% of ₹5,00,000 = ₹1,00,000. NIFTY (₹1,67,370) does not fit. RELIANCE (₹1,05,706) does not fit. INFY (₹77,008) fits: take 1 lot.
  2. Core equity is now 5,00,000 − 77,008 = ₹4,22,992. 20% of that = ₹84,598. HDFCBANK (₹82,137) fits. TATASTEEL (₹90,454) does not.
  3. Now check risk: INFY + HDFCBANK at 2×ATR stops = ₹21,543 + ₹18,142 = ₹39,685 at risk, which is 7.9% of the account. The margin rule alone allowed far more risk than the 1–2% rule would. Margin caps are a ceiling, never the sizing method.

11. R-multiples, expectancy and the break-even win rate

Once every trade risks a planned amount, you can measure results in R, units of initial risk. This makes trades of different sizes and prices comparable, and turns a trading method into numbers you can test.

R-multiple and expectancy \[ R = \frac{\text{Exit}-\text{Entry}}{\text{Entry}-\text{Stop}} \;(\text{long}), \qquad E = W\cdot \overline{R}_{\text{win}} - (1-W)\cdot \overline{R}_{\text{loss}} \] \[ \text{Break-even win rate} = \frac{\overline{R}_{\text{loss}}}{\overline{R}_{\text{win}}+\overline{R}_{\text{loss}}} = \frac{1}{1+\text{RR}} \;\;(\text{if losses are } 1R) \] \[ \text{Profit factor} = \frac{\sum \text{wins}}{\sum |\text{losses}|} \]
Entry, Exit, Stop
Your buy price, sell price and initial stop-loss, in ₹ per share. Entry − Stop is the planned risk per share, called 1R.
\(R\)
The trade's result measured in units of that risk. +2R means you made twice what you risked. −1R is a clean stop-out. Worse than −1R means the price gapped through the stop. (For a short trade, flip the signs: \((\text{Entry} - \text{Exit})/(\text{Stop} - \text{Entry})\).)
\(W\)
The win rate: the fraction of trades that made money (0.415 = 41.5%). \(1 - W\) is the loss rate.
\(\overline{R}_{\text{win}}\)
The average R of the winning trades.
\(\overline{R}_{\text{loss}}\)
The average size of the losing trades in R, written as a positive number (0.95 for an average loss of −0.95R).
\(E\)
The expectancy: the average R per trade over many trades. It equals the simple average of all the R-multiples.
RR
The payoff ratio (reward : risk): \(\overline{R}_{\text{win}} / \overline{R}_{\text{loss}}\).
Break-even win rate
The win rate at which \(E = 0\): win less often than this and the system loses money.
Profit factor
Total of all winning trades divided by the total of all losing trades (ignoring the minus sign, which is what \(|\ldots|\) means). Above 1 means the system made money.
  1. Convert each trade to R: its profit per share divided by its planned risk per share.
  2. Split the trades into winners and losers. Work out the win rate and the average R of each group.
  3. Expectancy = win rate × average win − loss rate × average loss. Multiply by your rupee risk per trade (1R) to see the average ₹ per trade.
  4. Set \(E = 0\) and solve for \(W\) to get the break-even win rate. Compare it with your actual win rate: the gap is your margin of safety.
Worked example · AXISBANK trade above

Computing R

\(R = (1272.00 - 1220.00)/(1220.00-1206.41) = 52.00/13.59 = 3.83\). After brokerage, STT and other costs (Chapter 13) the net result was 3.61R. In rupees at 1% risk: about 3.61 × ₹5,000 ≈ ₹18,000.

Real data · Chapter 5 setups · completed trades 2017 – Sep 2026, R net of costs

Expectancy of four real swing setups

SetupTradesWin rateAvg winAvg lossPayoff (RR)ExpectancyBreak-even win%Profit factor2024–26 expectancy
S1 Trend pullback90638.3%1.76R0.96R1.83+0.080R35.4%1.13−0.120R (273)
S2 52-wk breakout41837.8%1.42R0.84R1.68+0.012R37.3%1.02−0.268R (108)
S3 Support bounce16940.2%2.01R1.11R1.81+0.147R35.5%1.22+0.019R (61)
S4 Weekly + daily69441.5%2.06R0.95R2.16+0.295R31.7%1.53−0.100R (201)
  1. S4 by hand: \(E = 0.415\times2.0557 - 0.585\times0.9532 = 0.8531 - 0.5576 = +0.2954R\) per trade.
  2. Break-even win rate for S4 = 0.9532 / (2.0557 + 0.9532) = 31.7%. It actually won 41.5%: a cushion of almost 10 points.
  3. S2 won 37.8% against a break-even of 37.3%. Its edge was razor-thin even before 2024, and negative since.
  4. In rupees, at 1% risk on ₹5 lakh, 1R = ₹5,000. S4's +0.295R is about ₹1,477 per trade on average. No single trade pays that: each one is either a loss of about ₹4,766 (0.9532R) or a win averaging about ₹10,279 (2.0557R). Expectancy only shows up as an average over many trades.

Note that every setup wins less than half the time and still made money over the full period. Win rate alone tells you almost nothing. Win rate together with payoff tells you everything.

Heatmap of expectancy by win rate and reward to risk with the break-even line and markers for four setups
Figure 11.12: Expectancy (in R) for every combination of win rate and reward:risk, assuming 1R losses. The dashed line is break-even: 1/(1+RR). Break-even win rates: 0.5:1 needs 66.7%, 1:1 needs 50%, 1.5:1 needs 40%, 2:1 needs 33.3%, 3:1 needs 25%, 4:1 needs 20%. The markers show where the four Chapter 5 setups sat over 2017–2026.
Reference table · losses fixed at 1R

Win rate vs reward:risk: break-even and expectancy

Reward : riskBreak-even win rateExpectancy at 30% winsat 40%at 50%at 60%
0.5 : 166.7%−0.55R−0.40R−0.25R−0.10R
1 : 150.0%−0.40R−0.20R0.00R+0.20R
1.5 : 140.0%−0.25R0.00R+0.25R+0.50R
2 : 133.3%−0.10R+0.20R+0.50R+0.80R
3 : 125.0%+0.20R+0.60R+1.00R+1.40R

Read across a row: at 2:1, a 30% win rate loses 0.10R per trade, while 40% earns +0.20R. Read down a column: at a 40% win rate you need better than 1.5:1 just to break even. Every expectancy here is before costs and slippage, which cost the Chapter 5 setups 0.05–0.10R per trade, so a setup needs a clear margin above its break-even line.

Common mistakes with expectancy

12. Kelly criterion and half-Kelly

The Kelly criterion, which Varsity covers in chapter 14, answers: given my edge, what fraction of capital should I bet to grow fastest over the long run? Bet too little and you grow slowly. Bet too much and the losses (which hurt more than equal-sized gains help, Section 7) drag growth down and eventually into ruin.

Kelly fraction \[ K = W - \frac{1-W}{\text{RR}} \qquad W=\text{win rate},\;\; \text{RR} = \frac{\text{average win}}{\text{average loss}} \] \[ \text{Growth per trade } g(f) = \mathbb{E}\big[\ln(1 + f\cdot R)\big], \quad \text{Kelly} = \arg\max_f g(f) \]
\(K\)
The Kelly fraction: the share of capital to risk per trade (the loss if the stop is hit) that grows the account fastest in the long run. 0.144 means risk 14.4% per trade. Negative means don't trade.
\(W\)
The win rate, as a fraction.
RR
The payoff ratio: average win ÷ average loss, both in R or both in ₹.
\(f\)
Any fraction of capital you might risk per trade (0.01 = 1%).
\(R\)
One trade's result in R-multiples (Section 11). \(1 + f \cdot R\) is what the account is multiplied by after that trade: risking 1% on a +2R trade gives × 1.02.
\(\ln\)
The natural logarithm. Taking logs turns a chain of multiplications into a sum, so averaging them measures compound growth.
\(\mathbb{E}[\ldots]\)
"Expected value": the average over all your trades.
\(\arg\max_f\)
"The value of \(f\) that makes \(g(f)\) largest."
  1. Formula version: plug the win rate and payoff ratio into the first line. It assumes every win and every loss is exactly the average size.
  2. Real-trades version: for each candidate \(f\), compute \(\ln(1 + f \cdot R)\) for every past trade and average them. That is the growth rate per trade at that bet size.
  3. The \(f\) with the highest growth is the Kelly bet. Risk more than that and growth falls; well beyond it, the account shrinks.
  4. framework.risk.kelly_fraction(win_rate, win_loss_ratio) returns the formula value. Treat it as a ceiling, not a target.
Worked example · S4 (2017 – Sep 2026)

Formula vs reality

  1. \(W = 0.415\), RR = 2.0557 / 0.9532 = 2.1566.
  2. \(K = 0.415 - 0.585/2.1566 = 0.415 - 0.2713 = 0.1437\). The formula says risk 14.4% of capital per trade.
  3. The formula assumes every win is exactly +2.06R and every loss exactly −0.95R. Real outcomes vary (some wins +8R, some gap losses −3R). Maximising the actual average log-growth over the 694 real trades gives an optimum of 9.4%, and growth turns negative beyond about 20.3%.
  4. For S1: formula 4.5%, empirical optimum 3.2%. For S4 trades from 2024 on, the formula gives −6.7%. Negative Kelly means the right bet size is zero.
Log-growth per trade against fraction risked for S4 and S1; S4 peaks near 9.4 percent; half Kelly gives 78 percent of the growth
Figure 11.13: Average log-growth per trade versus fraction risked, using the real trade outcomes. The curve is flat near the top: half-Kelly (4.7%) keeps 78% of the maximum growth rate. Past the peak, betting more grows the account more slowly, and eventually shrinks it.
Simulation · 5,000 runs of 200 trades drawn from S4's real results

Why even half-Kelly is too much for a person

SizingRisk per tradeMedian ending multipleMedian max drawdownP(drawdown ≥ 50%)
Full Kelly9.4%9.82×−80.1%99.7%
Half Kelly4.7%6.10×−51.6%55.5%
Quarter Kelly2.35%3.02×−29.4%3.9%
Fixed 1%1.0%1.69×−13.5%0.0%

Full Kelly maximises long-run growth, and along the way it puts you through a near-certain 50%+ drawdown. And this assumes the edge is known and stable. S4's edge was not: from 2024 it was negative. Kelly computed on a past edge that later shrinks means you were overbetting.

How to use Kelly in practice

Use Kelly as an upper bound and a sanity check, not a sizing rule. If your Kelly estimate is below your planned risk %, you are overbetting: cut size. If Kelly is near zero or negative on recent trades, stop trading that setup. Varsity suggests combining Kelly with the percentage-risk method. A practical version: risk = min(1–2%, ¼ Kelly). framework.risk.kelly_fraction(win_rate, win_loss_ratio) returns the formula value.

13. Drawdowns, losing streaks and risk of ruin

13.1 Same trades, different bet size

Here is the most important experiment in this chapter. Take the exact same 906 S1 trades in the order they happened (2017 – Sep 2026) and replay them risking 1%, 2% and 5% of current equity per trade.

Three equity curves on log scale for 1, 2 and 5 percent risk on identical S1 trades; 5 percent rises to 79 times then collapses 97 percent
Figure 11.14: Identical trades, ₹5 lakh start, log scale. At 1% risk the account peaked at 3.54× and ended at 1.83× (max drawdown −48%). At 2%: peak 10.18×, end 2.65×, max drawdown −74%. At 5%: peak 79×, then a −97% collapse to end at 2.27×. The 5% trader looked like a genius in September 2024 and was nearly wiped out by 2026.
Real record · S1 · 2024 – Sep 2026

How the drawdown happened

S1's first trade of 2024 was trade no. 634. From 2024 the setup's net expectancy was −0.120R over 273 trades, and it included a run of 16 consecutive losses (entries 23 Feb to 27 May 2026). At 1% risk, 16 straight losses of about 1R cost roughly \(1-0.99^{16}\approx 15\%\). At 5% they cost \(1-0.95^{16}\approx 56\%\). In August–September 2026, 27 of 28 trades across all four setups lost, a combined −23.29R. This is what "the edge turned negative" looks like from inside: no single disaster, just a steady drip of losses.

13.2 Monte Carlo: what could have happened

One historical sequence is one possible path. A Monte Carlo simulation reshuffles your real trade results thousands of times to show the range of paths your system could produce. We drew 200 trades at random (with replacement) from S1's 906 net-R outcomes, 10,000 times, at each risk level.

Two panels of 60 simulated equity paths each, 1 percent risk tight fan, 5 percent risk very wide fan
Figure 11.15: 10,000 simulated 200-trade sequences, ₹5 lakh start. Same average edge (+0.08R/trade). At 1% risk, the median ending is ₹5.67 lakh, the 5th percentile ₹3.95 lakh, and a 50% drawdown essentially never happens. At 5%, the median ending is a similar ₹5.82 lakh, but the 5th percentile is ₹1.04 lakh and 86% of paths suffer a 50%+ drawdown.
Risk per tradeMedian end (× start)5th pct endMedian max DDP(DD ≥ 20%)P(DD ≥ 30%)P(DD ≥ 50%)P(lose money)
0.5%1.070.89−9.0%1.5%0.0%0.0%26.9%
1%1.130.79−17.5%35.8%6.9%0.0%28.8%
1.5%1.180.69−25.3%74.9%31.7%1.4%30.7%
2%1.220.60−32.6%93.4%60.3%9.1%32.5%
3%1.260.44−45.6%99.9%91.5%38.4%36.2%
5%1.160.21−66.0%100%99.9%86.1%44.3%
10%0.470.02−92.2%100%100%100%64.0%

Three things to read from this table:

  1. Beyond about 3% risk, more risk does not even raise the typical outcome. The median ending at 10% (0.47×) is below the median at 0.5%. Over-betting a positive edge destroys it, which is the Kelly curve again.
  2. Drawdowns are larger than intuition suggests. Even at 1%, there is a 36% chance of a 20% drawdown within 200 trades. Decide now that a 20% drawdown at 1% risk is "normal bad", not a reason to abandon a tested plan.
  3. A positive edge still loses money 27–29% of the time over 200 trades at low risk. A thin edge needs many trades to show itself. Re-run with S1's 2024–26 trades only (mean −0.12R): at 1% risk the median ending is 0.77× and 92% of paths lose money. A negative edge cannot be fixed by sizing.

What "risk of ruin" means here. Risk of ruin is the probability that a run of losses takes your account down to a level from which you cannot or will not carry on. If you always risk a fixed percentage of current equity, the account never mathematically reaches zero (each loss is a slice of a smaller pie), so the textbook "probability of losing everything" is not the useful number. In practice, traders quit, change systems or start revenge trading long before zero. So we define ruin as a 50% drawdown (which then needs +100% to repair) and measure its probability by simulation, as in the table above.

Probability of 20, 30 and 50 percent drawdown against risk per trade, rising steeply
Figure 11.16: Probability of a 20% / 30% / 50% drawdown within 200 trades versus risk per trade (bootstrap of real S1 trades). Defining "ruin" as a 50% drawdown (the point where most traders quit or blow up), the risk of ruin goes from ~0% at 1% risk to 9% at 2%, 38% at 3% and 86% at 5%.

13.3 Losing streaks are normal

Streak probability \[ P(\text{next } k \text{ trades all lose}) = (1-W)^k \]
\(P(\ldots)\)
"The probability that …", as a fraction between 0 and 1.
\(W\)
The win rate, so \(1 - W\) is the chance that any one trade loses (0.62 for a 38% win rate).
\(k\)
The length of the losing streak, in trades.
\((1-W)^k\)
The loss chance multiplied by itself \(k\) times. This assumes each trade is independent of the last.

How it works: this is the chance that a particular run of \(k\) trades, such as the next 8, all lose. The chance of seeing at least one such streak somewhere in \(n\) trades is much higher, because there are many places in the sequence where it could start. That figure has no simple formula. It is computed by simulation or dynamic programming (as in our script).

Worked numbers · 100 trades

How often do long streaks occur?

  1. Win rate 38% (S1-like): probability that a given 8 trades all lose = \(0.62^8 = 2.2\%\). But the probability of at least one streak of 8+ somewhere in 100 trades is 57%. 10+ in a row: 26%.
  2. Win rate 50%: 8+ in a row within 100 trades: 17%. Win rate 60%: 5+ in a row: 46%.
  3. S1's real worst streak was 16. At its 38.3% win rate, a 16-streak somewhere in 906 trades has about a 14% chance. Unlucky, but not impossible, and it coincided with the edge fading.
Probability of a losing streak of at least k trades within 100 trades for win rates 38, 50 and 60 percent
Figure 11.17: Probability of at least one losing streak of length k within 100 trades. A trend-following trader with a 38% win rate should expect 7–8 losses in a row at some point in every 100 trades.
How to use it

Before you trade a system, write down: "With my win rate, a streak of k losses is likely. At my risk %, that costs X%." For S1 at 1%: 8 losses ≈ 7.7%, 10 losses ≈ 9.6%. If that number would make you quit or double up, reduce risk until it would not.

14. Portfolio heat, correlation risk and sector limits

The 1% rule controls one trade. Portfolio heat controls all of them together:

Portfolio heat \[ \text{Heat} = \sum_{\text{open positions}} \frac{\text{qty}_i \times \max(0,\ \text{entry}_i - \text{stop}_i)}{\text{Equity}} \]
\(i\)
Labels each open position: position 1, 2, 3 and so on.
\(\text{qty}_i\)
The number of shares (or units) held in position \(i\).
\(\text{entry}_i - \text{stop}_i\)
How much each share loses, against what you paid, if the stop is hit, in ₹. For a short position, use stop − entry.
\(\max(0,\ \dots)\)
"The larger of 0 and the bracket". Once a stop sits at or above the entry price (below it, for a short), hitting it loses none of your capital, so that position counts as 0.
Equity
Your account capital in ₹.
\(\sum_{\text{open positions}}\)
Add the result up across every open position.
Heat
The share of your capital you would lose if every stop were hit at once, as a %.

How it works: for each open trade, multiply the quantity by the distance from entry down to its current stop to get the rupees of capital at risk. Add them up and divide by equity. Five positions each sized at 1% risk give a heat of about 5%. Move a stop to breakeven and that position drops out of the total.

Heat is the total you would lose if every stop were hit at once. Typical caps: 4–6% for swing traders (for example 5 positions × 1%), lower in a weak market regime. Once a stop is moved to breakeven or above, that position's heat drops to zero, and that is how you make room for new trades.

Heat counts only losses to your own capital. It ignores open profit you could give back: a stock up 15% with its stop at breakeven has zero heat but can still hand back that 15%. Track that separately as open profit at risk, qty × (current price − stop), and trail stops on big winners so it stays reasonable.

Real example · Chapter 5 setup S4 · entries on 21 Sep 2026

Five "different" trades, one bet

  1. On 21 Sep 2026, S4 triggered five long entries at once: BAJFINANCE, TRENT, PIDILITIND, CDSL and HAL. Five different sectors on paper.
  2. Heat at 1% each = 5%. The Nifty then fell from 23,346.40 (18 Sep) to 22,620.45 (30 Sep), −3.11%, and India VIX rose 22.6% on 24 Sep.
  3. All five hit their stops between 24 and 29 Sep: −1.071R, −1.064R, −1.045R, −1.029R, −1.044R. Total −5.25R = −₹26,270 on a ₹5 lakh account at 1% risk.
  4. The heat cap worked as designed: the loss was painful but bounded. At 3% per trade the same week would have cost about 15.8%.

All long positions share market risk. When the market turns, correlations jump and the stops get hit together, whatever the sector labels say.

Average pairwise 60-day correlation across 35 stocks 2017 to 2026, spikes to 0.57 in March 2020 and 0.48 in early 2022
Figure 11.18: Average 60-day pairwise correlation across our 35 stocks. Median 0.22. It spiked to 0.57 in the COVID crash (25 Mar 2020), 0.48 in the Feb–Mar 2022 sell-off, and 0.37 after the April 2025 tariff shock. It was 0.15 at the end of Sep 2026. In a sell-off, diversification within equities shrinks fast.

14.1 Practical limits that work

LimitSwing trader (₹5–25 lakh)Long-term investorFutures trader
Risk per trade / position0.5–1% (max 2%)Thesis-based; position cap does the work0.5–1% of total capital per lot-position
Max position size20–25% of equity8–10% at cost, trim above 15%Margin ≤ 20% of equity per position
Portfolio heat≤ 5–6% (≤ 3% in risk-off regime)n/a (use drawdown plan)≤ 4% including overnight gap allowance
Sector / correlated cluster≤ 2 open trades or 2% heat per sector≤ 25–30% per sectorCount index + bank-stock futures as one cluster
Total margin usedn/an/a≤ 40–50% of capital, the rest kept as a buffer for daily mark-to-market (M2M) losses
Circuit breakerStop trading after −6% in a month; halve size after −10% from peakReview (not panic) after a 20% portfolio fallPause after 3 losing trades in a row or −5% of capital in a week (count open M2M losses, not just closed trades)

These are educational starting points, not universal truths. Write your own numbers into your plan (Section 17) and test them with the Monte Carlo above.

Checkpoint: Part B in six lines

15. Trading psychology: the biases that cost money

Everything above assumes you will follow your rules. Most traders do not, at least not when it matters. Varsity's last two chapters and its Innerworth module describe the mental shortcuts (cognitive biases) that push otherwise sensible people into bad decisions. Biases are not character flaws. They are built into how human brains handle uncertainty, so trying harder doesn't remove them. Written rules that act before the bias does are what works.

15.1 Loss aversion and the disposition effect

Loss aversion: a loss hurts roughly twice as much as an equal gain pleases. In trading it shows up as the disposition effect: we sell winners too early (to "lock in" the good feeling) and hold losers too long (to avoid making the loss "real"). That is the exact opposite of what a trend-following edge needs.

Real data · S1's 906 trades, replayed with typical emotional habits

What "booking profits early, giving losers room" does to a real edge

BehaviourExpectancy per trade
Follow the rules (as backtested, net of costs)+0.080R
Take profit at +1R on every winner ("book it before it goes away")−0.270R
Let full stop-outs run 50% further ("give it room")−0.196R
Both habits together−0.546R

Why so dramatic? Only 24.5% of trades ended above +1R, but the part of those wins beyond the first 1R added up to +317.1R, more than four times the setup's total net profit of +72.3R. Meanwhile 50.3% of trades were full stop-outs. The edge lives in a few big winners and many small, controlled losers. Cutting the winners short and letting the losers run turns a positive system into a strongly negative one.

How the replay was done: our trade list has only each trade's final R, not its path, so "take profit at +1R" here caps every trade that finished above +1R at exactly +1R, and "give it room" multiplies every full stop-out (R below −0.9) by 1.5. A real +1R target would also have rescued some trades that touched +1R and then fell back, so the true damage would be somewhat smaller than −0.270R, but the direction and the scale of the problem are the same.

Rules that counter it: place the stop as a real order at entry. Never widen a stop (only tighten). Exit by rule (trailing stop, close below 20 EMA, time stop), not by feel. Review "early exits" as rule breaks in your journal.

15.2 Overconfidence and attribution bias

After a run of wins we overrate our skill and raise size. That is exactly when a regime change does the most damage. Varsity's attribution bias is the mirror image: wins are "my skill", losses are "bad luck / operators / the market was irrational". Both stop you learning.

Real data · Figure 11.14 again

The 5% trader in September 2024

On the real S1 sequence, a 5%-per-trade trader had turned ₹5 lakh into about ₹3.95 crore (79×) by trade no. 741 (closed 19 Sep 2024), about 20× of it before 2024 and the rest in 2024's strong run. Anyone would have felt like a genius. The next 165 trades took the account down 97%. Nothing about the method changed. The market did, and the size was far too large to survive it.

Rules: increase risk % only by written rule (for example, after 100 live trades with positive expectancy, from 0.5% to 1%), never after a hot streak. Track your live expectancy against your backtest. In the journal, label every loss as "followed plan" or "broke plan". A loss on a followed plan is a cost of business, not bad luck.

15.3 Confirmation bias

Once we own a stock we look for news that supports it and skip the rest. Varsity's example is the trader who reads only bullish reports on a stock he holds. The effect: stops get "reconsidered", warning signs get explained away, and position sizes creep up.

Rules: before entry, write one sentence on what would prove me wrong. That sentence becomes the stop. For investments, write the bear case alongside the bull case (Chapter 8) and list 2–3 measurable "thesis-broken" triggers (e.g. two consecutive quarters of falling ROCE, promoter pledge rising). Run a pre-mortem: "It's 6 months later and this lost 30%. What happened?"

15.4 Recency bias

We weight the last few weeks far more than the last few years. After a strong run every dip "will be bought". After a crash every rally "is a trap". Varsity's antidote is to keep the bigger picture in view.

Real data · recency in both directions

Optimisers and traders both fall for it

15.5 Anchoring

We fix on a reference number, usually a past high or our purchase price, and judge everything relative to it. "It was ₹4,500, now it's ₹3,600, it must be cheap." The market does not know or care what you paid or where the stock used to trade.

TCS price chart from 2024 to 2026 falling from 4554 to about 2050, with markers at -20, -30 and -40 percent from peak, each followed by further falls
Figure 11.19: TCS peaked at ₹4,553.75 on 30 Aug 2024. It was 20% down (₹3,629.55) on 25 Feb 2025, 30% down (₹3,158.20) on 21 Jul 2025 and 40% down (₹2,692.20) on 13 Feb 2026. Buying at each "cheap" level lost a further 43.5%, 35.1% and 23.8% respectively by 30 Sep 2026 (₹2,050.60). Averaging down with equal money at all three levels gave an average cost of ₹3,113.34 and a −34.1% loss, while the Nifty fell 10.4% over the same span from the peak.

Rules: judge a stock on its own current trend (Chapters 3–5) and valuation (Chapter 8), never on its distance from a past high. Never average down a losing trade. If an investment is to be added to on a fall, that must be pre-planned in the thesis, with a fresh valuation, not a reaction to the price.

15.6 FOMO and the bandwagon (herd) effect

Fear of missing out: a stock everyone is talking about has run, and you buy because you cannot bear to watch it go higher without you. Late buyers tend to arrive after the move, with stops far away or no stops at all.

Real data · the 12 months before three peaks

Popular, then painful

StockPrice 1 year before peakPeak (date)1-year run-upThen fell (to trough)
DIXON₹6,271.5₹18,940.2 (17 Dec 2024)+202%−48.9%
IRCTC₹624.3₹1,126.0 (22 May 2024)+80%−59.8%
ADANIENT₹2,445.1₹3,645.2 (3 Jun 2024)+49%−51.8%

Strong momentum is not a reason to avoid a stock. Trend-following setups (Chapter 5) deliberately buy strength. The difference is the process: a defined entry, a stop that limits the loss to 1R, and a size from Section 9. FOMO buying skips all three.

Rules: no trade without a setup from your plan. If you "missed it", write it on a watchlist and wait for a pullback setup. Mute social media and tips during market hours.

15.7 Revenge trading and the gambler's fallacy

After a painful loss, the urge is to "win it back" immediately, with a larger size, a lower-quality setup, or an instrument you don't normally trade (often options near expiry). Varsity's poker story is a revenge-trading story. It pairs naturally with the gambler's fallacy (Section 7): "I've lost four in a row, the next one must work."

Rules: a daily loss limit (e.g. 2% or 2R): hit it and you are done for the day. A cooling-off rule: after any loss above 2R, or three losses in a row, no new trades until the next session and a journal entry. Size never increases after a loss.

15.8 Illusion of control, functional fixedness and hindsight

BiasSymptom you'll noticeWritten rule that counters it
Loss aversion / dispositionMoving stops lower; "it will come back"; booking +0.5R winnersHard stop order at entry; stops only tighten; rule-based exits
Overconfidence / attributionRaising size after a streak; blaming "operators"Size changes only by written schedule; journal "followed plan?"
ConfirmationReading only bullish views on your holdingsWrite the invalidation point and bear case before entry
RecencyAbandoning or over-betting a method after a few weeksEvaluate only after 30+ trades / quarterly review
Anchoring"It was ₹X, it's cheap now"No averaging down trades; decisions on current trend and valuation
FOMO / herdBuying a stock because it's everywhereNo setup, no trade; watchlist and wait
Revenge / gambler's fallacyBigger, faster trades after a lossDaily loss limit; cooling-off after 2R loss or 3 losses
Illusion of controlTen indicators, five timeframesMax 2–3 tools per setup, each with a job

16. The trading journal and review process

Your backtest says what should happen. Your journal records what did happen: what you did, why, and how it felt. Without one you cannot measure your expectancy, you cannot tell bad luck from bad execution, and every bias above goes unchecked.

16.1 What to record for every trade

Before entryAt exitReflection
Date, symbol, setup name, timeframe
Entry, stop, target, quantity
Risk in ₹ and as % of equity
Portfolio heat after this trade
Market regime (Nifty vs 200-DMA, VIX)
One-line reason + invalidation point
Screenshot of the chart
Exit date and price, exit reason
Costs (brokerage, STT, etc.)
Net P&L in ₹ and in R
MAE / MFE (worst and best price during the trade) if available
Did I follow the plan? (yes/no)
If no: which rule, and why?
Emotion at entry and exit (1–5 scale)
What would I do differently?
In your framework

framework.journal keeps this as a CSV you own, and refuses a trade without a stop. From the project folder:
python -m framework.journal add AXISBANK --entry 1220 --stop 1206.4 --qty 367 --setup trend_pullback
python -m framework.journal close 1 --exit 1272 --reason target
python -m framework.journal stats (win rate, average win/loss in R, expectancy, profit factor, by setup).
close_trade(..., followed_plan=False, notes="moved stop") records rule breaks so you can measure what they cost you.

16.2 The review cycle

When to stop trading a system

Decide this in advance, in numbers, for example: "If live expectancy over the last 50 trades is below −0.1R, or drawdown exceeds 1.5× the worst Monte-Carlo 95th-percentile drawdown, I stop, paper-trade, and re-test." For S1 at 1% risk, the 95th-percentile drawdown over 200 trades was −31.5%. After S1's equity peak (trade no. 741, Sep 2024), its 50-trade expectancy first fell below −0.1R at trade no. 780 (entry 20 Dec 2024), when the drawdown was −12.1%. Following the rule there would have avoided most of the eventual −48.3% drawdown.

17. Your written trading plan (template)

A trading plan is a one- or two-page document you write when calm and follow when not. If something isn't in the plan, you don't do it. Copy this template and fill it in. Chapter 17 turns it into your complete framework.

MY TRADING PLAN — version 1.0 — date: ________
1. Goals & capital
   Trading capital: Rs ______ (money I can lose without changing my life)
   Investment capital (separate): Rs ______   Emergency fund kept outside both: yes/no
   Realistic goal: positive expectancy over 100 trades, max drawdown under ___%

2. Markets & instruments
   Swing: NSE cash, Nifty 200 stocks, avg daily value > Rs 50 cr
   Futures: only when capital >= Rs ___ lakh per lot at 1% risk (see Section 10)
   Not traded: intraday, options buying near expiry, illiquid small caps

3. Setups (from Ch 5 / Ch 12, each backtested, with its expectancy)
   S_: __________  entry rule / stop rule / exit rule / expectancy ___R over ___ trades

4. Risk rules
   Risk per trade: ___% of core equity (start 0.5%; max 1%)
   Max position: ___% of equity      Max portfolio heat: ___%
   Max per sector / correlated cluster: ___ trades or ___% heat
   Regime: Nifty < 200-DMA -> risk halved, trend setups paused
   Futures: margin used <= ___% of capital; never add to a losing position

5. Circuit breakers
   Daily loss limit: ___R  -> stop for the day
   After 3 consecutive losses or a loss > 2R: no trade until next session + journal entry
   Monthly loss of ___% -> half size;  drawdown of ___% from peak -> stop, review, paper-trade

6. Routine
   Pre-market: check regime, events/results calendar, open positions' stops
   Entries: only at planned levels with orders placed; no chasing
   Post-close: journal, update stops, compute heat
   Weekly / monthly / quarterly reviews (Section 16)

7. Personal rules
   No trading when ill, sleep-deprived, or after a major personal upset
   No tips, no social-media trades, no changing rules during market hours

Signed: ____________   Review date: ____________

18. Stress and discipline routines

Varsity's Innerworth module comes back again and again to one theme: trading performance depends on your state of mind as much as on your method. Stress narrows attention and pushes you towards impulsive, short-term decisions, which are exactly the biases above. A few habits help:

19. Try it yourself

These snippets need a copy of the course repository and Python with pandas and numpy (setup steps are in its framework/README.md). Run them from the repository's root folder, for example with .venv/bin/python, because the file paths are relative to that folder. They use the course data directly. Your numbers can differ from the chapter in the second decimal: the chapter's script also drops a few zero-range holiday placeholder bars and uses population (n) rather than sample (n−1) standard deviation for the matrix example.

19.1 Correlation matrix and portfolio volatility

import pandas as pd, numpy as np
D = "data/ohlc/"
stocks = ["HDFCBANK", "INFY", "ITC", "SUNPHARMA", "TITAN"]
w = np.array([0.25, 0.20, 0.15, 0.15, 0.25])
px = pd.DataFrame({s: pd.read_csv(D + s + ".csv", index_col=0, parse_dates=True)["Adj Close"] for s in stocks})
ret = px.pct_change(fill_method=None).loc["2024-10-01":"2026-09-30"].dropna()

print(ret.corr().round(2))                       # correlation matrix
cov = ret.cov()                                  # variance-covariance matrix (daily)
port_sd = np.sqrt(w @ cov.values @ w)            # sigma_p = sqrt(w' S w)
print(f"Portfolio vol: {port_sd:.4%} per day, {port_sd*np.sqrt(252):.2%} per year")
print(f"Weighted avg of vols: {(w * ret.std()).sum()*np.sqrt(252):.2%} per year")
# -> about 0.85% per day, 13.5% per year vs ~22% weighted average

19.2 Value at Risk three ways

import pandas as pd, numpy as np
D = "data/ohlc/"
stocks = ["HDFCBANK", "INFY", "ITC", "SUNPHARMA", "TITAN"]
w = np.array([0.25, 0.20, 0.15, 0.15, 0.25])
px = pd.DataFrame({s: pd.read_csv(D + s + ".csv", index_col=0, parse_dates=True)["Adj Close"] for s in stocks})
pr = (px.pct_change(fill_method=None).dropna() @ w).loc[:"2026-09-30"].iloc[-252:]   # last year of daily returns
value = 1_000_000
hist = np.percentile(pr, 5)
cvar = pr[pr <= hist].mean()
param = pr.mean() - 1.645 * pr.std()
print(f"Historical VaR95: {hist:.2%} = Rs {-hist*value:,.0f}")
print(f"Expected shortfall (Varsity 'VaR'): {cvar:.2%} = Rs {-cvar*value:,.0f}")
print(f"Parametric VaR95: {param:.2%} = Rs {-param*value:,.0f}")
# -> about Rs 14,100 / Rs 20,300 / Rs 15,100

19.3 Position size, expectancy, Kelly and Monte Carlo with the framework

import sys; sys.path.insert(0, ".")
import numpy as np, pandas as pd
from framework.risk import position_size, kelly_fraction, risk_of_ruin_sim

# 1) Rs 5 lakh, 1% risk (risk_pct is in PERCENT), cap any one stock at 25% of capital
print(position_size(500_000, 1.0, 1220.0, 1206.41, max_position_pct=25))   # -> 102 (cap binds, not 367)

# 2) expectancy and Kelly from a list of R-multiples (here: Chapter 5's S4 trades)
R = pd.read_csv("data/extra/ch05_trades.csv")
R = R[(R.setup == "S4") & (R.exit_reason != "open at data end")].R_net
W = (R > 0).mean(); avg_w = R[R > 0].mean(); avg_l = -R[R <= 0].mean()
print(f"win {W:.1%}  payoff {avg_w/avg_l:.2f}  expectancy {R.mean():+.3f}R  Kelly {kelly_fraction(W, avg_w/avg_l):.1%}")

# 3) Monte Carlo: same edge at 1% vs 5% risk ('ruin' = 50% drawdown)
for risk in (1.0, 5.0):
    out = risk_of_ruin_sim(W, avg_w, avg_l, risk_pct=risk, n_trades=200, n_sims=5000)
    print(risk, round(out["prob_ruin"], 3), round(out["median_final"], 2), round(out["median_max_dd"], 3))

The framework's simulator uses a simple two-outcome model (every win = average win), which is kinder than reality. With S4's full-period numbers it shows a median max drawdown of about −10% at 1% risk and −42% at 5%. Replace R with your own journal's R-multiples once you have 30+ trades. Exercise: re-run with only trades from 2024 onward and see Kelly go negative.

20. Practical checklist

21. Key takeaways

Key takeaways

22. Quiz and exercises

Q1. Your account falls 35% from its peak. What gain do you need to get back to the peak? Why does this matter for position sizing?
\(0.35/(1-0.35) = 0.35/0.65 = 53.8\%\). Losses compound against you: the deeper the drawdown, the disproportionately larger the recovery needed. Position sizing aims to keep drawdowns in the shallow part of the curve (under ~20%, which needs at most +25%).
Q2. Capital ₹8,00,000, risk 1% per trade, entry ₹1,500, stop ₹1,440. How many shares? What % of capital is the position?
Risk budget = ₹8,000. Risk per share = 1,500 − 1,440 = ₹60. Quantity = ⌊8,000/60⌋ = ⌊133.3⌋ = 133 shares. Position value = 133 × 1,500 = ₹1,99,500 = 24.9% of capital, just within a 25% max-position cap. If the stop is hit, the loss is 133 × 60 = ₹7,980 (plus costs and any gap).
Q3. Stock A: volatility 20%, stock B: 30%, correlation 0.2. What is the volatility of a 60% A / 40% B portfolio? Compare with the weighted average.
\(\sigma_p^2 = 0.6^2(0.2^2) + 0.4^2(0.3^2) + 2(0.6)(0.4)(0.2)(0.2)(0.3) = 0.0144 + 0.0144 + 0.00576 = 0.03456\). \(\sigma_p = \sqrt{0.03456} = 18.59\%\). Weighted average = 0.6×20% + 0.4×30% = 24%. Diversification removed about 5.4 percentage points of volatility.
Q4. A setup wins 45% of the time, average win 1.8R, average loss 1R. Find the expectancy, the break-even win rate and the Kelly fraction. What would you actually risk?
E = 0.45 × 1.8 − 0.55 × 1 = 0.81 − 0.55 = +0.26R. Break-even win rate = 1/(1+1.8) = 35.7%. Kelly = 0.45 − 0.55/1.8 = 0.45 − 0.3056 = 14.4%. In practice: quarter-Kelly is 3.6%, so the 1% ceiling binds. Risk 0.5–1%, because the true edge is uncertain and will vary over time.
Q5. NIFTY Oct-26 futures at 22,707.30 (lot 65). You want a stop at 22,400. You have ₹12 lakh and risk 1%. How many lots? What capital would one lot need at 1%? At 2%?
Loss per lot at the stop = (22,707.30 − 22,400) × 65 = 307.3 × 65 = ₹19,974.50. 1% of ₹12 lakh = ₹12,000 < ₹19,974.50, so 0 lots. One lot needs ₹19,974.50 / 0.01 ≈ ₹20 lakh at 1% risk, or ≈ ₹10 lakh at 2%. With ₹12 lakh at 2% (₹24,000) one lot fits. That is still a 1.7% risk with no allowance for a gap like 19 Mar 2026 (−3.26%, ≈ ₹48,000 per lot).
Q6. A ₹20 lakh portfolio has a daily mean return of 0.05% and daily SD of 1.1%. Compute the parametric 1-day VaR at 95% and 99%. What does VaR not tell you?
VaR95 = −(0.0005 − 1.645 × 0.011) = 0.017595 = 1.76% → ₹35,190. VaR99 = −(0.0005 − 2.326 × 0.011) = 0.025086 = 2.51% → ₹50,172. VaR says nothing about how large losses are beyond the cut-off. Expected shortfall and stress tests (e.g. a −13% day like 23 Mar 2020) cover that. It also assumes normal returns, while real returns have fat tails.
Q7. You hold four swing trades, each risking 1.2% of equity. You have moved one stop to breakeven. Your heat cap is 5%. What is your current heat, and can you take a new 1% trade?
The breakeven-stop trade has zero heat. Heat = 3 × 1.2% = 3.6%. A new 1% trade takes it to 4.6% ≤ 5%, so yes, provided it is not in the same sector or correlated cluster as the existing positions.
Q8. Your system wins 40% of trades. What is the probability that the next 5 trades all lose? Should a 5-trade losing streak make you double your size to "catch the turn"?
\(0.6^5 = 0.0778 = 7.8\%\) for any specific 5 trades. Over 100 trades, a 5+ streak somewhere is near-certain. No: doubling after losses is the gambler's fallacy. The next trade still has a 60% chance of losing. Keep size constant (or reduce it under an equity-curve rule).
Q9. Using Varsity's three equity models: capital ₹10 lakh, two futures positions with margins ₹1.2 lakh and ₹0.9 lakh, open profit ₹30,000 of which ₹10,000 is locked in by trailed stops. Compute core, total and reduced total equity.
Core = 10,00,000 − 1,20,000 − 90,000 = ₹7,90,000. Total = free cash 7,90,000 + margins 2,10,000 + open P&L 30,000 = ₹10,30,000. Reduced total = core 7,90,000 + locked-in 10,000 = ₹8,00,000. 1% risk would be ₹7,900 / ₹10,300 / ₹8,000 respectively.
Q10. In the Monte Carlo (Section 13), why does the median ending account at 10% risk (0.47×) come out below the median at 0.5% risk (1.07×), even though the edge is the same?
Compounding is multiplicative, so large losses hurt more than equal gains help (a −50% needs +100%). The long-run growth rate is roughly \(f\mu - \tfrac{1}{2}f^2\sigma^2\): beyond the Kelly fraction (about 3.2% for S1) the variance-drag term dominates and growth falls, eventually going negative. Over-betting a positive edge turns it into a losing proposition for the typical path.
Q11. Identify the bias: (a) "TCS is 40% off its high, it can't fall much more." (b) Selling a +0.6R winner "before it disappears" while holding a −1.5R loser past its stop. (c) Doubling size after a 6-trade winning streak. (d) Reading only bullish reports on a stock you own.
(a) Anchoring. TCS bought at −40% (₹2,692.20, 13 Feb 2026) fell a further 23.8% by 30 Sep 2026. (b) Loss aversion / disposition effect. On S1's real trades, these habits turned +0.080R into −0.546R per trade. (c) Overconfidence (plus recency). (d) Confirmation bias. Counters: decide on current trend/valuation; hard stops and rule-based exits; size changes only by written schedule; write the invalidation point and bear case before entry.
Q12. Exercise: choose 5 stocks from different sectors in data/ohlc. Using snippet 19.1, compute their correlation matrix and equal-weight portfolio volatility for Oct 2024 – Sep 2026. Then swap one stock for a second stock from an existing sector (e.g. add ICICIBANK next to HDFCBANK). What happens to the average correlation and the portfolio volatility?
Your exact numbers depend on your choice. Typically the cross-sector correlations are 0.1–0.3 and an equal-weight portfolio's volatility lands around 13–16% a year. Adding a same-sector stock raises the average correlation (HDFCBANK–ICICIBANK is 0.51 vs ~0.12–0.30 for cross-sector pairs), so the portfolio volatility rises even though you "added a stock". Diversification is about correlations, not the count of names.

23. Sources

Primary concepts (explained here in our own words): Zerodha Varsity Module 9, Risk Management & Trading Psychology: Ch 1 Orientation note · Ch 2 Risk (Part 1) · Ch 3 Risk (Part 2) – Variance & Covariance · Ch 4 Risk (Part 3) – Variance & Covariance Matrix · Ch 5 Risk (Part 4) – Correlation Matrix & Portfolio Variance · Ch 6 Equity Curve · Ch 7 Expected Returns · Ch 8 Portfolio Optimization (Part 1) · Ch 9 Portfolio Optimization (Part 2) · Ch 10 Value at Risk · Ch 11 Position Sizing for active trader · Ch 12 Position Sizing (Part 2) · Ch 13 Position Sizing (Part 3) · Ch 14 Kelly's Criterion · Ch 15 Trading Biases · Ch 16 Trading Biases (Part 2).

Psychology themes: Zerodha Varsity Module 13, Innerworth – Mind over Markets, especially Accurate Perceptions of Loss and Risk Aversion · Detailed Action Plans · Loss is Feedback, Not Failure · The Flexible and Disciplined Trader · Regret: A Powerful Emotion · It's Easier to Face Fear than Avoid It · Relieving Stress · The Herd Mentality · Everything Seems Obvious in Hindsight · Overconfidence, Risk, and Rewards · Creative, Winning Trading Plans.

Regulatory statistics: SEBI study "Profitability of Individual Traders in the Equity Derivatives Segment (FY25–FY26)" (20 Aug 2026), as reported by TaxGuru and CorpLaw Updates (87.7% of individual traders had net losses in FY26; 82.1% before costs; aggregate net loss ≈ ₹91,685 crore), announced on SEBI's official X account. Margins: NSE Clearing SPAN risk-parameter file for 30 Sep 2026 plus ELM of 2% (index) / 3.5% (stock) futures, as verified in Chapter 9.

Data: daily OHLCV for NSE stocks and indices to 30 Sep 2026 (NSE via Yahoo Finance), GOLDBEES ETF (Yahoo Finance), NSE F&O UDiFF bhavcopy (Aug–Sep 2026), Chapter 5 swing-setup trade list (data/extra/ch05_trades.csv). All figures and numbers: course/scripts/ch11_figures.py → course/img/ch11/ and data/extra/ch11_results.json. Educational material only, not investment advice; all examples are historical analysis.

← PreviousOptions Essentials & HedgingNext →Trading Systems & Backtesting