The Claude Quant PlaybookDownload ebookDownload ebook

Risk of ruin

intermediateRisk and portfolio11 of 13

If you bet one unit at a time on even-money bets with an edge, this is the chance you go broke before your bankroll runs away from zero. It falls exponentially with the number of units you start with.

Build a trading system with Claude.Download ebook

01The formula

the probability of winning each even-money bet
the probability of losing it
your starting bankroll, counted in betting units
the chance you eventually lose the whole bankroll if you keep betting forever

02See it move

03Where it is used

04Why traders use it

An edge only pays if you survive long enough to collect it. The formula shows that the cure for ruin is not a bigger edge but smaller bets: halving the bet size doubles n and squares the risk of ruin.

05Worked example

With a 52.0% chance of winning each bet and 20 units in the bankroll, the risk of ruin is 20.17%. Betting half as much cuts it to 4.07%. The edge per bet is only 4.0%, and you need about 57.5 units to bring the risk down to 1%.

06How it is built

  1. Let be the chance of ruin starting from units. After one bet you have or , so , with .
  2. Try : this gives , with roots and .
  3. With an edge, the chance of ruin must go to 0 as grows, so the answer is .
  4. Bets half the size double the number of units, so the risk becomes , the square of the old risk.

07The common mistake

Thinking a positive edge means you cannot go broke. With a 52% win rate and a small bankroll, ruin is still likely. And with no edge () ruin is certain if you play long enough.

08In Python and LaTeX

p, units = 0.52, 20
r = (1 - p) / p
print(round(r**units, 4), round(r**(2*units), 4))
P(\text{ruin}) = \left(\frac{1 - p}{p}\right)^{n}, \qquad p > \tfrac12

09Where it fits

Rather not code the maths yourself? Describe your trading idea and let AI build the bot.

Build a bot with AgenKit

The worked example and the model run the same code, so every number matches. Models simplify markets on purpose. This is education, not financial advice.