Chapter 7 · The Mathematics of Trading

7.2 Risk Management: Position Sizing, Expectancy and Kelly

A trading system is judged by two numbers — how often it wins and how much it wins when it does — and survives only if every position is sized for the losing streaks that will certainly come. Risk per trade, stop-losses, expectancy, the Kelly criterion and risk of ruin, with the probability behind each and simulations you can rerun.

📍 The situation

Priya, 29, a chartered-accountancy student in Ahmedabad, has set aside ₹5,00,000 as a trading account. Her first planned swing trade is in a hypothetical share, "Kaveri Cements Ltd", now at ₹840: she wants to buy, with a stop-loss at ₹812 and a target of ₹896. A friend's advice is "put in at least ₹3 lakh, it's a sure thing"; a trading channel says "risk only 1% per trade"; and a book she is reading talks about something called the Kelly criterion, which "tells you the optimal bet".

Her questions are the subject of this section. How many shares should she buy so that being wrong costs a known amount? Is a stop ₹28 away better or worse than one ₹8 away? Her paper-trading record says she wins about 40% of the time, but her winners are about twice her losers — is that a good system, and how good? How much of her account should each trade risk: 1%, 5%, 20%? And how bad can it get — how long a losing streak should she expect, and what is the chance of losing half her capital? The tools are expected value, the logarithm (to turn repeated multiplication into addition), a derivative set to zero (Kelly), and simulations of thousands of traders. They build directly on drawdowns (§3.1) and random walks (§3.3).

⚠️ About the numbers on this page

Win rates, payoffs, volatilities and costs on this page are illustrative assumptions, and every equity curve and probability marked "simulated" comes from a seeded simulation of a hypothetical trading system — not from any real trader, strategy or market history. A risk rule such as "1% per trade" is shown as a worked example of the mathematics, not as a recommendation. Brokerage, taxes, margins and F&O rules change — check SEBI, the exchanges and your broker for current rules. People and companies are hypothetical; nothing here is investment advice. Most of the risk in trading comes from having no real edge at all, which no sizing rule can fix.

Risk per Trade, Stop-Losses and Position Sizing

A professional's first question about a trade is not "how much can I make?" but "how much do I lose if I am wrong?". Deciding that amount first, and then deriving the number of shares from it, is called position sizing.

📘 Definition 7.7 — Stop-loss, initial risk and R-multiples

A stop-loss is a price at which a losing position will be closed (often placed in advance as a stop order). For a long position bought at $E_0$ with stop $S$ ($S\lt E_0$), the initial risk per share is $E_0-S$; for a short position sold at $E_0$ with stop $S\gt E_0$ it is $S-E_0$. The rupee amount lost if the stop is hit exactly, $Q\times(\text{risk per share})$ for $Q$ shares, is the trade's initial risk, written $1R$.

Results are then measured in R-multiples: a trade that gains ₹15,000 when $1R=$ ₹5,000 is a $+3R$ trade; one stopped out exactly is $-1R$. The reward–risk ratio of a planned trade is (target − entry)/(entry − stop) for a long position.

📘 Definition 7.8 — Fixed-fractional position sizing

Under fixed-fractional sizing with risk fraction $f$ (for example $f=1\%$), each trade's initial risk is the fraction $f$ of the current account equity $W$: $1R=fW$. Under fixed-rupee sizing each trade risks the same rupee amount regardless of the account's ups and downs.

📐 Theorem 7.8 (Formula) — Position size, and what a losing streak costs
  1. Position size. With equity $W$, risk fraction $f$, entry $E_0$ and stop $S$, the number of shares is $$Q=\left\lfloor\frac{fW}{|E_0-S|}\right\rfloor,$$ and the position's value is $QE_0\approx fW\cdot\dfrac{E_0}{|E_0-S|}$. A stop that is a fraction $d=|E_0-S|/E_0$ away makes the position about $f/d$ of the account: the tighter the stop, the bigger the position. Where the position value exceeds what the account (or a self-imposed cap) allows, the cap decides $Q$ and the actual risk is smaller than $fW$.
  2. Losing streaks. After $k$ consecutive full losses, fixed-fractional sizing leaves $W(1-f)^k$; it never reaches zero, because each loss is a fraction of what is left. Fixed-rupee sizing with risk $fW_0$ leaves $W_0(1-kf)$ and is wiped out after $1/f$ losses.
  3. Time to a drawdown. Under fixed-fractional sizing, a drawdown of $D$ (e.g. $25\%$) takes at least $k=\dfrac{\log(1-D)}{\log(1-f)}$ consecutive losses.

Why. (1) Each share loses $|E_0-S|$ if the stop is hit, so $Q$ shares lose $Q|E_0-S|$; setting this equal to $fW$ and rounding down gives $Q$. (2) Each loss multiplies equity by $1-f$, so $k$ losses multiply it by $(1-f)^k$ — a geometric sequence, as in §1.1. (3) Solve $(1-f)^k=1-D$ with logarithms, exactly as for doubling times in §1.1. ∎

Two practical warnings belong with the formula. A stop is an instruction, not a guarantee: if the share opens far below the stop after bad overnight news (a gap), the order fills at the open and the loss is larger than $1R$. And the "risk" here is the planned loss to the stop, not the full statistical risk of the position — the volatility measures of §3.1 and VaR (§7.4) describe the rest.

✏️ Example 1 — Sizing Priya's first trade
Priya's equity is ₹5,00,000 and she risks $f=1\%$ per trade. She buys Kaveri Cements at ₹840 with a stop at ₹812 and a target of ₹896. (a) How many shares? (b) What is the position's value as a share of her account? (c) What is the planned reward–risk ratio, and what does the trade make in R and in rupees if the target is reached?
(a) $1R=0.01\times5{,}00{,}000=$ ₹5,000; risk per share $840-812=$ ₹28; $Q=\lfloor5{,}000/28\rfloor=\lfloor178.6\rfloor=178$ shares.
(b) $178\times840=$ ₹1,49,520, about 29.9% of the account. Note the difference: she holds 30% of her capital in the share but risks 1% of it (₹4,984 if the stop fills exactly).
(c) Reward per share $896-840=$ ₹56, so reward–risk $=56/28=2$. At the target the trade makes $+2R$: $178\times56=$ ₹9,968, about 2% of the account (before costs).
Contrast The friend's "₹3 lakh" is 357 shares; with the same stop that risks $357\times28=$ ₹9,996, about 2% — and nothing about the trade's quality has changed. Position size is a decision about risk, separate from the decision to trade.
✏️ Example 2 — A tighter stop, a bigger position, and a gap
(a) Priya considers a tighter stop at ₹832 instead of ₹812, still risking 1%. How many shares would that mean, and what is the problem? (b) With the original plan (178 shares, stop ₹812), the share opens one morning at ₹790 after bad news and her stop order fills there. What does she lose, in rupees, in R and as a share of the account? (c) After how many consecutive full losses at 1% is her account down 10%? At 2%?
(a) Risk per share ₹8, so $Q=5{,}000/8=625$ shares, worth $625\times840=$ ₹5,25,000 — more than the whole account. Without borrowing she can buy at most $\lfloor5{,}00{,}000/840\rfloor=595$ shares, and with a sensible cap on any one position (say 30% of the account) far fewer. Tight stops force big positions; that is the main way "1% risk" quietly turns into a concentrated, leveraged bet.
(b) Loss $178\times(840-790)=$ ₹8,900 $=8{,}900/4{,}984\approx1.8R$, i.e. 1.78% of the account instead of 1%. Gaps are why the planned risk is a floor on the bad outcomes, not a ceiling.
(c) At 1%: $0.99^k\le0.9$ needs $k\ge\log0.9/\log0.99\approx10.5$, so 11 losses. At 2%: $\log0.9/\log0.98\approx5.2$, so 6 losses. For comparison, 10 losses cost $1-0.99^{10}\approx9.6\%$ at 1%, $1-0.98^{10}\approx18.3\%$ at 2% and $1-0.95^{10}\approx40.1\%$ at 5%.

Where should the stop go? A stop placed inside the share's ordinary daily noise will be hit often even when the trade idea is right. The random walk of §3.3 tells us how often.

📐 Theorem 7.9 (Rule) — How often does noise hit a stop?

Model the log price as a driftless Brownian motion with daily volatility $\sigma$ (§3.3). The probability that, at some moment within the next $T$ trading days, the price touches a stop placed a fraction $d$ below the entry (more precisely, at log-distance $d$) is $$P(\text{stop touched within }T\text{ days})=2\,\Phi\!\left(-\frac{d}{\sigma\sqrt T}\right),$$ where $\Phi$ is the standard normal distribution function. It depends only on the stop distance measured in units of $\sigma\sqrt T$, the typical move over the horizon. If the stop is checked only against daily closes, the probability is somewhat smaller.

Why (the reflection principle). Let $X$ be the change in log price, a Brownian motion started at $0$. Pair every path that touches $-d$ before time $T$ and ends above $-d$ with the path obtained by reflecting its part after the first touch in the line $-d$; the reflected path ends below $-d$, and by symmetry of the increments both are equally likely. Paths that end below $-d$ have certainly touched it. So $P(\text{touch})=2P(X_T\le-d)=2\Phi(-d/(\sigma\sqrt T))$, since $X_T\sim N(0,\sigma^2T)$. ∎

✏️ Example 3 — Is the stop inside the noise?
Kaveri Cements has an illustrative daily volatility of 1.8%. Priya expects to hold for about 10 trading days. Using Theorem 7.9 and ignoring any drift, find the probability that noise alone touches (a) her ₹812 stop ($d=28/840\approx3.33\%$), (b) the tight ₹832 stop ($d\approx0.95\%$), (c) a stop 2% below the entry.
Scale $\sigma\sqrt T=1.8\%\times\sqrt{10}\approx5.69\%$: over two weeks a one-standard-deviation move is about 5.7%.
(a), (b) (a) $d/(\sigma\sqrt T)\approx0.586$, $2\Phi(-0.586)\approx0.56$. (b) $0.167$, $2\Phi(-0.167)\approx0.87$.
(c) $0.02/0.0569\approx0.351$, $2\Phi(-0.351)\approx0.73$. (A simulation that checks the price only at daily closes gives about 60%.)
Interpret Even the "wide" stop is touched by pure noise more often than not over two weeks; the tight one almost always is. A stop is a risk-control device, and its distance should be chosen relative to volatility — which then fixes the position size through Theorem 7.8. Wider stop, fewer shares, same rupee risk.

Win Rate, Risk–Reward and Expectancy

Traders love to quote their win rate. A win rate on its own says almost nothing: what matters is how much is won on the wins and lost on the losses. Combining the two is a direct application of expected value.

📘 Definition 7.9 — Win rate, payoff ratio and expectancy

For a trading system, the win rate $p$ is the probability that a trade is profitable and $q=1-p$; the payoff ratio $b$ is the average win divided by the average loss (in R-multiples, the average winning R when losses are $-1R$). The expectancy is the expected profit per trade: $$E=p\cdot\overline{W}-q\cdot\overline{L}\ \ \text{(rupees)},\qquad E_R=p\,b-q\ \ \text{(in }R\text{ per trade)},$$ where $\overline{W}$ and $\overline{L}$ are the average win and average loss in rupees.

📐 Theorem 7.10 (Formula) — Break-even win rate, costs, and the spread of results
  1. Break-even. $E_R\gt0\iff p\gt p^*=\dfrac{1}{1+b}$. With a cost of $c$ (in R) on every trade, $E_R=pb-q-c$ and the break-even win rate rises to $\dfrac{1+c}{1+b}$.
  2. Many trades. If each trade is $+b$ with probability $p$ and $-1$ otherwise, independently, the variance per trade is $s^2=pq(1+b)^2$. After $N$ trades the total result (in R) has mean $NE_R$ and standard deviation $s\sqrt N$, and for large $N$ $$P(\text{behind after }N\text{ trades})\approx\Phi\!\left(-\frac{\sqrt N\,E_R}{s}\right).$$

Why. (1) $pb-(1-p)\gt0\iff p(1+b)\gt1$; with costs, $p(1+b)\gt1+c$. (2) The result per trade is $-1+(1+b)B$ with $B\sim\text{Bernoulli}(p)$, so its variance is $(1+b)^2pq$. Sums of independent trades add means and variances — the random walk of §3.3 with drift $E_R$ — and the central limit theorem gives the normal approximation. ∎ The edge grows like $N$ and the noise like $\sqrt N$, so a small positive expectancy needs many trades before it reliably shows.

payoff ratio $b$0.511.5234
break-even win rate $1/(1+b)$66.7%50%40%33.3%25%20%
✏️ Example 4 — Priya's 40% system
Priya's paper trades suggest $p=0.40$ and $b=2$. (a) Find the expectancy in R and in rupees at $1R=$ ₹5,000, and the break-even win rate. (b) Costs (brokerage, taxes, charges, slippage) are an illustrative $0.05R$ per trade. Recompute. (c) Ignoring costs, how likely is she to be behind after 100 trades?
(a) $E_R=0.4\times2-0.6=0.2R$ per trade, i.e. ₹1,000 per trade at ₹5,000 risk. Break-even $p^*=1/3$: she loses 60% of her trades and still has a positive edge.
(b) $E_R=0.2-0.05=0.15R$; break-even $1.05/3=35\%$. Costs ate a quarter of the edge.
(c) $s=\sqrt{0.4\times0.6}\times3\approx1.470$; after 100 trades the mean is $20R$ and the SD $14.7R$, so $P(\text{behind})\approx\Phi(-20/14.7)=\Phi(-1.36)\approx0.087$. Even a genuine edge leaves almost a 1-in-11 chance of being behind after 100 trades.
Caution All of this assumes that the true $p$ is 0.40. From a small sample it is uncertain — we return to this in Example 7 and the 📈 Market case.
✏️ Example 5 — The "90% accuracy" system
An advertised options-selling system "wins 90% of the time". Its winners average ₹1,000 and its losers ₹12,000. (a) Find its expectancy per trade. (b) How large may the average loss be for it to break even? (c) Explain how a high win rate and a negative expectancy fit together.
(a) $E=0.9\times1{,}000-0.1\times12{,}000=900-1{,}200=-$₹300 per trade.
(b) $0.9\times1{,}000=0.1\,\overline L$ gives $\overline L=$ ₹9,000 (payoff ratio $b=1/9$, break-even $p^*=0.9$ exactly).
(c) Strategies that collect many small gains and occasionally take a large loss — such as selling options far from the money (§6.2) — naturally have high win rates. A long run of small wins feels like skill until the large loss arrives. The win rate is the wrong number to look at; the expectancy (and, as we will see, the size of the worst losses) is the right one.
⚠️ Common mistakes and myths
  1. "A high win rate means a good system." Expectancy is $pb-q$. A 90% win rate with $b=1/12$ loses money (Example 5); a 35% win rate with $b=2.5$ makes money.
  2. "Risking 1% means I can lose at most 1%." Gaps and slippage can make a loss larger than $1R$ (Example 2), and many open positions that move together (§3.2) can lose many R at once.
  3. "A tight stop is safer." With the same rupee risk, a tight stop means a bigger position and a stop that noise will hit most of the time (Theorem 7.9).
  4. "After five losses in a row, I'm due a win." If trades are independent, the next trade's win probability is still $p$. Long streaks are normal (Theorem 7.14); "doubling up" after losses (martingale betting) turns a streak into ruin.
  5. "Expected profit is positive, so bigger bets are better." The average outcome rises with the bet size, but the typical outcome peaks at the Kelly fraction and becomes a loss beyond about twice it (Theorem 7.11, Interactive 1).
  6. "My backtest shows $p=0.40$, so Kelly says 10%." An estimated $p$ from 60 trades has a standard error of about 6 percentage points. Betting full Kelly on an overestimated edge means over-betting the true edge — the reason practitioners use a fraction of Kelly.
  7. "I'll make it back by trading bigger." A 50% loss needs a 100% gain to recover (§3.1); increasing size after a drawdown raises the risk of ruin exactly when the capital is smallest.
  8. Treating "risk of ruin" as zero because fixed-fractional equity never reaches zero. In practice a trader stops — financially or emotionally — long before zero; define ruin as the drawdown you could not continue after (say 50%), and that probability is far from zero for large $f$.

The Kelly Criterion and Fractional Kelly

Expectancy says whether to trade a system. It does not say how much to risk. Risk too little and a good edge earns almost nothing; risk too much and the account is destroyed by the losing streaks, even though every single trade has a positive expected value. Between the two lies an optimum, and finding it is a calculus problem.

Under fixed-fractional sizing with fraction $f$, a winning trade multiplies equity by $1+bf$ and a losing one by $1-f$. After $N$ trades with $w$ wins, $W_N=W_0(1+bf)^w(1-f)^{N-w}$. Multiplication is awkward, so take logarithms: $\log(W_N/W_0)=w\log(1+bf)+(N-w)\log(1-f)$, a sum of independent terms — a random walk in log-wealth, exactly as log returns were in §1.3 and §3.3.

📘 Definition 7.10 — Growth rate of a betting fraction

For a system with win probability $p$ and payoff ratio $b$, betting (risking) the fraction $f\in[0,1)$ of current equity on each independent trade, the growth rate per trade is the expected log-growth $$g(f)=p\log(1+bf)+q\log(1-f).$$ By the law of large numbers $\frac1N\log(W_N/W_0)\to g(f)$, so typical (median) wealth after $N$ trades is about $W_0e^{Ng(f)}$.

📐 Theorem 7.11 (Formula) — The Kelly criterion

Let $p\in(0,1)$, $b\gt0$ and suppose the expectancy is positive, $E_R=pb-q\gt0$. Then $g$ is strictly concave on $[0,1)$ and is maximised at the Kelly fraction $$f^*=p-\frac{q}{b}=\frac{pb-q}{b}=\frac{E_R}{b}.$$ Moreover $g(0)=0$, $g$ is positive on $(0,f_0)$ and negative on $(f_0,1)$ for a unique $f_0\in(f^*,1)$; for small edges $f_0\approx2f^*$. If $E_R\le0$, then $g(f)\lt0$ for every $f\gt0$ and the Kelly fraction is $0$: do not bet.

By contrast, the mean wealth after $N$ trades is $W_0(1+fE_R)^N$, which increases with $f$ without limit: maximising the mean says "bet everything", maximising the typical outcome says "bet $f^*$".

Derivation (the calculus link). Differentiate: $$g'(f)=\frac{pb}{1+bf}-\frac{q}{1-f},\qquad g''(f)=-\frac{pb^2}{(1+bf)^2}-\frac{q}{(1-f)^2}\lt0,$$ so $g$ is strictly concave and has at most one stationary point. $g'(f)=0$ $\iff pb(1-f)=q(1+bf)$ $\iff pb-q=bf(p+q)=bf$, giving $f^*=(pb-q)/b$, which lies in $(0,1)$ exactly when $E_R\gt0$. Since $g(0)=0$, $g'(0)=pb-q$ and $g(f)\to-\infty$ as $f\to1$, a concave $g$ starting at $0$ with positive slope rises to $g(f^*)\gt0$ and then falls through zero once, at $f_0$. For small $f$, $\log(1+x)\approx x-\frac{x^2}2$ gives $g(f)\approx fE_R-\tfrac12f^2(pb^2+q)$, a parabola that is zero at $0$ and at $2E_R/(pb^2+q)$ and peaks halfway, so $f_0\approx2f^*$. Finally, the mean of each trade's growth factor is $p(1+bf)+q(1-f)=1+fE_R$, and independent factors multiply. ∎

The gap between the mean and the median is the volatility drag of §3.1 at work: big bets make a few lucky traders extraordinarily rich, which lifts the average, while the typical trader is ground down by the losing streaks.

✏️ Example 6 — Kelly for an even-money edge
A system wins 55% of the time with $b=1$. (a) Find the Kelly fraction and $g(f^*)$. (b) What does typical wealth become after 100 trades? (c) Compute $g$ at half Kelly and at twice Kelly, and comment.
(a) $f^*=0.55-0.45=0.10$. $g(0.10)=0.55\log1.1+0.45\log0.9\approx0.052421-0.047413=0.005008$ per trade.
(b) $e^{100\times0.005008}\approx1.65$: typical wealth grows by about 65% in 100 trades. The mean, $(1+0.1\times0.1)^{100}=1.01^{100}\approx2.70$, is much higher — pulled up by lucky runs.
(c) $g(0.05)\approx0.003753$, about 75% of the maximum growth at half the bet size. $g(0.20)=0.55\log1.2+0.45\log0.8\approx-0.00014$: at twice Kelly the typical trader shrinks (here $f_0\approx0.199$), even though every trade has positive expectation.
Moral The growth curve is flat near the top and steep beyond it: under-betting costs a little growth, over-betting costs everything. That asymmetry is the case for betting less than Kelly.
📐 Theorem 7.12 (Rule) — Fractional Kelly: growth, volatility and drawdowns

Use the continuous-time approximation in which log-wealth under the Kelly-type strategy is a Brownian motion with drift (valid when each trade is a small part of the account; for an investment with excess return $\mu$ over cash and volatility $\sigma$ it is exact under GBM with continuous rebalancing, and then $f^*=\mu/\sigma^2$). Betting the fraction $\lambda f^*$ of Kelly ($0\lt\lambda\lt2$):

  1. the growth rate is $\lambda(2-\lambda)$ times the maximum — half Kelly earns 75% of the growth;
  2. the volatility of log-wealth is $\lambda$ times that at full Kelly — half Kelly has half the volatility;
  3. the probability that wealth ever falls to a fraction $x$ of its starting value is $$P(\text{ever reach }xW_0)=x^{\,2/\lambda-1}\qquad(0\lt x\lt1).$$ At full Kelly the chance of ever halving is $\left(\tfrac12\right)^1=50\%$; at half Kelly $\left(\tfrac12\right)^3=12.5\%$; at a quarter Kelly $\left(\tfrac12\right)^7\approx0.8\%$.

Why. With excess return $\mu$ and volatility $\sigma$, investing the fraction $f$ gives log-wealth drift $\nu(f)=f\mu-\tfrac12f^2\sigma^2$ (the $\sigma^2/2$ correction of §3.3) and log-volatility $f\sigma$. This is maximised at $f^*=\mu/\sigma^2$ with $\nu^*=\mu^2/(2\sigma^2)$, and $\nu(\lambda f^*)=\frac{\mu^2}{\sigma^2}(\lambda-\tfrac12\lambda^2)=\lambda(2-\lambda)\nu^*$. For a Brownian motion with drift $\nu\gt0$ and volatility $s$, the probability of ever falling a distance $c$ below its start is $e^{-2\nu c/s^2}$ (a standard result about Brownian motion, proved like the gambler's ruin formula below). Here $c=-\log x$ and $\frac{2\nu}{s^2}=\frac{2(\lambda-\lambda^2/2)\mu^2/\sigma^2}{\lambda^2\mu^2/\sigma^2}=\frac2\lambda-1$, so the probability is $e^{(2/\lambda-1)\log x}=x^{2/\lambda-1}$. ∎

Interactive 1 — The Kelly Curve: Typical Growth vs Average Growth

Set the system's win rate $p$ and payoff ratio $b$. The blue curve is the growth rate $g(f)$ per trade of typical wealth when you risk the fraction $f$ of equity on each trade; the purple line is the growth rate of average wealth, $\log(1+fE_R)$. The green dot marks full Kelly, the light dot half Kelly, and the red dot the fraction beyond which typical wealth shrinks. Drag $f$, or press Play to sweep it. (Model of independent trades with fixed win/loss sizes; illustrative.)

40%2.05.0%
expectancy E = pb − q—
Kelly fraction f*—
growth g(f) per trade—
typical wealth after N trades—
average wealth after N trades—
chance of ever halving (approx.)—
✏️ Example 7 — What if the edge is smaller than you think?
Priya estimates $p=0.40$ and $b=2$ from her paper trades. (a) Find the Kelly fraction and $g(f^*)$ for these estimates. (b) Suppose her true win rate is only $0.36$ (with $b=2$ still). Find the true Kelly fraction and the true growth rate if she bets (i) the estimated full Kelly, (ii) 1% per trade. (c) What does this say about full Kelly in practice?
(a) $f^*=0.40-0.60/2=0.10$; $\ g(0.10)=0.4\log1.2+0.6\log0.9\approx0.07293-0.06322=0.00971$ per trade.
(b) True $E_R=0.36\times2-0.64=0.08R$ (still positive), true $f^*=0.36-0.32=0.04$. (i) $g(0.10)=0.36\log1.2+0.64\log0.9\approx-0.00179$: betting 10% is $2.5$ times the true Kelly fraction, and typical wealth shrinks by about $1-e^{-0.179}\approx16\%$ per 100 trades. (ii) $g(0.01)\approx+0.00070$: slow but positive growth.
(c) The Kelly fraction is proportional to the edge, and the edge is the most uncertain number in trading. Overestimating it pushes you past $2f^*$, where growth is negative; underestimating it only slows growth. A small fraction of the estimated Kelly (a half, a quarter or less) is robust to estimation error — one mathematical reason for the "risk 1–2% per trade" habit of many traders.

Risk of Ruin and Losing Streaks

The last question is the bluntest: what is the chance of being wiped out, or of losing so much that you stop? For fixed-rupee bets there is a classical exact answer; for fixed-fractional sizing we define ruin as a large drawdown and use the formulas above or simulation. Either way, the length of losing streaks is the hidden driver.

📘 Definition 7.11 — Risk of ruin

Fix a ruin level: zero capital for fixed-rupee betting, or a drawdown after which the trader would stop (for example, equity at 50% of its starting value). The risk of ruin is the probability that equity reaches the ruin level — within a stated number of trades, or ever.

📐 Theorem 7.13 (Formula) — Gambler's ruin

A trader starts with $a$ units of capital ($a$ a positive integer) and on each independent trade wins 1 unit with probability $p$ or loses 1 unit with probability $q=1-p$ (fixed-rupee betting, $b=1$), stopping only at zero. Then $$P(\text{ruin})=\begin{cases}\left(\dfrac qp\right)^a, & p\gt\tfrac12,\\[2mm] 1, & p\le\tfrac12.\end{cases}$$ If instead the trader also stops on reaching a target of $A\gt a$ units and $p\ne\frac12$, $P(\text{ruin})=\dfrac{(q/p)^a-(q/p)^A}{1-(q/p)^A}$.

Why. Let $r_k$ be the probability of ruin from $k$ units, with target $A$. Conditioning on the first trade, $r_k=p\,r_{k+1}+q\,r_{k-1}$ for $0\lt k\lt A$, with $r_0=1$, $r_A=0$. This linear recurrence has solutions $r_k=x^k$ with $px^2-x+q=0$, i.e. $x=1$ or $x=q/p$, so $r_k=C_1+C_2(q/p)^k$; the two boundary conditions give the formula. Letting $A\to\infty$: if $p\gt\frac12$ then $(q/p)^A\to0$ and $r_a\to(q/p)^a$; if $p\lt\frac12$ the formula tends to $1$, and the case $p=\frac12$ (where $r_k=1-k/A$) also tends to $1$. ∎ Note what $a$ means: risking $1/a$ of the starting capital per trade. Risking 10% means $a=10$; risking 2% means $a=50$.

📐 Theorem 7.14 (Rule) — Losing streaks

Let trades be independent with loss probability $q$.

  1. The chance that a given run of $k$ trades are all losses is $q^k$ — whatever happened before.
  2. The chance of at least one run of $k$ or more consecutive losses somewhere in $N$ trades is computed exactly by a short recursion on the current streak length (a Markov chain; see 🛠️ Do it yourself), and approximately by $$P(\text{a streak}\ge k)\approx1-e^{-\lambda},\qquad\lambda=q^k\,[1+(N-k)p],$$ where $\lambda$ is the expected number of such streaks (a streak can start at the first trade, or right after any win).
  3. The longest losing streak in $N$ trades is typically about $\dfrac{\log(Np)}{\log(1/q)}$ — it grows like the logarithm of the number of trades.

Why. (1) is independence. For (2), a streak of $\ge k$ losses starts at trade $j\gt1$ exactly when trade $j-1$ is a win and trades $j,\dots,j+k-1$ are losses (probability $pq^k$), or at trade 1 with probability $q^k$; adding over the possible starts gives the expected number $\lambda$, and because such streaks are rare and nearly independent their count is approximately Poisson, so $P(\text{none})\approx e^{-\lambda}$. (3) The longest streak $k$ is where the expected count $Npq^k$ is about $1$. ∎

win rate $p$, trades $N$P(streak ≥ 6)P(streak ≥ 8)P(streak ≥ 10)median longest streak
55%, 100 trades36.3%8.4%1.7%5
40%, 100 trades87.3%49.0%20.5%7
40%, 200 trades98.5%75.0%38.0%9
40%, 250 trades99.5%82.5%45.2%9

(Exact values from the streak recursion.) A trader with a perfectly good 40%-win system who makes 200 trades will, three times out of four, live through a streak of eight or more losses in a row. Position size decides whether that streak is an annoyance or a disaster.

✏️ Example 8 — Ruin with a real edge
(a) A trader with an even-money edge ($p=0.55$, $b=1$) bets a fixed rupee amount equal to 10% of the starting capital until ruined. Find the risk of ruin. Repeat for 5% and 2%. (b) For Priya's system ($p=0.40$, $b=2$), how long a losing streak should she expect in 200 trades, and what does a 10-trade losing streak cost at 1%, 5% and 10% risk per trade? (c) Using Theorem 7.12, what is the chance of ever halving at full Kelly and at a tenth of Kelly?
(a) $q/p=0.45/0.55=0.8182$. At 10% ($a=10$): $0.8182^{10}\approx0.134$. At 5% ($a=20$): $\approx0.018$. At 2% ($a=50$): $\approx0.00004$. The edge is identical; only the bet size changed, and the risk of ruin fell from 1 in 7 to about 1 in 23,000.
(b) The table above: median longest streak 9; $P(\ge8)\approx75\%$, $P(\ge10)\approx38\%$. The approximation of Theorem 7.14(3) gives $\log80/\log(1/0.6)\approx8.6$. A 10-loss streak costs $1-0.99^{10}\approx9.6\%$ at 1%, $1-0.95^{10}\approx40.1\%$ at 5%, and $1-0.9^{10}\approx65.1\%$ at 10%.
(c) Full Kelly ($\lambda=1$): $\left(\tfrac12\right)^{1}=50\%$. A tenth of Kelly ($\lambda=0.1$, i.e. 1% risk for Priya's estimated $f^*=10\%$): $\left(\tfrac12\right)^{19}\approx0.0002\%$.
Moral Risk of ruin is controlled far more by the size of each bet than by the quality of the edge. Small bets turn a positive expectancy into a near-certainty of survival; large bets turn it into a coin toss.
Interactive 2 — Risk of Ruin: 1,000 Simulated Traders with the Same System

One thousand simulated traders trade the same system (win rate $p$, payoff $b$) with fixed-fractional sizing; each sees a different random sequence of wins and losses. Faint blue lines are 40 of them, the thick line is the median trader, the dashed purple lines the 10th and 90th percentiles, and the dashed red line the "ruin" level of 50% of the starting capital. The vertical scale is logarithmic (equal steps are equal percentage changes). Press Play to watch the trades unfold and new groups of traders start. (Simulated, illustrative.)

40%2.0
fell to half their capital—
had a 25% drawdown—
median final equity—
average final equity—
median longest losing streak—
streak of 10+ losses—
📈 Market case — Priya writes a risk plan before her first trade

Priya's account is ₹5,00,000. Her 60 paper trades give an estimated win rate $\hat p=0.40$ and payoff $b=2$; she assumes illustrative costs of $0.05R$ per trade. She works through the mathematics of this section before deciding anything.

  1. Is there an edge? $E_R=0.4\times2-0.6-0.05=0.15R$ — if $\hat p$ is right. But the standard error of $\hat p$ from 60 trades is $\sqrt{0.4\times0.6/60}\approx0.063$, so a rough 95% range for $p$ is $0.28$ to $0.52$. At $p=0.28$, $E_R=0.56-0.72-0.05=-0.21R$. Her data cannot yet rule out that she has no edge at all.
  2. Kelly, honestly. At $\hat p$ the Kelly fraction (ignoring costs) is $0.10$; across the range of plausible $p$ it runs from "do not trade" to $0.29$. Full Kelly on such an uncertain estimate is reckless (Example 7). She chooses $f=1\%$ — about a tenth of the estimated Kelly.
  3. What the choice means — simulated. For $p=0.40$, $b=2$, no costs, 200 trades, 100,000 simulated traders per row (seeded):
    risk per trademedian finalaverage finalever at 50% of starta 25% drawdown
    0.5%1.21×1.22×0.0%0.0%
    1%1.46×1.49×0.0%1.5%
    2%2.04×2.22×0.1%38.6%
    5%4.35×7.32×10.8%99.9%
    10% (full Kelly)6.98×52.3×43.3%100%
    20% (2× Kelly)1.15×1,786×82.7%100%
    The median rises up to Kelly and then collapses; the average keeps exploding thanks to a handful of astronomically lucky traders; and the chance of a deep drawdown climbs steeply. At 1% she gives up growth in exchange for almost never seeing a 25% drawdown — if the edge is real. If it is not, 1% is what keeps the lesson cheap.
  4. Streaks. In 200 trades she should expect a longest losing streak of about 9, and a 10-loss streak has a 38% chance. At 1% it costs about 9.6% of the account — painful but survivable.
  5. Her written rules. Risk 1% of current equity per trade, with the stop placed outside the normal 2-week noise and the position size computed from it (Theorems 7.8–7.9); cap any single position at 30% of equity; count costs in every result; stop trading and review if the account falls 15% from its peak; re-estimate $p$ and $b$ after 100 live trades, compare them with the paper results, and resize only then.

The general lesson. Expectancy decides whether a system is worth trading; position size decides whether the trader survives long enough for the expectancy to show. Neither can be judged without the uncertainty in the estimates — which is the subject of backtesting (§7.3).

Exercises

All systems, prices and costs are hypothetical or illustrative; trades are independent unless stated otherwise.

I
Position sizing and stops.
  • 1 Equity ₹8,00,000, risk 1.5% per trade, buy at ₹450 with a stop at ₹432. How many shares, and what is the position's value?
  • 2 Same, but with the stop at ₹441. How many shares, and what fraction of the account is the position?
  • 3 The trader also caps any position at 25% of equity. Recompute parts 1 and 2 and the actual rupee risk in each.
  • 4 A short sale at ₹1,200 with a stop at ₹1,236, risking 0.5% of ₹10,00,000. How many shares?
  • 5 At 2% risk per trade, what is the account's drawdown after 6 consecutive full losses?
  • 6 At 1% risk per trade, how many consecutive full losses take the account down 25%?
  • 7 A share's daily volatility is 2%. Using Theorem 7.9, what is the chance that a stop 3% below the entry is touched within 5 trading days by noise alone?
1 $1R=$ ₹12,000; risk per share ₹18; $Q=\lfloor666.7\rfloor=666$ shares; value $666\times450=$ ₹2,99,700 (37.5% of equity).
2 Risk per share ₹9; $Q=\lfloor1{,}333.3\rfloor=1{,}333$ shares; value ₹5,99,850, about 75% of the account.
3 Cap: $0.25\times8{,}00{,}000/450\approx444$ shares. It binds in both cases. Actual risk: part 1, $444\times18=$ ₹7,992 (1.0%); part 2, $444\times9=$ ₹3,996 (0.5%).
4 $1R=$ ₹5,000, risk per share ₹36, $Q=\lfloor138.9\rfloor=138$ shares (value ₹1,65,600).
5 $0.98^6\approx0.8858$: a drawdown of about 11.4%.
6 $\log0.75/\log0.99\approx28.6$, so 29 losses ($0.99^{28}\approx0.755$, $0.99^{29}\approx0.747$).
7 $d/(\sigma\sqrt T)=0.03/(0.02\sqrt5)\approx0.671$; $2\Phi(-0.671)\approx0.50$ — a coin toss.
II
Win rate and expectancy.
  • 1 Find the expectancy in R of a system with $p=0.35$ and $b=2.5$.
  • 2 What win rate does a system with $b=1.5$ need to break even?
  • 3 Winners average ₹6,000, losers ₹4,000, win rate 45%. Find the expectancy per trade.
  • 4 In part 3, costs are an illustrative ₹300 per trade. Find the new expectancy and the new break-even win rate.
  • 5 A system wins 30% of the time. What payoff ratio does it need to break even before costs?
  • 6 For $p=0.4$, $b=2$, estimate the chance of being behind after 50 trades.
  • 7 "My system wins 80% of trades, so it must be good." What two further numbers do you need, and why?
1 $0.35\times2.5-0.65=0.225R$.
2 $1/(1+1.5)=40\%$.
3 $0.45\times6{,}000-0.55\times4{,}000=2{,}700-2{,}200=$ ₹500.
4 $500-300=$ ₹200 per trade. Break-even: wins net ₹5,700 and losses ₹4,300, so $5{,}700p=4{,}300(1-p)$, $p=4{,}300/10{,}000=43\%$ (up from 40%).
5 $0.3b=0.7$, $b=7/3\approx2.33$.
6 $s=3\sqrt{0.24}\approx1.470$; $\Phi(-\sqrt{50}\times0.2/1.470)=\Phi(-0.962)\approx0.17$.
7 The average win and the average loss (equivalently $b$), to compute $E=pb-q$ — at 80% the system needs $b\gt0.25$ — and the number of trades behind the 80%, to know whether the estimate is reliable. Ideally also the worst losses, since high-win-rate systems often hide rare large ones.
III
Kelly and fractional Kelly.
  • 1 Find the Kelly fraction for $p=0.6$, $b=1$.
  • 2 Find the Kelly fraction for $p=0.45$, $b=1.5$.
  • 3 Find the Kelly fraction for $p=0.3$, $b=2$ and interpret.
  • 4 For $p=0.6$, $b=1$, compute $g$ at full and at half Kelly. What fraction of the maximum growth does half Kelly keep? Compare with Theorem 7.12.
  • 5 An index fund has an assumed excess return of 6% a year over cash and volatility 20%. What is the continuous Kelly fraction $\mu/\sigma^2$? What does it mean, and why might half of it still be too much?
  • 6 Using Theorem 7.12, find the chance of ever halving at full, half and one-third Kelly.
1 $0.6-0.4=0.20$.
2 $0.45-0.55/1.5\approx0.0833$, about 8.3%.
3 $0.3-0.7/2=-0.05\lt0$: the expectancy $0.6-0.7=-0.1R$ is negative, so Kelly says bet nothing.
4 $g(0.2)=0.6\log1.2+0.4\log0.8\approx0.02014$; $g(0.1)=0.6\log1.1+0.4\log0.9\approx0.01504$, i.e. 74.7% of the maximum — close to the 75% of the continuous approximation.
5 $0.06/0.04=1.5$: the formula says to hold 150% of wealth in the fund (borrowing 50%). Half Kelly is 75%. But $\mu=6\%$ is an assumption with a large estimation error (§3.1), and an overestimated $\mu$ pushes the fraction far past the true Kelly; real returns also have fat tails and jumps that the GBM model ignores.
6 $x^{2/\lambda-1}$ with $x=\frac12$: full $\frac12$; half $\frac18=12.5\%$; one-third $\left(\frac12\right)^5\approx3.1\%$.
IV
Ruin and streaks.
  • 1 With a 45% win rate, find the probability that the next 5 trades are all losses.
  • 2 Gambler's ruin with $p=0.52$, $b=1$ and capital of 25 units: find the risk of ruin.
  • 3 Repeat part 2 with 10 units. What does "10 units" mean as a risk per trade?
  • 4 A 40%-win system makes 100 trades. The exact chance of at least one streak of 8 or more losses is 49.0%. Check it with the approximation of Theorem 7.14(2).
  • 5 Estimate the typical longest losing streak in 250 trades of a 40%-win system.
  • 6 Fixed-fractional sizing never reaches zero. Explain why it can still "ruin" a trader, and how you would define and measure that risk.
1 $0.55^5\approx0.050$ — about 1 in 20, at any point in the trading record.
2 $(0.48/0.52)^{25}\approx0.135$.
3 $(0.48/0.52)^{10}\approx0.449$. Ten units means each trade risks 10% of the starting capital; with a thin 52% edge that is close to a coin toss on ruin.
4 $\lambda=0.6^8[1+92\times0.4]=0.016796\times37.8\approx0.635$; $1-e^{-0.635}\approx0.47$, close to the exact 0.49.
5 $\log(250\times0.4)/\log(1/0.6)=\log100/0.5108\approx9.0$ losses (the exact median is 9).
6 Each loss takes a fraction of what remains, so equity tends towards zero without reaching it — but at 20% risk ten losses leave 11% of the capital, and recovering needs a gain of about 800%. A practical definition is "equity falls below a stated level (e.g. 50% of the start or of the peak)"; measure its probability by simulation over the planned number of trades, or with Theorem 7.12 for an infinite horizon.
🎯 Practice corner NISM-styleCase studyInterview

E1. NISM-style A trader with capital of ₹10,00,000 risks 1% of capital per trade. She buys a share at ₹500 with a stop-loss at ₹480. The number of shares she should buy is (A) 50 (B) 500 (C) 2,000 (D) 5,000.

Compute Risk ₹10,000; risk per share ₹20; $10{,}000/20=500$. (C) is the whole capital divided by the price; (A) and (D) misplace a factor of 10.
Answer (B).

E2. NISM-style A system wins half its trades; the average win is ₹3,000 and the average loss ₹2,000. Its expectancy per trade is (A) ₹1,000 (B) ₹500 (C) ₹2,500 (D) −₹500.

Compute $0.5\times3{,}000-0.5\times2{,}000=$ ₹500. (A) is the difference of the averages without the probabilities.
Answer (B).

E3. NISM-style For a bet won with probability 0.55 at even money, the Kelly criterion says to stake (A) 5% (B) 10% (C) 45% (D) 55% of capital.

Compute $f^*=p-q/b=0.55-0.45=0.10$. (D) is the win probability itself, a common confusion.
Answer (B).

E4. Case study Arjun has ₹10,00,000 and a system with $p=0.45$, average win $1.8R$, illustrative costs $0.05R$ per trade. He risks 1.5% per trade. (a) Find the expectancy in R (after costs) and in rupees on the first trade. (b) Find the Kelly fraction (ignoring costs). What fraction of Kelly is he using? (c) The exact chance of at least one streak of 8 or more losses in 150 trades is about 43%; check it with the approximation of Theorem 7.14. (d) What does such a streak cost him?

(a) $E_R=0.45\times1.8-0.55-0.05=0.21R$; $1R=$ ₹15,000, so ₹3,150 per trade.
(b) $f^*=0.45-0.55/1.8\approx0.144$. He uses $0.015/0.144\approx0.10$ — about a tenth of Kelly.
(c) $\lambda=0.55^8[1+142\times0.45]\approx0.008373\times64.9\approx0.543$, $1-e^{-0.543}\approx0.42$ — close to the exact 0.43.
(d) $1-0.985^8\approx11.4\%$ of the account, about ₹1.14 lakh from ₹10 lakh — survivable, and very likely to happen at some point in 150 trades.

E5. Case study Two traders use the same system, believed to have $p=0.5$, $b=1.5$. Trader A risks 2% per trade, trader B 10%. (a) Find $E_R$ and $f^*$. (b) Find each trader's growth rate per trade and typical wealth multiple after 100 trades. (c) Using Theorem 7.12, find each one's chance of ever halving. (d) Suppose the true win rate is 0.42. Recompute $E_R$, $f^*$ and the growth rates, and comment.

(a) $E_R=0.75-0.5=0.25R$; $f^*=0.5-0.5/1.5\approx0.167$.
(b) A: $g(0.02)=0.5\log1.03+0.5\log0.98\approx0.00468$, typical multiple $e^{0.468}\approx1.60$. B: $g(0.10)=0.5\log1.15+0.5\log0.9\approx0.01720$, multiple $\approx5.58$.
(c) A: $\lambda=0.12$, $\left(\tfrac12\right)^{2/0.12-1}=\left(\tfrac12\right)^{15.7}\approx0.002\%$. B: $\lambda=0.6$, $\left(\tfrac12\right)^{2.33}\approx20\%$.
(d) $E_R=0.42\times1.5-0.58=0.05R$, $f^*=0.42-0.58/1.5\approx0.033$. A: $g(0.02)\approx+0.00070$ (multiple $\approx1.07$ after 100 trades). B: $g(0.10)\approx-0.00241$ (multiple $\approx0.79$) — B is now at three times the true Kelly fraction and shrinks while A still grows. B's higher growth in (b) was a reward for being right about $p$; A's plan survives being wrong.

E6. Interview "I offer you a repeated bet: a fair coin; heads, you win twice your stake; tails, you lose your stake. You can bet any fraction of your current wealth each time, forever. What fraction do you bet, and what happens if you bet half your wealth every time?"

Kelly $p=\frac12$, $b=2$: $f^*=\frac12-\frac{1/2}{2}=\frac14$. Growth $g=\frac12\log1.5+\frac12\log0.75\approx0.0589$ per bet — wealth typically grows about 6% per bet.
Half your wealth $g(\tfrac12)=\frac12\log2+\frac12\log\frac12=0$: each bet has expected gain of a quarter of your wealth, yet typical wealth goes nowhere — one win and one loss leave you exactly where you started ($2\times\frac12=1$), and log-wealth is a driftless random walk. Bet more than half and you are almost surely ruined in the long run.
Good answer adds In practice bet less than $\frac14$ because you can never be sure of $p$ — and maximising the expected wealth (bet everything) is the wrong objective for repeated bets.
🧑‍🏫 For the teacher

Suggested plan — 2 lectures × 60 min.

  1. Sizing and expectancy. Start with Priya's trade and ask the class how many shares to buy before any formula. Definitions 7.7–7.8 and Theorem 7.8 with Examples 1–2; the "tighter stop = bigger position" surprise. Theorem 7.9 (reflection principle drawn on the board) and Example 3. Then Definition 7.9, Theorem 7.10 and the break-even table; Examples 4–5. The ⚠️ box.
  2. Kelly and ruin. Write $W_N=W_0(1+bf)^w(1-f)^{N-w}$ and take logs; Definition 7.10, Theorem 7.11 with the derivative, Example 6. Project Interactive 1: sweep $f$ and ask why the purple line keeps rising while the blue curve turns down. Theorem 7.12 and Example 7 (estimation error). Then gambler's ruin (Theorem 7.13), streaks (Theorem 7.14 and the table) and Example 8. Finish with Interactive 2 at 2%, then 10%, then 20%, and the 📈 Market case.

Class activity. Each student starts with 100 "points" and plays 30 rounds of a 40% die game (win on a roll of 1 or 2 out of 1–5, re-roll a 6) paying 2:1, betting a fixed fraction they choose (2%, 10%, 25% or 50%). Collect final balances on the board grouped by fraction: compare the median and the mean in each group and the number of students who fell below 50 points.

Discussion questions. (1) Why does maximising the average outcome lead to ruin? (2) If you are unsure of your edge, how should that change your bet size? (3) Is a 90% win rate reassuring or worrying?

Misconceptions to watch for. Confusing position value with risk; "tight stops are safe"; judging systems by win rate; the gambler's fallacy after a losing streak; treating Kelly as a target rather than a ceiling; believing fixed-fractional sizing makes ruin impossible.

Suggested homework. I(1–3, 7), II(3, 4, 6, 7), III(2, 4, 5), IV(2, 4, 6); Practice corner E4, E5.

🛠️ Do it yourselfSpreadsheet or Python mini-project · about 60 minutes

Project. Build a risk-of-ruin simulator for a trading system: 1,000 simulated traders, any win rate, payoff and risk per trade — and an exact losing-streak calculator to check it.

Why it matters. Intuition about streaks and drawdowns is notoriously poor. A simulator you built yourself shows, for your own numbers, how bad "normal" bad luck is — before real money finds out for you.

What to do.

  1. Inputs. B1: win rate $p$; B2: payoff $b$; B3: risk fraction $f$; B4: cost per trade in R (illustrative).
  2. One trader. In A7:A206 put trades 1–200. B7: =IF(RAND()<$B$1,1+$B$2*$B$3,1-$B$3)*(1-$B$4*$B$3) (the growth factor of the trade); C6: 1, C7: =C6*B7 (equity); D7: =MAX($C$6:C7) (running peak); E7: =C7/D7-1 (drawdown); F7: =IF(B7<1,F6+1,0) with F6: 0 (current losing streak).
  3. Summary for that trader. Final equity =C206; maximum drawdown =MIN(E7:E206); longest losing streak =MAX(F7:F206); "ruined" =MIN(C7:C206)<=0.5.
  4. 1,000 traders. Use a Data Table (What-If Analysis) with the summary cells as outputs and 1,000 blank inputs, or copy the block across 1,000 columns. Compute the median and mean final equity, the share of ruined traders and the median longest streak. Repeat for $f=1\%,2\%,5\%,10\%,20\%$.
  5. Exact streak probability. In a new sheet, columns for "current streak = 0, 1, …, $k-1$" and "already had a streak of $k$". Row 0: 1, 0, …, 0. Each next row: streak-0 cell =(sum of the previous row's streak cells)*p; streak-$j$ cell =(previous row's streak-$(j-1)$ cell)*q; "already" cell =previous "already" + previous streak-$(k-1)$ cell*q. After $N$ rows the "already" cell is $P(\text{streak}\ge k)$ — compare with the table in this section.

Python version: W = rng.random((1000, N)) < p; eq = np.cumprod(np.where(W, 1 + b*f, 1 - f), axis=1); dd = eq/np.maximum.accumulate(eq, axis=1) - 1; then np.median(eq[:, -1]), eq[:, -1].mean(), (eq.min(axis=1) <= 0.5).mean().

Hand in: a table of median final, mean final, P(ruin) and median longest streak for five values of $f$; a plot of median final against $f$ with the Kelly fraction marked; and your exact streak probabilities next to the simulated ones.

Going further. Replace the fixed $p$ by a random one drawn at the start of each trader's life from the range your own data allow (e.g. uniform between 0.30 and 0.50). How does the best $f$ change when the edge itself is uncertain?

Instructor note: with $p=0.4$, $b=2$, no costs and 200 trades, students should find the median final equity peaking near $f=10\%$ (about $7\times$) and collapsing to about $1.15\times$ at 20%, while the mean keeps rising. With 1,000 traders the simulated probabilities carry a standard error of up to about 1.6 percentage points — a good moment to recall §3.3's Monte Carlo accuracy rule.

🧪 Self-check quiz

0/5 correct

Q1. With the same rupee risk per trade, moving the stop-loss closer to the entry price

Q2. A system wins 40% of its trades with an average win of 2R and an average loss of 1R. Its expectancy is

Q3. For $p=0.6$ and $b=1$ the Kelly fraction is

Q4. Betting about twice the Kelly fraction on a system with a positive edge leads, in the long run, to

Q5. A system wins 40% of its trades. Over 200 independent trades, a streak of 8 or more consecutive losses is