5D Library › Implied Volatility Surfaces, Skew Premia and Quantitative Risk Control of Vertical Spreads · 中文
Chapter 8 Practice and a Pre-Registered Test
Note
The checklist and the test protocol in this chapter are for research and self-checking, not investment advice. The checklist cannot tell you whether to trade; it can only help you write your rules down before a trade and record honestly afterwards. The accounts, prices and trades in this book are fictional; any real trade can lose all the money committed to it.
Part 1 A four-step checklist
The discussion of Chapters 1 to 6 can be condensed into a checklist for use before opening a trade, while holding it and after closing it. The limits in it (for example “flag an implied-volatility percentile above 80 %”) are examples of personal rules a trader should write down in advance, not recommended values.
- The pricing environment. Where does today’s implied volatility sit within the past year? A debit spread buys options, which are dearer the higher implied volatility is (Chapters 1 and 2). How steep is the skew (25-delta risk reversal) relative to its own history? A steeper skew makes the leg sold dearer, but it may also reflect the market’s fear of a downward gap (Chapter 2).
- Events and size. Is any known event (earnings, a central-bank decision) scheduled within the planned holding period? Events can bring gaps and a collapse of implied volatility afterwards. Is the maximum loss (debit × contracts × multiplier) as a share of the account within the limit written down in advance? That limit should be far below any Kelly fraction computed from an unreliable win-rate estimate (Chapter 6).
- Exit rules while holding. Are the time stop (counted in trading days) and any state-dependent rule (for example, the underlying above the long strike after more than five trading days) written down in advance? When the time or the state arrives, is the rule carried out (Chapter 5)? Has an in-the-money spread near expiry been dealt with, to avoid assignment and pin risk (Chapter 3)?
- Review after exit. Record the return in units of maximum loss, the slippage of fills against mid prices, and whether the rules were followed. The review judges whether the rules were carried out, not the profit or loss of a single trade: Chapter 5 showed that single outcomes are almost pure noise.
The program below applies the checklist to three fictional trade plans (an account of 100,000; implied-volatility histories simulated by the program; TD counts trading days after entry).
Calculation
# The four-step checklist applied to three FICTIONAL bear put spread set-ups on a
# fictional account of 100,000. Implied-vol histories are simulated (seeded), not quotes.
# Limits are examples a trader would fix in writing beforehand, not recommendations.
# Days are TRADING days after entry (TD 9 = the close of the 9th trading day).
import math, random
LIMITS = dict(iv_pct=0.80, rr_z=-2.0, risk=0.01, stop_day=9)
def history(rng, level, days=252):
lv, out = math.log(level), []
for _ in range(days):
lv += 0.05 * (math.log(level) - lv) + 0.06 * rng.gauss(0, 1)
out.append(math.exp(lv))
return out
SETUPS = [ # name, IV now, typical IV, RR25 now, RR25 mean/sd, event in window,
# debit, contracts (x100), trading days held, spot rule says close
("A", 0.21, 0.22, -0.020, (-0.025, 0.006), None, 1.58, 6, 9, False),
("B", 0.38, 0.22, -0.055, (-0.025, 0.006), "earnings TD 4", 2.40, 10, 3, False),
("C", 0.22, 0.22, -0.030, (-0.025, 0.006), None, 1.62, 4, 6, True),
]
if __name__ == "__main__":
rng = random.Random(26)
rows = {k: [] for k in ("1 IV percentile", " skew RR25 (z)", "2 event in window",
" max loss / acct", "3 time / spot rule", "4 log + review")}
for name, iv, typ, rr, (m, s), ev, debit, n, held, spot_close in SETUPS:
h = history(rng, typ); pct = sum(x < iv for x in h) / len(h)
z = (rr - m) / s; risk = debit * 100 * n / 100000
flag = lambda bad: " FLAG" if bad else ""
rows["1 IV percentile"].append(f"{pct:.0%}" + flag(pct > LIMITS["iv_pct"]))
rows[" skew RR25 (z)"].append(f"{z:+.1f}" + flag(z < LIMITS["rr_z"]))
rows["2 event in window"].append(ev + " FLAG" if ev else "none")
rows[" max loss / acct"].append(f"{risk:.2%}" + flag(risk > LIMITS["risk"]))
opened = not any("FLAG" in rows[k][-1] for k in list(rows)[:4])
why = "spot" if spot_close and held < LIMITS["stop_day"] else "time"
rows["3 time / spot rule"].append(f"TD {held}: close ({why})" if opened
else "not opened")
rows["4 log + review"].append("R, slippage, rule" if opened else "log the skip")
print((f"{'step':20s}" + "".join(f"set-up {s[0]:16s}" for s in SETUPS)).rstrip())
for k, v in rows.items():
print(f"{k:20s}" + "".join(f"{x:23s}" for x in v).rstrip())
# step set-up A set-up B set-up C
# 1 IV percentile 43% 100% FLAG 66%
# skew RR25 (z) +0.8 -5.0 FLAG -0.8
# 2 event in window none earnings TD 4 FLAG none
# max loss / acct 0.95% 2.40% FLAG 0.65%
# 3 time / spot rule TD 9: close (time) not opened TD 6: close (spot)
# 4 log + review R, slippage, rule log the skip R, slippage, rulePlan A’s implied volatility sits at the 43rd percentile of the past year, its skew is normal, there is no event and its maximum loss is 0.95 % of the account, so it passes the first two steps; it is closed on trading day 9 under the time rule, and its return, slippage and rule-keeping are recorded. Plan B is flagged on all four checks: implied volatility at the year’s high, skew five standard deviations steeper than usual, earnings on trading day 4, and a maximum loss of 2.4 % of the account; by the rules it is not opened, but the skip is logged too, or the review would only ever see the trades that were made. Plan C passes the first two steps, and on trading day 6 the underlying enters the exit region of the Chapter 5 model, so it is closed early under the state rule.
Part 2 A pre-registered out-of-sample test
The question and a design choice
On a historical options dataset and time window fixed in advance, does a time stop that closes a bear put spread at the close of the ninth trading day after entry earn a higher average return (in units of maximum loss) than holding to expiry?
The author’s framework suggested two possibilities: an out-of-sample test on historical data, or an experiment with traders. This book chooses the former. “A seven-to-ten-day time stop” is a claim about the returns of a trading rule, which historical data can test directly without anyone risking real money; a training experiment with traders would test a different question (whether traders follow rules, the hypothesis of Chapter 6) and can come later. The author has confirmed that the time stop counts trading days: the primary comparison is fixed at trading day 9 (about two calendar weeks) before any data are seen; trading days 7, 8 and 10 are reported only as secondary outcomes, so that the best of four days is not picked after the fact.
Protocol
| Element | Specification |
|---|---|
| Data and window | End-of-day quotes obtained from a commercial options database by a third-party researcher unconnected with the author; the window is written into the registered protocol and locked (about 8.6 years, as the sample size requires); until the protocol is registered and the analysis code published, the third party gives no one the spread returns for that window |
| Underlyings and eligibility | 50 underlyings (equity indexes, index funds and large-cap stocks), listed in the registered protocol according to option volume and quoted spreads in the year before the window; underlyings taken over or delisted during the window contribute no further entries (open trades are completed by the rules) |
| Entry | Every four weeks (13 entry dates a year), each underlying is entered at the close: buy the put nearest the money, sell the put with strike nearest 95 % of spot, expiry nearest 30 calendar days; if no suitable strike or expiry exists, that underlying-date is recorded as missing |
| The two rules | A: with the entry date as trading day 0, close at the close of trading day 9 (counted on the exchange’s trading calendar, skipping weekends and holidays; 11 to 13 calendar days after entry when there is no holiday); B: hold to expiry, closing an in-the-money spread at the close of the last trading day before expiry and letting a worthless one lapse. Both rules are applied to the same entries, giving a paired comparison |
| Fill assumptions | Main analysis: sell at the bid, buy at the ask (conservative); sensitivity analysis: mid price plus or minus a quarter of the spread (Muravyev and Pearson 2020) |
| Randomisation and blinding | No random allocation is needed (every entry is evaluated under both rules); the analysis code labels the two columns “rule X / rule Y”, and the third party reveals which is which only after the results are locked |
| Primary outcome | The mean over trades of the paired difference , with = profit / debit (the debit being the maximum loss); 95 % confidence interval by a bootstrap that resamples whole entry dates; if neighbouring entry dates are serially correlated, a stationary bootstrap over the sequence of entry dates (Politis and Romano 1994) |
| Secondary outcomes | Maximum drawdown of an equal-risk portfolio; share of full losses (); closing on trading day 7, 8 or 10; difference in Sharpe ratios (Ledoit–Wolf test (Ledoit and Wolf 2008)); grouping by risk reversal at entry (the Chapter 2 hypothesis) and the state-dependent rule (the Chapter 5 hypothesis), all exploratory |
There is a single primary outcome, the mean paired difference in return per unit of maximum loss, for three reasons: it is defined for every trade, and the paired design removes differences due to entry timing; scaling by the maximum loss, which is known at entry, is itself a form of risk adjustment; and maximum drawdown is a single statistic of a whole path with almost no statistical power and depends on the sizing rule, as the Sharpe ratio of a portfolio depends on sizing and on how trades overlap, so both serve only as secondary outcomes.
Guarding against data snooping
The greatest danger in backtesting is to try rules repeatedly on the same data until a good-looking result appears. Bailey and co-authors showed that the more rules are tried, the more likely the best in-sample result is to disappoint, or worse, out of sample (Bailey et al. 2014); for multiple testing and selection bias there are the “reality check”, higher significance thresholds and the “deflated Sharpe ratio” (White 2000; Harvey et al. 2016; Bailey and López de Prado 2014); López de Prado discusses leakage and purging in backtests (López de Prado 2018). Volume 33 discussed the statistical principles behind these problems. The protocol guards against them as follows:
- a single rule fixed in advance (trading day 9) and a single primary outcome, with no parameter tuning;
- the data source, window, list of underlyings, entry and fill rules and analysis code are registered publicly before the third party obtains the data (Nosek et al. 2018), with a hash of the code registered alongside the protocol;
- all the code is run by the third party, and neither the author nor the third party looks at spread returns in the window before the results are locked;
- secondary and exploratory results are clearly labelled and cannot replace the primary conclusion.
Sample size
Calculation
# Sample size for the Chapter 8 pre-registered out-of-sample test. Unit: one trade (an
# underlying on an entry date). Primary outcome: the paired difference D = R(close at
# the close of TRADING day 9 after entry) - R(hold to expiry), R = profit / max loss.
# ASSUMED, not estimated from data: SD of D 1.1 (the model of p10 gives 1.05; 1.1 is a
# slightly conservative round value), intraclass correlation 0.15 between the 50
# underlyings that share an entry date, one entry every 4 weeks (13 a year, no overlap).
import math, random
from statistics import NormalDist
Z = NormalDist().inv_cdf
def dates_needed(sd, sesoi, m=50, icc=0.15, alpha=0.05, power=0.90):
n_eff = ((Z(1 - alpha / 2) + Z(power)) * sd / sesoi) ** 2 # independent trades
deff = 1 + (m - 1) * icc # design effect
return n_eff, deff, math.ceil(n_eff * deff / m)
def sim_power(dates, sd=1.1, sesoi=0.15, m=50, icc=0.15, reps=4000, seed=33):
rng = random.Random(seed); hits = 0
s_date = sd * math.sqrt(icc + (1 - icc) / m) # SD of a date's mean D
for _ in range(reps):
x = [rng.gauss(sesoi, s_date) for _ in range(dates)]
mu = sum(x) / dates; se = math.sqrt(sum((v - mu) ** 2 for v in x) / (dates - 1)
/ dates)
hits += mu - 1.96 * se > 0
return hits / reps
if __name__ == "__main__":
n_eff, deff, k = dates_needed(1.1, 0.15)
print(f"SESOI 0.15, SD 1.1: {n_eff:.0f} independent trades; design effect {deff:.2f}"
f" -> {k} entry dates")
print(f" x 50 underlyings = {50 * k:,} trades; at 13 dates a year ="
f" {k / 13:.1f} years")
lost = math.ceil(k / 0.85)
print(f" allowing 15 % of dates lost (missing quotes, no strike): plan {lost} dates"
f" = {lost / 13:.1f} years")
print(f" simulated power with {k} dates (4,000 studies, D at the SESOI):"
f" {sim_power(k):.3f}")
print("years of data (13 dates a year, 50 underlyings) SESOI 0.10 0.15 0.20")
for sd in (0.8, 1.1, 1.4):
ys = "".join(f"{dates_needed(sd, d)[2] / 0.85 / 13:7.1f}"
for d in (0.10, 0.15, 0.20))
print(f" SD of D = {sd:.1f}{'':34s}{ys}")
for icc in (0.05, 0.30):
print(f" ICC {icc:.2f} instead of 0.15 (SD 1.1, SESOI 0.15):"
f" {dates_needed(1.1, 0.15, icc=icc)[2] / 0.85 / 13:.1f} years")
# SESOI 0.15, SD 1.1: 565 independent trades; design effect 8.35 -> 95 entry dates
# x 50 underlyings = 4,750 trades; at 13 dates a year = 7.3 years
# allowing 15 % of dates lost (missing quotes, no strike): plan 112 dates = 8.6 years
# simulated power with 95 dates (4,000 studies, D at the SESOI): 0.894
# years of data (13 dates a year, 50 underlyings) SESOI 0.10 0.15 0.20
# SD of D = 0.8 10.2 4.5 2.6
# SD of D = 1.1 19.3 8.6 4.9
# SD of D = 1.4 31.1 13.8 7.8
# ICC 0.05 instead of 0.15 (SD 1.1, SESOI 0.15): 3.5 years
# ICC 0.30 instead of 0.15 (SD 1.1, SESOI 0.15): 16.1 yearsThe standard deviation of the paired difference is taken as 1.1: the Chapter 5 model (on the trading-day clock) gives 1.05, and 1.1 is a slightly conservative round value; it is an assumption, not an estimate from real data. The intraclass correlation among the 50 underlyings sharing an entry date is taken as 0.15, also an assumption. The smallest effect size of interest is 0.15 (15 % of the maximum loss per trade): only an improvement at least this large would justify changing a trading rule. With two-sided and 90 % power, the equivalent of 565 independent trades is needed; the design effect is 8.35, so 95 entry dates and 4,750 trades are required, about 7.3 years; allowing for about 15 % of entry dates lost to missing quotes or strikes, 112 entry dates are planned, about 8.6 years. A check with 4,000 simulations gives power of 0.894 with 95 entry dates, in line with the formula.
The sensitivity table shows how much the design rests on assumptions: with a standard deviation of 1.4 it would take 13.8 years; with an intraclass correlation of 0.30, 16.1 years; with a smallest effect of interest of 0.10, 19.3 years. In the Chapter 5 model the true difference between the two rules is only about 0.007, far below 0.15. In other words, this test can detect only large differences; if the true difference is as small as in the model, no realistic historical dataset can resolve it.
As shown in Chapter 6 of volume 33, “90 % power” means the probability of reaching some verdict that “the time stop is better” when the true effect equals the smallest effect of interest; in that case the strongest verdict, “better by at least 0.15”, appears only about 2.5 % of the time, and reaching the strongest verdict with good probability requires a true effect clearly larger than 0.15.
Decision rule
Calculation
# Decision rule fixed before the locked data window is opened. D = mean over trades of
# R(close at TRADING day 9) - R(hold to expiry), R = profit / max loss; 95 % CI from a
# block bootstrap that resamples whole entry dates. SESOI 0.15. Gates (checked first):
# more than 25 % of planned entry dates lost; more than 10 % of exits without a two-sided
# quote in the exit window; or the independent re-computation of expiry payoffs
# disagreeing with the data vendor on more than 1 % of trades -> NOT INTERPRETABLE.
SESOI = 0.15
def verdict(d, lo, hi, lost=0.10, no_quote=0.03, mismatch=0.002):
for x, lim, why in ((lost, 0.25, "entry dates lost"),
(no_quote, 0.10, "exits unquoted"),
(mismatch, 0.01, "payoff mismatches")):
if x > lim:
return f"D = {d:+.2f}: NOT INTERPRETABLE - {x:.0%} {why} (limit {lim:.0%})"
if lo >= SESOI: v = "the time stop beats holding by at least 0.15 R per trade"
elif lo > 0: v = "the time stop is better; size not shown to reach 0.15 R"
elif hi < 0: v = "holding to expiry is better than the time stop"
elif lo >= -SESOI and hi <= SESOI: v = "no difference worth acting on"
else: v = "unclear: the interval is too wide to decide"
return f"D = {d:+.2f} ({lo:+.2f} to {hi:+.2f}): {v}"
for case in ((0.32, 0.17, 0.47), (0.12, 0.02, 0.22), (0.03, -0.09, 0.15),
(-0.14, -0.27, -0.01), (0.06, -0.18, 0.30), (0.25, 0.10, 0.40, 0.31),
(0.20, 0.06, 0.34, 0.10, 0.14)):
print(verdict(*case))
print("secondary outcomes (max drawdown of an equal-risk portfolio, share of full")
print(" losses, closing on trading day 7, 8 or 10) are reported with intervals; they")
print(" never decide the verdict")
# D = +0.32 (+0.17 to +0.47): the time stop beats holding by at least 0.15 R per trade
# D = +0.12 (+0.02 to +0.22): the time stop is better; size not shown to reach 0.15 R
# D = +0.03 (-0.09 to +0.15): no difference worth acting on
# D = -0.14 (-0.27 to -0.01): holding to expiry is better than the time stop
# D = +0.06 (-0.18 to +0.30): unclear: the interval is too wide to decide
# D = +0.25: NOT INTERPRETABLE - 31% entry dates lost (limit 25%)
# D = +0.20: NOT INTERPRETABLE - 14% exits unquoted (limit 10%)
# secondary outcomes (max drawdown of an equal-risk portfolio, share of full
# losses, closing on trading day 7, 8 or 10) are reported with intervals; they
# never decide the verdictThe example results are invented. If any gate fails (more than 25 % of entry dates lost, more than 10 % of exits without a two-sided quote, or more than 1 % of trades where the third party’s independent recomputation of expiry payoffs disagrees with the data vendor), the report says “not interpretable” whatever the primary outcome shows. Only if the lower confidence limit is at least 0.15 does the report say “the time stop is better by at least 0.15”. If the interval contains 0 and lies within ±0.15, the report says “no difference worth changing the rule for”; a lower limit above 0 but below 0.15 gives “the time stop is better, size not established”, an upper limit below 0 gives “holding to expiry is better”, and anything else is “unclear”.
What this test cannot show
First, historical results do not guarantee future ones; market structure, trading costs and option liquidity all change. Second, it tests only the trading-day-9 rule; it cannot show that any day in “seven to ten” is “optimal”, still less establish the parameters of the Chapter 5 model. Third, it can detect only differences of about 0.15 or more; smaller true differences (about 0.007 in the model) are beyond it, and “no difference worth acting on” does not mean “no difference at all”. Fourth, the result depends on fill assumptions, so the sensitivity analysis must be reported alongside. Fifth, 50 underlyings and one time window cannot represent all markets and periods. Sixth, it tests neither the author’s ratchet nor any trader’s directional signal; entries are mechanical, with no stock selection or timing. Seventh, the author may have lived through the market history in the window, so these are not data that have strictly “never been seen”; a prospective replication on new data collected after registration would be stronger evidence.
Ethics and conflicts of interest
The test involves no human participants and needs no ethics-committee approval, but the protocol, the list of underlyings, the entry and fill rules and the analysis code must be registered publicly before the third party obtains the data. Use of the database follows the vendor’s licence terms. Whatever the outcome, the results, the code and (as far as the licence allows) summary data will be published.
Because the author may hold related positions (routine observation positions in US equity index funds such as SPY, or related derivatives) and provides related independent consulting services, he has a financial interest in the result. The test must therefore be run, using the pre-registered code, by independent analysts with no financial relationship with the author; the author takes no part in obtaining, cleaning or analysing the data and cannot amend the protocol after seeing results. The results will be published whether positive or negative.
Disclosure
The author uses the works of 5D Library, including this book, as the methodological basis of his community courses, the 5D Ascension Cards (Dimensional Shift Card Decks) and the Yafu AI knowledge base, and therefore has a commercial interest in the subject of this book. The book promotes no course, card deck or service; the Chapter 8 trial is designed to be run and analysed by researchers independent of the author’s business and does not recruit from the author’s community, students or customers; all the code and the study protocol are published openly for anyone to check. The author develops and maintains prior-analysis software tools and quantitative research scripts based on the symbolic system of the sexagenary (ganzhi) calendar, and provides related open-source research and independent consulting services; while writing this book he may have held routine observation positions in US equity index funds (such as SPY) or related derivatives. All models in this book are offered solely for mathematical and historical-statistical discussion and constitute no investment advice, trading signal or promise of divinatory prediction; nor does the book recommend any particular trade or asset. To limit the influence of these interests, the protocol and analysis code are registered publicly before the third party obtains the data, the test is run by independent analysts with no financial relationship with the author, and the results and code will be published whatever the outcome.
Chapter summary
The four-step checklist condenses the first six chapters into checks of the pricing environment and position size before entry, exit rules while holding, and a review after exit that judges rule-keeping rather than single outcomes. The pre-registered out-of-sample test compares closing on trading day 9 with holding to expiry on the same entries in a locked historical window, with a single primary outcome (the mean difference in return per unit of maximum loss), a smallest effect of interest of 0.15, about 112 entry dates or 8.6 years of data, execution by a third party, and a decision rule written as code; it will be published whatever the result. It can detect only large differences, and it cannot prove that any exit day is “optimal”.
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).