Lecture 9 · Five Pitfalls of the Futures Panel: Walking Chapter 3's Methodology Through a Complete Process¶
Chapter 3 · Hidden Mines in Data Conventions (Lecture 3, chapter finale) Learning objectives: through five real defects of the futures panel, drill the complete convention-audit process of "discover → localize → adjudicate → dispose"; understand the decision criteria for "campaign continues vs stops". Prerequisites: Lectures 7 and 8.
0. Introduction¶
The previous two lectures each dug into one mine. This lecture switches mode: put the futures panel's five mines on one table, and run each through the same process — symptoms, root cause, impact adjudication, disposition decision. The goal is not to memorize these five pitfalls (change vendors and the pitfalls change) but to drill the standard moves of convention auditing into muscle memory.
The five pitfalls at a glance:
| # | Pitfall | Type | Impact surface | Campaign decision |
|---|---|---|---|---|
| 1 | Double adjustment | Return construction error | Strategies held across rolls (carry wiped out) | Panel rebuilt (detailed in Lecture 7) |
| 2 | Night-session date stamp misalignment | Timestamp convention | Cross-source joins, calendar alignment | Returns recomputed by per-instrument row order, campaign continues |
| 3 | Roll gaps unhandled | Splice artifact | False signals for trend/breakout factors | Detection tool + factor-layer avoidance |
| 4 | $oi coverage erratum |
Metadata cognition error | Explanatory power of factors referencing open interest | Cognition corrected, annotation on record |
| 5 | End-of-panel overrun | Infrastructure boundary | Backtest crashes / silent truncation | Test window pulled back one trading day |
1. Pitfall Two: Night-Session Date Stamp Misalignment — A "Don't Fix the Data" Decision¶
Symptom: 180 "Sunday" rows mixed into a 918-day panel. By the calendar, futures night sessions belong to the next trading day, but the vendor stamps the data at persistence time by the night session's actual clock time at open — a night session opening Sunday 21:00 gets stamped with Sunday's date.
Root cause: not a data error, but a timestamp convention (the vendor uses clock time, research uses the trading calendar). The two conventions are each internally consistent; only mixing them errs.
Key adjudication: item-by-item checks found — - The return series is correct: each instrument's row order is correct; computing returns by differencing the row order works fine - The misalignment occurs only in cross-source joins: joining this panel's dates against another table stamped by the trading calendar (e.g., the open-interest table) misaligns dates by exactly one day
Disposition: don't fix the data (re-stamping dates risks introducing new errors); change the usage — returns are always computed by per-instrument row order; cross-source joins always run a date-alignment check first. The campaign continued with zero interruption.
This pitfall's teaching point is the audit's "impact adjudication" step: upon finding a convention mismatch, first ask which downstream computations are infected and which are naturally immune, then decide whether to fix the data or change the usage. Blindly rebuilding the panel could turn a harmless convention difference into a real error.
2. Pitfall Three: Roll Gaps — The Boundary Between Artifact and Signal¶
Symptom and root cause: at the dominant-continuous splice points, if adjustment is incomplete (or the raw spread is deliberately preserved), the roll day produces a price gap. This gap is a splice artifact, not market information — but trend and breakout factors don't distinguish the two: one fake gap = one fake breakout signal = one fake trade.
The layered disposition design: 1. Detection tool: a roll detector — a heuristic scan by open-interest single-day jump (|Δoi| ≥ 30%) or open gap (|gap| ≥ 3%), outputting each instrument's list of roll days 2. Factor-layer avoidance: factors involving breakout logic do not trigger within the roll-day window 3. What we don't do: "repair" the gap itself — trend research sometimes needs exactly the real spread information, and globally smoothing it is over-processing
Teaching point: the correct disposition for an artifact is "identify + isolate", not "exterminate". Over-executing data cleaning is as dangerous as under-executing; the dividing line is "which kind of research treats this feature as noise, and which kind as information".
3. Pitfall Four: The $oi Coverage Erratum — Cognition Errata Are More Common Than Data Errata¶
Symptom and root cause: research documents long recorded "the open-interest column $oi is missing for some instruments". A systematic check found: full coverage — the earlier "partially missing" was a misreading of one early sampling inspection, written into the documents as fact and propagated.
Damage mechanism: this false belief prematurely ruled out several research directions ("open-interest factors can't be done cross-sectionally across all instruments"), and also gave some factor results a wrong exculpatory explanation ("performance is poor because oi data is missing"). Wrong data can be recomputed and corrected; wrong beliefs about the data silently distort research choices — the latter never appears in any code.
Disposition: cognition correction + documented erratum trail; the wrongly excluded directions re-entered the opportunity list for evaluation.
Teaching point: the objects of audit are not just data, but also data dictionaries / coverage notes / oral consensus. Periodically script-test "the data properties the documents claim" (coverage, start/end dates, null rates); any mismatch between measured and claimed is an erratum candidate.
4. Pitfall Five: End-of-Panel Overrun — Infrastructure Boundaries Need Pre-Registration Discipline Too¶
Symptom: the qlib backtester reads calendar[i+1] at the final step (settlement needs the T+1 calendar). When the test window's end abuts the panel's last day, it overruns and crashes outright.
Adjudication: this is the tool's hard boundary, not a strategy problem. But its dangerous variant is the silent version: in some environments it doesn't crash but truncates the last segment — the backtest drops a few days, the numbers shift slightly, nobody notices.
Disposition: the convention is that the test window's end stays ≥1 trading day before the panel's last day (written into config defaults after field testing). Teaching point: infrastructure boundary conditions belong in the experiment specification, as explicit as statistical thresholds — "the legal value domain of the backtest window" should also be a section of the pre-registration document.
5. Wrap-Up: The Standard Process of Convention Auditing¶
With the five pitfalls walked through, extract the common process — Chapter 3's final deliverable:
① 症状 异常数字 / 崩溃 / 交叉对账不一致 / 文档与实测不符
② 根因 数据错误? 约定差异? artifact? 认知错误? 工具边界?
③ 影响面 哪些下游被感染、哪些免疫(差分 vs 水平、行序 vs 日期、
跨换月 vs 短周期……按第七讲"接触面"原则排优先级)
④ 裁定 修数据 / 改用法 / 隔离 artifact / 修正认知 / 只写规范
⑤ 处置 执行 + 勘误编号留痕 + 历史结论重述(不改历史文档,只限定效力范围)
⑥ 下游 受影响的预注册:功效重估、门槛复核、必要时撤回(第七讲)
And three meta-principles running through Chapter 3:
- Audit priority correlates positively, not negatively, with how "plausible" a result is (Lecture 7: being wrong about the good is costly)
- Fixing data is the last resort — convention mismatches change the usage, artifacts get isolated, cognition errors get corrected in documents (of Chapter 9's five pitfalls, only double adjustment actually triggered a panel rebuild)
- Errata must leave a trail and must not tamper with history — old documents get narrowed annotations, new conclusions get restated per corrected numbers, keeping history forever recomputable (this was the institutional precondition for D-9 to be corrected)
6. Chapter 3 Summary¶
- The five pitfalls cover five failure types: construction errors, convention mismatches, splice artifacts, cognition errors, tool boundaries
- The six-step audit process: symptoms → root cause → impact surface → adjudication → disposition → downstream
- The criterion for "campaign continues vs stops": the correctness of the core return series (after pitfall two's adjudication the campaign continued; pitfall one shook the return foundation, so the panel was rebuilt)
- Convention auditing is not an entry-level chore but a continuing obligation — four of the five pitfalls were discovered mid-campaign
Chapter 2 built an honest validation institution; Chapter 3 demonstrated that this institution's foundation (data and quantity definitions) itself requires an audit of the same grade. Chapter 4 turns to the final question: after all validation passes, what must a surviving strategy go through before going live — and why "going live" is still not the end.
Discussion question: Pitfall two's (timestamp convention) "don't fix the data, change the usage" decision depends on the discipline that "all downstream switched to computing by row order". If a researcher joining six months later doesn't know this convention and joins an external table by date — what mechanism can guarantee such "conventions" don't get lost with staff turnover? (Hint: compare the failure modes of "written in documents" versus "written into code".)