5D Library › Implied Volatility Surfaces, Skew Premia and Quantitative Risk Control of Vertical Spreads · 中文
Chapter 5 The Time Stop as an Optimal Stopping Problem
Can “seven to ten days” be proved?
The author’s framework contains a trading rule: after opening a bear put spread, close it by force after seven to ten days; and it hopes to “prove” that this window is optimal. The author has confirmed that the days are trading days: the entry day is trading day 0, and “day 9” means the close of the ninth trading day after entry, about two calendar weeks (11 to 13 calendar days when there is no holiday). Throughout this chapter and Chapter 8, “day ” counts trading days. In general that cannot be done. “Optimal” is always relative to an objective and a set of assumptions: what the trader maximises (expected profit, some utility, return subject to a drawdown limit), how the underlying moves, how options are priced, and what closing costs. Change the assumptions and the optimal exit time changes. What can be done is to state the assumptions explicitly, write “when to close” as an optimal stopping problem, solve for the best rule under those assumptions, and then check under which parameters it falls near seven to ten days and under which it does not.
Optimal stopping and the Snell envelope
Let be the value obtained by closing at time (the market price less the cost of closing), and let be any exit time that does not look into the future (a stopping time). The problem is
In discrete time the answer comes from backward induction: at expiry , and at each earlier step
the larger of “close now” and “the expected value of carrying on”. is called the Snell envelope of (Snell 1952), and the optimal rule is to close at the first moment at which . In continuous time the problem becomes a free-boundary problem, for which the monograph of Peskir and Shiryaev gives a systematic theory (Peskir and Shiryaev 2006). Pricing an American option (Chapter 3) is one example of such a problem.
Results
The base case. Closing on trading day 1 has an expected profit of −0.032 (two bid–ask spreads paid, and the signal has had no time to pay off); the profit then rises, peaks on trading days 9 and 10 (both +0.136; the program picks day 10, and the two differ by less than 0.001), and declines slowly, to +0.125 on day 15 and the same +0.125 for holding to expiry. With these parameters the best fixed time stop falls within the seven-to-ten-day window. But the optimum is very flat: every trading day from 7 to 14 is within 0.01 of it, about 0.6 % of the maximum loss, and holding to expiry is only 0.011 worse.
A state-dependent rule does better. The optimal exit rule is not a date but a region: in the first few trading days, close under no circumstances (the signal is still alive); after that, close when the underlying is above the long strike of 100, where the spread is out of the money (on trading day 9, roughly from 102.0 to 106.1), and otherwise hold. The region drifts downwards with time, to 99.3–102.0 by trading day 18. The reason is the net Greeks of Chapter 4: above 100 the spread has positive net gamma and positive net vega, so with realised volatility below implied it loses the variance premium every day, and through its negative delta it also pays the equity premium; as the underlying falls towards 95 both terms turn favourable. Above about 106 to 107 the spread is nearly worthless and the cost of closing exceeds what is left, so it is held. This rule has an expected profit of +0.240, about 1.8 times the best fixed time stop (+0.136); only 20 % of paths are closed by the end of trading day 7, 26 % are held to expiry, and the average exit is trading day 13.5. The right panel of Figure 3 shows the region.
Change one parameter and the best day moves. Across the twelve scenarios the best fixed exit day ranges from trading day 1 to holding to expiry (trading day 21):
- With a slower signal ( trading days) the best is to hold to expiry; with a faster one (1.5 trading days) the best is day 6, with days 4 to 9 close to it; with a stronger signal () the best is again to hold, but days 10 to 21 are all close.
- With no equity premium (), or no variance premium (realised volatility equal to the implied 0.22), the best is to hold to expiry: once the signal fades there is no systematic loss from carrying on, and closing early merely pays costs.
- Doubling the equity premium (), enlarging the variance premium (realised volatility 0.15) or removing the skew (both legs at 0.22) brings the best day forward to trading day 6 or 7.
- Doubling bid–ask spreads makes early closing dearer, and the best becomes holding to expiry (+0.034, since a worthless spread pays no closing cost); with cash settlement (no cost at expiry) the best is also to hold.
- With no signal at all () every rule loses money in expectation, and the best choice is not to open the trade.
An independent check, and the noise in a single trade
The program below checks the base case with separately written Monte Carlo code (400,000 paths simulated one trading day at a time) and looks at how dispersed single-trade outcomes are; finally, without any paths, it integrates numerically over the lognormal distribution of the underlying on trading day 9 and at expiry to obtain the exact expectations of the two rules. is the return in units of the maximum loss (the debit).
Calculation
# Independent Monte Carlo check of the base case of p09 (same ILLUSTRATIVE parameters,
# same TRADING-day clock: 252 a year, 21 to expiry): simulate one step per trading
# day, close at the close of trading day 9 or hold to expiry, and look at the spread of
# single-trade outcomes; then compute the two expectations exactly by numerical
# integration. Returns on risk R = profit / debit (the debit is the max loss).
import math, random
def ncdf(x):
return 0.5 * (1.0 + math.erf(x / math.sqrt(2.0)))
def put(S, K, T, r, s):
if T <= 0:
return max(K - S, 0.0)
d1 = (math.log(S / K) + (r + 0.5 * s * s) * T) / (s * math.sqrt(T))
return K * math.exp(-r * T) * ncdf(-d1 + s * math.sqrt(T)) - S * ncdf(-d1)
a, tau, b, sP, v1, v2, c, ce, r = -1.0, 2.5, 0.06, 0.18, 0.22, 0.245, 0.06, 0.06, 0.03
Y, DAYS = 252, 21 # trading days a year; trading days to expiry
def spread(S, d): # d = trading days since entry
return put(S, 100, (DAYS - d) / Y, r, v1) - put(S, 95, (DAYS - d) / Y, r, v2)
def drift(t0, t1): # integral of mu(t) dt over trading days t0..t1, in years
e = tau * (math.exp(-t0 / tau) - math.exp(-t1 / tau))
return (r * (t1 - t0) + a * e + b * ((t1 - t0) - e)) / Y
if __name__ == "__main__":
rng = random.Random(38); n, stop_day = 400000, 9
debit = spread(100.0, 0) + c
step = [drift(d, d + 1) - 0.5 * sP * sP / Y for d in range(DAYS)]
vol = sP * math.sqrt(1 / Y)
rs, rh = [], []
for _ in range(n):
S = 100.0
for d in range(DAYS):
S *= math.exp(step[d] + vol * rng.gauss(0, 1))
if d + 1 == stop_day:
ps = math.exp(-r * stop_day / Y) * (spread(S, stop_day) - c) - debit
pay = spread(S, DAYS); pay -= ce if pay > 0 else 0 # worthless: let it lapse
ph = math.exp(-r * DAYS / Y) * pay - debit
rs.append(ps / debit); rh.append(ph / debit)
mean = lambda x: sum(x) / len(x)
def sd(x):
m = mean(x)
return math.sqrt(sum((y - m) ** 2 for y in x) / (len(x) - 1))
for lab, x in (("close on trading day 9", rs), ("hold to expiry", rh)):
q = sorted(x)
se = sd(x) * debit / math.sqrt(n)
print(f"{lab}: mean profit {mean(x) * debit:+.3f} (SE {se:.3f}),"
f" R mean {mean(x):+.3f}, SD of R {sd(x):.2f}")
print(f" P(loss) {sum(y < 0 for y in x) / n:.2f}, P(R <= -0.95)"
f" {sum(y <= -0.95 for y in x) / n:.2f}; R at 5th/50th/95th pct"
f" {q[n // 20]:+.2f} / {q[n // 2]:+.2f} / {q[19 * n // 20]:+.2f}")
dif = [x - y for x, y in zip(rs, rh)]
cov = mean([x * y for x, y in zip(rs, rh)]) - mean(rs) * mean(rh)
rho = cov / (sd(rs) * sd(rh))
print(f"paired D = R(TD 9) - R(hold): mean {mean(dif):+.3f}, SD {sd(dif):.2f},"
f" correlation of the two R {rho:.2f}")
# exact expectations by numerical integration over the lognormal spot (no paths)
def expect(day, f, k=4000):
m0 = math.log(100.0) + drift(0, day) - 0.5 * sP * sP * day / Y
s0 = sP * math.sqrt(day / Y); tot = wt = 0.0
for i in range(-k, k + 1):
z = 8.0 * i / k; w = math.exp(-0.5 * z * z)
tot += w * f(math.exp(m0 + s0 * z)); wt += w
return tot / wt
def at_expiry(S):
x = spread(S, DAYS)
return x - ce if x > 0 else 0.0
e9 = math.exp(-r * stop_day / Y) * expect(stop_day,
lambda S: spread(S, stop_day) - c)
eh = math.exp(-r * DAYS / Y) * expect(DAYS, at_expiry)
d_exact = (e9 - eh) / debit
print(f"exact (numerical integration): TD 9 {e9 - debit:+.3f},"
f" hold {eh - debit:+.3f}, mean D {d_exact:+.4f}")
z9 = (mean(rs) * debit - (e9 - debit)) / (sd(rs) * debit / math.sqrt(n))
zh = (mean(rh) * debit - (eh - debit)) / (sd(rh) * debit / math.sqrt(n))
print(f" MC minus exact, in standard errors: TD 9 {z9:+.1f}, hold {zh:+.1f}"
f" (same paths: correlated)")
k = (2.8 * sd(dif) / d_exact) ** 2
print(f"independent trades for 80 % power to detect the exact mean D"
f" (two-sided 5 %): {k:,.0f}")
print(f" = {k / 50:,.0f} years at 50 independent trades a year")
# close on trading day 9: mean profit +0.138 (SE 0.002), R mean +0.087, SD of R 0.65
# P(loss) 0.50, P(R <= -0.95) 0.01; R at 5th/50th/95th pct -0.84 / +0.01 / +1.28
# hold to expiry: mean profit +0.130 (SE 0.003), R mean +0.082, SD of R 1.28
# P(loss) 0.59, P(R <= -0.95) 0.48; R at 5th/50th/95th pct -1.00 / -0.75 / +2.12
# paired D = R(TD 9) - R(hold): mean +0.005, SD 1.05, correlation of the two R 0.58
# exact (numerical integration): TD 9 +0.136, hold +0.125, mean D +0.0067
# MC minus exact, in standard errors: TD 9 +1.4, hold +1.4 (same paths: correlated)
# independent trades for 80 % power to detect the exact mean D (two-sided 5 %): 192,009
# = 3,840 years at 50 independent trades a yearThe three methods agree: closing on trading day 9 earns +0.136 by numerical integration, +0.136 on the tree and +0.138 by Monte Carlo (standard error 0.002); holding to expiry earns +0.125, +0.125 and +0.130 (standard error 0.003). Both Monte Carlo deviations are about 1.4 standard errors and of the same sign, because the two rules share the same paths.
But single trades are extremely dispersed. Closing on trading day 9, has a standard deviation of 0.65 and half the trades lose; holding to expiry, the standard deviation is 1.28, nearly half the trades (48 %) lose almost the whole debit (), and about 5 % earn more than twice the debit. The difference between the two rules on the same path has an exact mean of only +0.0067 and a standard deviation of 1.05. Distinguishing that difference with 80 % power at the 5 % significance level would take about 190,000 independent trades, roughly 3,800 years at 50 trades a year. The point is important: personal trading experience cannot “prove” that any exit day is optimal; even if the model were exactly right, a few hundred trades would be almost pure noise. The test designed in Chapter 8 starts from here.
Hypothesis · not established
A price-dependent exit rule beats a plain time stop (not established). The author’s hypothesis is that in real option data a state-dependent rule such as “close once the trade is more than five trading days old and the underlying is above the long strike” earns a higher average return (in units of maximum loss) than a fixed time stop at seven to ten trading days. If, in the out-of-sample data locked in advance for Chapter 8, this rule’s average return is not higher than the time stop’s, or the confidence interval of the difference lies entirely within ±0.15, the hypothesis is wrong.
Chapter summary
“Seven to ten days is optimal” cannot be proved in general. Following the author’s confirmation, the book counts these days as trading days. Written as an optimal stopping problem, in the author’s model the best fixed exit day depends on how fast the signal decays, the equity premium, the variance premium, the skew and costs, and ranges from trading day 1 to holding to expiry across twelve scenarios; in the base case it is trading day 9 or 10, but days 7 to 14 are almost equally good and holding to expiry is only 0.011 worse, while a rule that depends on the price is clearly better. Even if the model is right, single trades are so noisy that a few hundred of them cannot distinguish one exit rule from another. “Seven to ten days” should be treated as a rule of thumb to be tested.
References
Fan, Y. (2026). Implied Volatility Surfaces, Skew Premia and Quantitative Risk Control of Vertical Spreads: Microstructure Pricing and Time-Stop Dynamics under Non-Gaussian Tails [期权隐含波动率曲面、偏度溢价与垂直价差结构的定量风控] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.23796765 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).