5D Library › Regime-Switching Fractional Kelly, Maximum-Drawdown Constraints and Lifecycle Leverage Allocation · 中文

Chapter 8. Practice: A Ten-Year Leverage Table, Gap Risk and a Drawdown Warning Rule

Note

Not investment advice. This chapter turns the earlier arithmetic into tables and rules for discussion. The markets in it are models with illustrative parameters; the only historical number is the one-day fall of 19 October 1987. Nothing here is a recommendation to use leverage, buy or sell any security, or follow any rule.

A ten-year Kelly leverage table

p14 gives, for Sharpe ratios from 0.2 to 0.5 and volatility 0.16, the largest fraction of Kelly whose ten-year maximum drawdown exceeds a limit with chance at most 0.05, in a log-normal market without regimes.

Calculation

# Chapter 8. p14: A ten-year Kelly leverage table. Continuously
# rebalanced portfolio, log-normal market with volatility 0.16, cash at
# 0.02; Sharpe ratios 0.2 to 0.5. For each limit D on the maximum
# drawdown, the largest fraction k of Kelly (steps of 0.025) whose
# ten-year maximum drawdown, checked monthly, exceeds D with chance at
# most 0.05; leverage = k * Kelly. 3,000 paths per Sharpe, seed 98.
import random
from math import sqrt

SIG, RF = 0.16, 0.02
KS = [i / 40 for i in range(1, 33)]

def mdd(zs, lev, ex):
    mu = (RF + lev * ex - 0.5 * (lev * SIG) ** 2) / 12
    sd = lev * SIG / sqrt(12)
    x = peak = dd = 0.0
    for z in zs:
        x += mu + sd * z
        if x > peak:
            peak = x
        elif peak - x > dd:
            dd = peak - x
    return 1 - 2.718281828459045 ** (-dd)

if __name__ == "__main__":
    rng = random.Random(98)
    print("   Sharpe  Kelly   k (D=15%)  lev   k (D=20%)  lev   "
          "k (D=30%)  lev")
    for sh in (0.2, 0.3, 0.4, 0.5):
        ex = sh * SIG
        kelly = ex / SIG ** 2
        zs = [[rng.gauss(0, 1) for _ in range(120)] for _ in range(3000)]
        row = []
        for D in (0.15, 0.2, 0.3):
            best = 0.0
            for k in KS:
                bad = sum(mdd(z, k * kelly, ex) > D for z in zs) / 3000
                if bad <= 0.05:
                    best = k
            row += [best, best * kelly]
        print("   {:6.1f}  {:5.2f}   {:9.3f}  {:4.2f}  {:9.3f}  {:4.2f}  "
              " {:9.3f}  {:4.2f}".format(sh, kelly, *row))
#    Sharpe  Kelly   k (D=15%)  lev   k (D=20%)  lev   k (D=30%)  lev
#       0.2   1.25       0.225  0.28      0.275  0.34       0.400  0.50
#       0.3   1.88       0.150  0.28      0.200  0.38       0.275  0.52
#       0.4   2.50       0.125  0.31      0.150  0.38       0.225  0.56
#       0.5   3.12       0.100  0.31      0.125  0.39       0.200  0.62

Two things stand out. The fraction of Kelly falls as the Sharpe ratio rises (for a 20% limit from 0.275 at Sharpe 0.2 to 0.125 at 0.5), while the resulting leverage stays within a narrow band: 0.34 to 0.39 for a 20% limit, 0.28 to 0.31 for 15%, 0.50 to 0.62 for 30%. A drawdown limit is mainly a limit on volatility, and with an asset of volatility 0.16 it allows roughly a third of wealth in the asset for a 20% limit, whatever the believed edge. In a market with bear regimes the limits are tighter still (Chapter 4).

Gap risk

Every formula in this book assumes that wealth moves continuously or monthly. On 19 October 1987 the S&P 500 fell 20.47% in one day. p15 shows what one such day does to a leveraged account.

Calculation

# Chapter 8. p15: Gap risk that no Kelly formula sees. On 19 October 1987
# the S&P 500 fell 20.47% in one day. For a portfolio with leverage L
# (assets / equity): the loss of equity that day; the one-day fall that
# triggers a margin call at 25% maintenance, (1 - 0.25 L) / (0.75 L);
# and the fall that wipes out the equity, 1 / L.
CRASH = 0.2047

if __name__ == "__main__":
    print("   leverage  loss on 19 Oct 1987  margin-call fall  wipe-out fall")
    for L in (0.5, 1.0, 1.5, 2.0, 3.0, 4.0):
        loss = min(L * CRASH, 1.0)
        call = (1 - 0.25 * L) / (0.75 * L)
        print("   {:8.1f}  {:19.3f}  {:16.3f}  {:13.3f}".format(
            L, loss, min(call, 1.0), min(1 / L, 1.0)))
    print("   leverage at which that day alone wipes out: {:.2f}".format(
        1 / CRASH))
#    leverage  loss on 19 Oct 1987  margin-call fall  wipe-out fall
#         0.5                0.102             1.000          1.000
#         1.0                0.205             1.000          1.000
#         1.5                0.307             0.556          0.667
#         2.0                0.409             0.333          0.500
#         3.0                0.614             0.111          0.333
#         4.0                0.819             0.000          0.250
#    leverage at which that day alone wipes out: 4.89

At leverage 2 that day cost 0.409 of equity, and at 3 it cost 0.614. With a 25% maintenance requirement an account at leverage 3 receives a margin call after a fall of 0.111, and at 4 after any fall at all. The day alone wipes out an account at leverage 4.89 or more. (A value of 1.000 in the table means that no fall can trigger a call or a wipe-out.) A table built from monthly drawdowns says nothing about a day like this; the leverage in it must leave room.

A drawdown warning rule

A practical way to approximate a regime-aware Kelly without a model is a warning rule: cut exposure while the account is in a drawdown, restore it on recovery. p16 compares that with a regime-filter alarm and with constant exposure, in the two-regime market.

Calculation

# Chapter 8. p16: A drawdown warning rule. In the two-regime market of
# p02 (ten years, started from its long-run mix, cash at 0.02), the
# base exposure is 0.20 of the whole-history Kelly 1.46. "Drawdown
# alarm" halves it while the drawdown from the peak exceeds 10%, until
# it is back under 5%. "Regime alarm" halves it while the Hamilton
# filter (p05) gives bear a chance above 0.5. Compared with constant
# 0.10 and 0.20 of Kelly. An alarm month in a bull regime counts as a
# false alarm. 5,000 paths, seed 98.
import random
from math import exp, pi, sqrt

R12 = sqrt(12)
REG = ((0.12 / 12, 0.13 / R12), (-0.25 / 12, 0.28 / R12))
STAY, RF, KELLY = (0.98, 0.92), 0.02 / 12, 1.46

def dens(x, m, sd):
    return exp(-0.5 * ((x - m) / sd) ** 2) / (sd * sqrt(2 * pi))

RULES = ("constant 0.10", "constant 0.20", "drawdown alarm",
         "regime alarm")

if __name__ == "__main__":
    rng = random.Random(98)
    res = {r: [[], [], 0, 0] for r in RULES}
    for _ in range(5000):
        s = 0 if rng.random() < 0.8 else 1
        p = 0.2
        st = {r: [1.0, 1.0, 0.0, False] for r in RULES}
        for _ in range(120):
            if rng.random() > STAY[s]:
                s = 1 - s
            x = rng.gauss(*REG[s])
            for r in RULES:
                v = st[r]
                k = 0.10 if r == "constant 0.10" else 0.20
                if r == "drawdown alarm":
                    d = 1 - v[0] / v[1]
                    v[3] = d > 0.10 or (v[3] and d > 0.05)
                elif r == "regime alarm":
                    v[3] = p > 0.5
                if v[3]:
                    k /= 2
                    res[r][2] += 1
                    res[r][3] += s == 0
                v[0] *= 1 + RF + k * KELLY * x
                v[1] = max(v[1], v[0])
                v[2] = max(v[2], 1 - v[0] / v[1])
            q = p * STAY[1] + (1 - p) * (1 - STAY[0])
            a, b = q * dens(x, *REG[1]), (1 - q) * dens(x, *REG[0])
            p = a / (a + b)
        for r in RULES:
            res[r][0].append(st[r][0])
            res[r][1].append(st[r][2])
    print("   rule            median W  P(MDD>20%)  alarm share  false")
    for r in RULES:
        w = sorted(res[r][0])
        n = res[r][2]
        print("   {:<14}  {:8.3f}  {:10.3f}  {:11.3f}  {:5.3f}".format(
            r, w[2500], sum(d > 0.2 for d in res[r][1]) / 5000,
            n / 600000, res[r][3] / n if n else 0.0))
#    rule            median W  P(MDD>20%)  alarm share  false
#    constant 0.10      1.318       0.007        0.000  0.000
#    constant 0.20      1.414       0.226        0.000  0.000
#    drawdown alarm     1.403       0.050        0.206  0.607
#    regime alarm       1.450       0.039        0.165  0.235

Constant 0.20 of Kelly breaks the 20% limit with chance 0.226; constant 0.10 with 0.007, but grows less (median 1.318 against 1.414). The drawdown alarm, halving exposure below a 10% drawdown, brings the chance down to 0.050 while keeping a median of 1.403; it is on in 0.206 of months, and 0.607 of those are bull months, so most of its alarms are false. The regime alarm does slightly better (0.039 and 1.450), but it uses the true model parameters, which no investor has. The drawdown alarm uses only the account’s own history.

Hypothesis · not established

The author’s interpretation (not yet tested): for retail accounts, a rule that halves leverage after a 10% drawdown reduces the frequency of drawdowns of 20% or more by more than half, at a cost in median ten-year return of less than one percentage point a year. What would show it wrong: in a backtest on long equity index histories of several countries with monthly rebalancing, the rule reduces the frequency of such drawdowns by less than half, or costs more than one point a year.

Summary

A ten-year drawdown limit of 20% allows roughly a third of wealth in an asset of volatility 0.16, whatever the believed Sharpe ratio. One day in 1987 shows why leverage must leave room beyond monthly arithmetic. A simple drawdown warning rule met the 20% limit in the regime market at almost no cost in median growth, though most of its alarms were false.

Fan, Y. (2026). Regime-Switching Fractional Kelly, Maximum-Drawdown Constraints and Lifecycle Leverage Allocation: Cyclical Drift Estimation Errors, Ruin-Bounded Bet Sizing and Human-Capital Amortization [体制转换分数凯利、最大回撤约束与生命周期杠杆配置] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.24090256 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).