5D Library › 做市商伽马敞口、零日到期期权与波动率收割动力学 · English

第五章 买回尾部、离散时间对冲与净夏普比率

比其价值更贵的保护

第四章结束于一个期望为正、注码却很脆弱的策略。通常的补救是买回尾部:买入保护翼,把宽跨式变成铁鹰;或者持有少量远虚值期权,在崩盘时提供凸性回报。交易者常用按比例买入的 VIX 认购来实现后者。本书不模拟 VIX 期权本身——那需要一个波动率期限结构模型——而用远虚值的指数认沽来代表它们在崩盘日的回报,这正是它们在此处起作用的那部分性质。

为了比较公平,第十段程序对每一张期权——无论卖出还是买入——都按模型下的真实价值加上同样 25% 的加价定价。于是卖出赚取溢价,而每一张保护翼平均都比它的价值更贵。如果保护仍然有用,那是在被高估的情况下仍然有用。

推导

# Chapter 5. Buying the tail back. Same true model as p07-p09. Every option,
# sold or bought, is quoted at its true (Merton) value plus the same 25 %
# markup, so selling earns a premium and every protective wing costs more than
# it is worth on average. (With a 25 % markup the short strangle's premium is
# close to p07's 0.17 quote.) Compared on the same 200 simulated years: mean
# P&L, Sharpe, worst day, skew, and the growth-optimal leverage with its
# growth rate - the fair yardstick for a skewed bet, because a hedge that
# lowers the mean can still raise what can safely be levered.
import math
import random

T = 1 / 252
SIG, LAM, MJ, SJ = 0.15, 3.0, -0.03, 0.015
SD = SIG * math.sqrt(T)

def Phi(x):
    return 0.5 * (1.0 + math.erf(x / math.sqrt(2.0)))

MARKUP = 0.25

def bs_s(S, K, sig, call):
    sd = sig * math.sqrt(T)
    d1 = (math.log(S / K) + 0.5 * sd * sd) / sd
    d2 = d1 - sd
    return S * Phi(d1) - K * Phi(d2) if call else K * Phi(-d2) - S * Phi(-d1)

def merton(K, call):
    k = math.exp(MJ + 0.5 * SJ * SJ) - 1
    tot = 0.0
    for n in range(8):
        w = math.exp(-LAM * T) * (LAM * T) ** n / math.factorial(n)
        sig_n = math.sqrt(SIG * SIG + n * SJ * SJ / T)
        S_n = 100.0 * math.exp(n * (MJ + 0.5 * SJ * SJ) - LAM * k * T)
        tot += w * bs_s(S_n, K, sig_n, call)
    return tot

# z = distance in diffusive sd; qty > 0 bought
def leg(z, call, qty):
    K = 100.0 * math.exp(z * SD if call else -z * SD)
    return (K, call, qty, merton(K, call) * (1 + MARKUP))

STRUCTURES = {
    "naked strangle":            [leg(1.45, False, -1), leg(1.45, True, -1)],
    "condor, wings 3.0 sd":      [leg(1.45, False, -1), leg(1.45, True, -1),
                                  leg(3.0, False, 1), leg(3.0, True, 1)],
    "condor, wings 2.2 sd":      [leg(1.45, False, -1), leg(1.45, True, -1),
                                  leg(2.2, False, 1), leg(2.2, True, 1)],
    "strangle + 2 puts 4.5 sd":  [leg(1.45, False, -1), leg(1.45, True, -1),
                                  leg(4.5, False, 2)],
}

def pnl(struct, ST):
    tot = 0.0
    for K, call, q, px in struct:
        pay = max(ST - K, 0) if call else max(K - ST, 0)
        tot += q * (pay - px)
    return tot

def kelly(sample):
    best = (0.0, 0.0)
    for i in range(1, 1200):
        L = i * 0.05
        g, ok = 0.0, True
        for p in sample:
            y = 1 + L * p / 100
            if y <= 0:
                ok = False
                break
            g += math.log(y)
        if not ok:
            break
        g = g / len(sample) * 252
        if g > best[1]:
            best = (L, g)
    return best

if __name__ == "__main__":
    rng = random.Random(56010)
    P_JUMP = 1 - math.exp(-LAM * T)
    COMP = -LAM * (math.exp(MJ + 0.5 * SJ * SJ) - 1) * T
    days = []
    for _ in range(252 * 200):
        x = -0.5 * SIG * SIG * T + COMP + rng.gauss(0, SIG * math.sqrt(T))
        if rng.random() < P_JUMP:
            x += rng.gauss(MJ, SJ)
        days.append(100 * math.exp(x))
    print(
        "leg prices (true value x 1.25): put 1.45 sd {:.4f}, put 3.0 sd"
        " {:.4f},\nput 4.5 sd {:.5f}".format(
            STRUCTURES["naked strangle"][0][3],
            STRUCTURES["condor, wings 3.0 sd"][2][3],
            STRUCTURES["strangle + 2 puts 4.5 sd"][2][3],
        )
    )
    print("\nprem = net premium, mean = mean P&L, SR = Sharpe a year,")
    print("L* = Kelly fraction, growth = log growth at L*")
    print("{:<24} {:>6} {:>7} {:>5} {:>5} {:>6} {:>6} {:>6}".format(
        "structure", "prem", "mean", "SR", "skew", "worst", "L*", "growth"))
    for name, st in STRUCTURES.items():
        prem = -sum(q * px for _, _, q, px in st)
        p = [pnl(st, s) for s in days]
        m = sum(p) / len(p)
        sd = math.sqrt(sum((x - m) ** 2 for x in p) / (len(p) - 1))
        sk = sum((x - m) ** 3 for x in p) / len(p) / sd ** 3
        L, g = kelly(p[:252 * 60])
        print(
            "{:<24} {:6.4f} {:+7.4f} {:+5.2f} {:+5.2f} {:6.3f} {:6.2f}"
            " {:+6.3f}".format(
                name, prem, m, m / sd * math.sqrt(252), sk, min(p), L, g
            )
        )
    print(
        "\n(Kelly computed on the first 60 of the 200 years to keep the run"
    )
    print("short.)")
# leg prices (true value x 1.25): put 1.45 sd 0.0608, put 3.0 sd 0.0116,
# put 4.5 sd 0.00357
#
# prem = net premium, mean = mean P&L, SR = Sharpe a year,
# L* = Kelly fraction, growth = log growth at L*
# structure                  prem    mean    SR  skew  worst     L* growth
# naked strangle           0.1027 +0.0192 +0.94 -7.61 -6.689  12.70 +0.404
# condor, wings 3.0 sd     0.0906 +0.0171 +1.15 -3.95 -1.405  25.20 +0.620
# condor, wings 2.2 sd     0.0733 +0.0140 +1.31 -2.98 -0.648  40.30 +0.781
# strangle + 2 puts 4.5 sd 0.0956 +0.0182 +1.09 -5.04 -2.740  19.35 +0.516
#
# (Kelly computed on the first 60 of the 200 years to keep the run
# short.)

带保护的结构,均值都低于裸卖宽跨式(+0.0171、+0.0140、+0.0182 对 +0.0192):被高估的保险必然要花钱。但它们的夏普比率更高(+1.15、+1.31、+1.09 对 +0.94),最差的一天小得多(3.0 个标准差的铁鹰 −1.405,对裸卖的 −6.689),而且——决定性的一栏——在各自最优杠杆下的增长率更高:3.0 个标准差铁鹰 +0.620,2.2 个标准差铁鹰 +0.781,对裸卖宽跨式的 +0.404。

机制正是第四章找到的那个。裸卖宽跨式的安全规模被它最差的一天封顶。把最差的一天封住,同样的资本就能承载更多优势:最优杠杆从 12.70 升到 25.20 和 40.30。保护并没有提高每单位名义本金的收益;它提高的是能够承载的名义本金。

注

关于那一栏的两点提醒。 第一,更高的最优杠杆本身也是从样本估出来的,而第四章已经说明这类估计有多不稳定;一个以 40 倍名义本金运行铁鹰的账簿,赌的是保护翼恰好在样本所说的尾部位置。第二,铁鹰的最大亏损只在到期时、且只在保护翼确实买得到时才被封顶;在跳空中保护翼的价格无关紧要,但在缓慢下跌中,40 倍名义本金的保证金是要紧的。

离散时间的对冲

第四章的期权没有做 Delta 对冲;散户的宽跨式通常就是这样做的。一个卖出期权并对冲的做市商面临另一种成本:对冲只能在离散时点调整,而每次调整都要付价差。第十一段程序以公允的布莱克-斯科尔斯价格卖出一张 30 日平值认购,并在一个价格确实服从几何布朗运动的世界里对冲 NN 次,所以任何盈亏都是对冲误差。

推导

# Chapter 5. The cost of hedging in discrete time. A dealer sells one
# 30-trading-day at-the-money call at a Black-Scholes price with sigma = 0.20
# and hedges its delta N times over the option's life. The underlying really
# is geometric Brownian motion with sigma = 0.20, so the option is fairly
# priced and any P&L is hedging error. Each share traded costs a proportional
# fee c (one-way, as a fraction of price). 4,000 simulated paths per N, fixed
# seed. Compared with the approximation
#   sd(P&L) ~ sqrt(pi / 4) x vega x sigma / sqrt(N)   (Kamal and Derman).
import math
import random

S0, K, SIG, TT = 100.0, 100.0, 0.20, 30 / 252

def Phi(x):
    return 0.5 * (1.0 + math.erf(x / math.sqrt(2.0)))

def d1(S, T):
    return (math.log(S / K) + 0.5 * SIG * SIG * T) / (SIG * math.sqrt(T))

def call(S, T):
    a = d1(S, T)
    return S * Phi(a) - K * Phi(a - SIG * math.sqrt(T))

def run(N, c, rng, paths=4000):
    dt = TT / N
    res, costs = [], []
    for _ in range(paths):
        S = S0
        cash = call(S0, TT)
        h = Phi(d1(S0, TT))
        cash -= h * S
        cost = c * h * S
        for i in range(1, N):
            S *= math.exp(
                -0.5 * SIG * SIG * dt + SIG * math.sqrt(dt) * rng.gauss(0, 1)
            )
            h_new = Phi(d1(S, TT - i * dt))
            cash -= (h_new - h) * S
            cost += c * abs(h_new - h) * S
            h = h_new
        S *= math.exp(
            -0.5 * SIG * SIG * dt + SIG * math.sqrt(dt) * rng.gauss(0, 1)
        )
        res.append(cash + h * S - max(S - K, 0) - cost)
        costs.append(cost)
    m = sum(res) / paths
    sd = math.sqrt(sum((x - m) ** 2 for x in res) / (paths - 1))
    return m, sd, sum(costs) / paths

if __name__ == "__main__":
    rng = random.Random(56011)
    vega = (
        S0
        * math.sqrt(TT)
        * math.exp(-0.5 * d1(S0, TT) ** 2)
        / math.sqrt(2 * math.pi)
    )
    print(
        "option price {:.4f}; vega {:.3f} per unit of volatility".format(
            call(S0, TT), vega
        )
    )
    print("\nA. No trading costs")
    print("   rebalances N   sd of P&L   approximation   ratio")
    for N in (5, 10, 30, 120, 480):
        m, sd, _ = run(N, 0.0, rng)
        ap = math.sqrt(math.pi / 4) * vega * SIG / math.sqrt(N)
        print(
            "   {:>8}       {:7.4f}      {:7.4f}      {:5.2f}".format(
                N, sd, ap, sd / ap
            )
        )
    print("\nB. With a one-way cost of 2 basis points per share traded")
    print("   rebalances N   mean P&L   mean cost   sd of P&L   mean - 1 sd")
    for N in (5, 10, 30, 120, 480, 1920):
        m, sd, cst = run(N, 0.0002, rng)
        print(
            "   {:>8}      {:+8.4f}    {:7.4f}    {:7.4f}     {:+8.4f}"
            .format(N, m, cst, sd, m - sd)
        )
    print(
        "\nReading: halving the hedging error needs four times the"
        " rebalancing, while"
    )
    print(
        "the trading cost keeps rising with N; past some point more hedging"
        " buys"
    )
    print("less risk than it costs.")
# option price 2.7524; vega 13.757 per unit of volatility
#
# A. No trading costs
#    rebalances N   sd of P&L   approximation   ratio
#           5        1.0157       1.0904       0.93
#          10        0.7373       0.7711       0.96
#          30        0.4347       0.4452       0.98
#         120        0.2205       0.2226       0.99
#         480        0.1117       0.1113       1.00
#
# B. With a one-way cost of 2 basis points per share traded
#    rebalances N   mean P&L   mean cost   sd of P&L   mean - 1 sd
#           5       -0.0188     0.0224     1.0148      -1.0336
#          10       +0.0087     0.0289     0.7188      -0.7102
#          30       -0.0501     0.0447     0.4429      -0.4930
#         120       -0.0760     0.0798     0.2228      -0.2987
#         480       -0.1503     0.1503     0.1265      -0.2767
#        1920       -0.2889     0.2893     0.1180      -0.4069
#
# Reading: halving the hedging error needs four times the rebalancing, while
# the trading cost keeps rising with N; past some point more hedging buys
# less risk than it costs.

A 段证实了经典结果 (Boyle and Emanuel 1980; Kamal and Derman 1999):对冲误差的标准差按 1/N1/\sqrt N 下降,近似式 π/4νσ/N\sqrt{\pi/4}\,\nu\,\sigma/\sqrt N(ν\nu 为期权的 vega)在 N=5N = 5 时误差在 7% 以内(比值 0.93),到 N=480N = 480 时基本精确(比值 1.00)。误差减半需要四倍的交易次数。

B 段加入每股单边 2 个基点的成本。平均成本从 N=5N = 5 时的 0.0224 升到 N=480N = 480 时的 0.1503 和 N=1920N = 1920 时的 0.2893,大致按 N\sqrt N 增长,这正是 Leland 指出的标度 (Leland 1985)。若把「均值减一个标准差」当作粗糙的风险调整得分,所试六个频率中最好的是 N=480N = 480(−0.2767);到 N=1920N = 1920 得分恶化为 −0.4069,因为多出来的交易所花的钱超过了它们消除的风险——而成本本身依赖路径,也会增加方差(标准差不再下降,0.1180 对 0.1265)。

对一个 0DTE 卖方而言,同样的算术更严酷:一日期权只有几个小时而不是几周来分摊再平衡,而且它的伽马高度集中(第一章),所以每次再平衡的量更大。

净夏普比率

第十二段程序把剩下的成本放进去:每交易一张期权合约,每 100 名义本金支付固定金额(买卖价差的一半加佣金)。

推导

# Chapter 5. Net Sharpe after trading costs, and how precisely one year can
# measure it. Same model and the same four structures as p10 (every option at
# true value + 25 %). Each option contract traded costs a fixed amount per 100
# of underlying (half-spread plus commission), counted per contract: strangle
# 2, condor 4, strangle plus two puts 4. Sharpe standard error over one year
# of daily trades: iid-normal formula, and the version that allows for
# skewness g3 and kurtosis g4 of the per-trade P&L (Mertens):
#   Var(SR per trade) = (1 - g3 SR + (g4 - 1) / 4 x SR^2) / n
import math
import random

T = 1 / 252
SIG, LAM, MJ, SJ = 0.15, 3.0, -0.03, 0.015
SD = SIG * math.sqrt(T)
MARKUP = 0.25

def Phi(x):
    return 0.5 * (1.0 + math.erf(x / math.sqrt(2.0)))

def bs_s(S, K, sig, call):
    sd = sig * math.sqrt(T)
    d1 = (math.log(S / K) + 0.5 * sd * sd) / sd
    d2 = d1 - sd
    return S * Phi(d1) - K * Phi(d2) if call else K * Phi(-d2) - S * Phi(-d1)

def merton(K, call):
    k = math.exp(MJ + 0.5 * SJ * SJ) - 1
    tot = 0.0
    for n in range(8):
        w = math.exp(-LAM * T) * (LAM * T) ** n / math.factorial(n)
        sig_n = math.sqrt(SIG * SIG + n * SJ * SJ / T)
        S_n = 100.0 * math.exp(n * (MJ + 0.5 * SJ * SJ) - LAM * k * T)
        tot += w * bs_s(S_n, K, sig_n, call)
    return tot

def leg(z, call, qty):
    K = 100.0 * math.exp(z * SD if call else -z * SD)
    return (K, call, qty, merton(K, call) * (1 + MARKUP))

STRUCTURES = {
    "naked strangle":            [leg(1.45, False, -1), leg(1.45, True, -1)],
    "condor, wings 3.0 sd":      [leg(1.45, False, -1), leg(1.45, True, -1),
                                  leg(3.0, False, 1), leg(3.0, True, 1)],
    "condor, wings 2.2 sd":      [leg(1.45, False, -1), leg(1.45, True, -1),
                                  leg(2.2, False, 1), leg(2.2, True, 1)],
    "strangle + 2 puts 4.5 sd":  [leg(1.45, False, -1), leg(1.45, True, -1),
                                  leg(4.5, False, 2)],
}

def moments(p):
    n = len(p)
    m = sum(p) / n
    sd = math.sqrt(sum((x - m) ** 2 for x in p) / (n - 1))
    g3 = sum((x - m) ** 3 for x in p) / n / sd ** 3
    g4 = sum((x - m) ** 4 for x in p) / n / sd ** 4
    return m, sd, g3, g4

if __name__ == "__main__":
    rng = random.Random(56012)
    P_JUMP = 1 - math.exp(-LAM * T)
    COMP = -LAM * (math.exp(MJ + 0.5 * SJ * SJ) - 1) * T
    days = []
    for _ in range(252 * 200):
        x = -0.5 * SIG * SIG * T + COMP + rng.gauss(0, SIG * math.sqrt(T))
        if rng.random() < P_JUMP:
            x += rng.gauss(MJ, SJ)
        days.append(100 * math.exp(x))
    print("A. Annualised net Sharpe by cost per contract (points per 100 of")
    print("underlying). n = contracts, gross = gross mean, breakeven = cost")
    print("per contract at which the net mean is 0")
    print("   {:<24}{:>2} {:>8} {:>6} {:>6} {:>6} {:>6} {:>9}".format(
        "structure", "n", "gross", "0.000", "0.002", "0.005", "0.010",
        "breakeven"))
    gross = {}
    for name, st in STRUCTURES.items():
        p = []
        for S in days:
            tot = 0.0
            for K, call, q, px in st:
                tot += q * ((max(S - K, 0) if call else max(K - S, 0)) - px)
            p.append(tot)
        gross[name] = p
        m, sd, _, _ = moments(p)
        legs = sum(abs(q) for _, _, q, _ in st)
        row = ["{:+6.2f}".format((m - c * legs) / sd * math.sqrt(252))
               for c in (0.0, 0.002, 0.005, 0.010)]
        print("   {:<24}{:>2} {:+8.4f} {} {:9.4f}".format(
            name, legs, m, " ".join(row), m / legs))
    print(
        "\nB. How precisely ONE year (252 trades) measures the gross Sharpe"
    )
    print(
        "   structure                  true SR/yr   SE iid-normal   SE"
        " allowing"
    )
    print(
        "                                                           skew &"
        " kurtosis"
    )
    for name, p in gross.items():
        m, sd, g3, g4 = moments(p)
        sr = m / sd
        se_n = math.sqrt((1 + 0.5 * sr * sr) / 252) * math.sqrt(252)
        se_m = math.sqrt(
            (1 - g3 * sr + (g4 - 1) / 4 * sr * sr) / 252
        ) * math.sqrt(252)
        print("   {:<25}  {:+8.2f}       {:8.2f}          {:8.2f}".format(
            name, sr * math.sqrt(252), se_n, se_m))
# A. Annualised net Sharpe by cost per contract (points per 100 of
# underlying). n = contracts, gross = gross mean, breakeven = cost
# per contract at which the net mean is 0
#    structure                n    gross  0.000  0.002  0.005  0.010 breakeven
#    naked strangle           2  +0.0189  +0.93  +0.73  +0.44  -0.05    0.0095
#    condor, wings 3.0 sd     4  +0.0170  +1.15  +0.61  -0.20  -1.56    0.0042
#    condor, wings 2.2 sd     4  +0.0140  +1.31  +0.56  -0.57  -2.44    0.0035
#    strangle + 2 puts 4.5 sd 4  +0.0181  +1.08  +0.60  -0.12  -1.31    0.0045
#
# B. How precisely ONE year (252 trades) measures the gross Sharpe
#    structure                  true SR/yr   SE iid-normal   SE allowing
#                                                            skew & kurtosis
#    naked strangle                +0.93           1.00              1.23
#    condor, wings 3.0 sd          +1.15           1.00              1.14
#    condor, wings 2.2 sd          +1.31           1.00              1.12
#    strangle + 2 puts 4.5 sd      +1.08           1.00              1.18

A 段部分颠倒了先前的排序。无成本时,2.2 个标准差的铁鹰夏普比率最高(+1.31);每张合约成本 0.005 时它反而最低(−0.57),因为它为了收取很小的净权利金要交易四张合约。只交易两张合约的裸卖宽跨式坚持得最久:它的盈亏平衡成本为每张 0.0095,窄铁鹰只有 0.0035。改善毛夏普比率的保护可能摧毁净夏普比率,而发生这种情况的成本只是每张合约千分之几个点。

B 段是对 A 段数字的警告。在一年上测量,即使收益是正态的,年化夏普比率的标准误也约为 1.00 (Lo 2002);考虑这些盈亏分布的偏度与峰度后为 1.12 到 1.23 (Opdyke 2007)。本章的每一个夏普比率,在单独一年里都在零的大约一个标准误之内。一年的卖波动率记录无法区分夏普比率为 +1.31 的策略和毫无优势的策略。

小结

即使一致地按高于真实价值定价,尾部保护也会降低均值,但提高夏普比率,更重要的是提高最优规模下可达到的增长率,因为封住最差的一天能让资本承载更多优势;这份好处依赖的杠杆估计本身是脆弱的。离散对冲误差按 1/N1/\sqrt N 下降,交易成本大致按 N\sqrt N 上升,所以对冲做得越多,最终买到的风险减少会少于它的成本。计入交易成本后,毛夏普比率最好的结构可能有最差的净夏普比率,所需成本只是每张合约千分之几个点——而单独一年的数据测量其中任何一个夏普比率,标准误都约为一。

参考文献

Boyle, Phelim P., and David Emanuel. 1980. “Discretely Adjusted Option Hedges.” Journal of Financial Economics 8 (3): 259–82.
Kamal, Michael, and Emanuel Derman. 1999. “When You Cannot Hedge Continuously: The Corrections of Black–Scholes.” Risk 12 (1): 82–85.
Leland, Hayne E. 1985. “Option Pricing and Replication with Transactions Costs.” The Journal of Finance 40 (5): 1283–301. https://doi.org/10.1111/j.1540-6261.1985.tb02383.x.
Lo, Andrew W. 2002. “The Statistics of Sharpe Ratios.” Financial Analysts Journal 58 (4): 36–52. https://doi.org/10.2469/faj.v58.n4.2453.
Opdyke, J. D. 2007. “Comparing Sharpe Ratios: So Where Are the p-Values?” Journal of Asset Management 8 (5): 308–36.

Fan, Y. (2026). Dealer Gamma Exposure, Zero-Day Options and Volatility Harvesting Dynamics: Delta-Hedging Feedback Loops, Strike Pinning, Iron Condor Tail Ruin and Variance Swap Replication [做市商伽马敞口、零日到期期权与波动率收割动力学] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.24090160 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).