Communitygithub.com

austin-starks/Public-Portfolio-Challenge

執行並監控 NexusTrade 的遞延樣本外(Walk-Forward OOS)認證研究——這是公開投資組合挑戰賽背後的認證引擎。用於認證固定投資組合(backtest_only)或重新最佳化(sweep)、設定折疊數/錨定/驗證/禁售期參數、監控遞延研究至完成、讀取逐折疊 OOS 報酬率/Sortino/最大回撤,或在變體折疊日曆需與基準控制組進行日曆對齊時使用。需在 NexusTrade MCP 連接狀態下呼叫。

Public-Portfolio-Challenge 是什麼?

這項技能是 NexusTrade 遞延樣本外(Walk-Forward OOS)認證引擎的專用工具,用於驗證 Public Portfolio Challenge 中的投資組合。它支援固定投資組合認證(backtest_only)與重新最佳化(sweep)兩種模式,並提供多種參數設定,包括折疊數、錨定模式、驗證模式與禁售期天數。使用者需先以預覽模式(preview_only: true)檢查折疊日曆,確保涵蓋 2022 年熊市及 2025 年 4 月拋售等關鍵時期,再正式執行研究。此技能要求嚴格執行逐折疊檢查,包括 OOS 報酬率、最大回撤、Sortino 比率、廣度稽核與再回測比對,並可處理日曆對齊、LaunchAgent 汙染、零交易或 NaN 折疊等常見失敗模式。支援平台為 NexusTrade MCP,透過 deferred tools(run_walk_forward_study、list_walk_forward_studies、get_walk_forward_study_results)進行互動。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/austin-starks/Public-Portfolio-Challenge/tree/HEAD/skills/walk-forward-oos

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

遞延樣本外 OOS 認證

具確定性的樣本外引擎。遞延、驗證模式、錨定、5 個折疊、 2022→至今 — OOS 折疊就是裁決,而非單一回測。

研究呼叫

mcp__nexustrade__run_walk_forward_study(工具為延遲載入 — 透過 ToolSearch 載入)。務必先以 preview_only: true 執行,以查看折疊日曆與成本,確認其涵蓋 2022→至今(必須同時包含 2022 年熊市 與 2025 年 4 月拋售 — 此書最深回撤為 2025 年 4 月事件,因此折疊必須涵蓋該段期間),然後再設為 false 並記錄 study_id。

{
  "portfolio_id": "<主體或乾淨的複本>",
  "global_start_date": "2022-01-01",
  "global_end_date":   "<今日>",
  "fold_count": 5,
  "walk_forward_mode": "anchored",
  "mode": "validation",              // 逐折疊獨立 OOS
  "oos_width_days": 252,
  "embargo_days": 14,
  "interval": "Day",
  "inner_mode": "backtest_only",     // 認證固定書 — 無逐折疊最佳化器
  "preview_only": true               // 設為 false 以實際執行
}
  • 認證固定書: inner_mode: "backtest_only"(engine_kind ga/default — sweep 會在固定配置認證中被拒絕)。
  • 重新最佳化(僅在失敗或結構變更時): engine_kind: "sweep"、 inner_mode: "optimize"、certification: true,加上 gene_intents。GA 會過度擬合,並在部署認證中被拒絕 — sweep 是經過認證的路徑。 請參閱 sweep-reoptimization。
  • certification: true 會套用活動下限 + percentChange ≥ 0 + sortino ≥ 0.5 原則,並將 validation_percent 預設為 50。

認證即時書前的預先檢查

  1. get_portfolio — 擷取策略集、conditionFieldAudit 與出場階梯。
  2. 移除 LaunchAgent。 LaunchAgent 策略無法在歷史上執行 — 它只會觸發一次,並記錄數千個 cooldownSkip 事件,污染折疊。請認證一個不含 LaunchAgent 的複本(僅包含再平衡與平倉規則),並說明你已這麼做。
  3. 檢查即時結構的價差形狀(請參閱 options-structure-rules)。長天期垂直價差為嚴重違規 → 該書無法照現狀認證;直接進行重新最佳化。
  4. 凸性上限陷阱: 如果存在多個「總是」的獲利了結(例如 P/L ≥ 20% / 50% / 200%),則最低者會優先綁定,並將每個贏家上限設為約 +20%,破壞了直接買權的邏輯。請標記此情況 — 這是報酬率落後於「讓贏家奔跑」書本的最可能原因。

監控研究

輪詢 list_walk_forward_studies / get_walk_forward_study_results <study_id> 直到終止狀態(COMPLETE / ERROR / CANCELLED)。使用 jq 解析 — 負載量很大,不要直接傾印。 注意已知的失敗模式並呈現出來(不要掩蓋 — 這會觸發 bug-protocol):

  • 無聲失敗 / ERROR — 無折疊統計資料 / 空的 validationAggregate。回報此情況;不要自行編造裁決。
  • 錯誤時間區間 — 折疊日曆不是從 2022-01-01 開始 / 略過了熊市。
  • 回測汙染 — LaunchAgent 在折疊中觸發(應已在預先檢查中移除)。
  • 零交易 / NaN 折疊 — 上游部位標記損壞;回報哪些折疊,永遠不要對 NaN 取平均。
  • 研究真的卡住超過估計成本/時間 → 停止、摘要、等待人類(引擎可能正在另一個分頁維修中)。

強制性逐折疊檢查(這些就是裁決)

  1. 逐折疊 OOS 表格 — 每個折疊:訓練區間、OOS 區間、OOS 報酬率、OOS 最大回撤、OOS Sortino、中位數部署、不同標的、參與率。加上 validationAggregate。
  2. 獨立重新回測抽檢 — 在完整週期(2022-01-01→今日)、2022 年熊市(2022-01-01→2023-01-01)以及最近 12 個月上,以 backtest_portfolio($25k)執行;對完整週期執行進行 audit_backtest_posture。研究折疊必須與新的獨立回測一致。對於選擇權書,基準 ≠ SPY — 應使用實質標的或等權重市場買進持有,並加以註明。
  3. 退化 — 逐折疊的訓練與 OOS 比較。大的訓練→OOS 崩潰 = 過度擬合,即使完整週期回測看起來很棒。
  4. 回撤誠實 — 每個折疊的 OOS 最大回撤與 OOS 報酬率並列;以風險為先。在此槓桿下,一個折疊可能創下巨大報酬率,同時也有 50–77% 的回撤。
  5. 廣度門檻 在固定 $25k 下(breadth-audit)。
  6. 可重現性 / 欄位稽核 — conditionFieldAudit 與預期旋鈕相符;在重新執行時使用 compare_backtests {tolerance_bps: 0}。按欄位驗證,永遠不要按顯示名稱。
  7. 價差形狀合規性(options-structure-rules)— 違規則強制拒絕。

日曆對齊(變體 vs 基準)

遞延引擎會將折疊日曆裁剪至指標/資料的覆蓋範圍,因此變體的研究可能無聲無息地得到與基準不同的折疊。務必使用與變體裁剪後日曆相同的 global_end_date 執行基準控制組,並逐折疊比較。在逐折疊 OOS 旁邊報告逐折疊訊號覆蓋率。變體只有在訊號存在時才勝出,這是一個發現,而非作弊 — 但請明確說明。

Individual skills in this repo

This repo contains 11 individual skills — each has its own dedicated page.

austin-starks/Public-Portfolio-Challenge

Build alternative-data custom indicators on NexusTrade (Reddit/WSB mentions, congressional disclosures, insider filings, news-flow) and wire them into a certified book as a rank/tilt/filter signal. Use when adding alt-data to a strategy, building a CustomIndicator via compute sessions, auditing lookahead safety or per-ticker coverage, or deciding whether a data series is dense enough to drive a rank. Covers the compute-session workflow, the sparse-series rule, and source recipes (see references/). Invoke with the NexusTrade MCP connected.

austin-starks/Public-Portfolio-Challenge

Measure a NexusTrade options book's TRUE participation at a fixed cold-start capital base, defeating the compounded-NAV breadth illusion. Use whenever a book's headline \"holds N/21 names\" needs validating, when a live book collapses to a single name (the OSCR trap), when checking whether a SelectTop / per-name-allocation / total-budget change degraded simultaneous participation, or when a certification needs a breadth gate. Uses audit_backtest_breadth at held-fixed $25k.

austin-starks/Public-Portfolio-Challenge

The \"loudly declare\" protocol for platform, engine, or data bugs during a NexusTrade certification campaign — bugs are a first-class deliverable, not something to route around. Use whenever a NexusTrade tool errors, hangs, or returns numbers that contradict the config; whenever you're tempted to write \"probably an engine quirk\"; or when a discovered bug invalidates prior backtests and results must be quarantined. Includes the bug hand-off doc template (see references/BUG_TEMPLATE.md).

austin-starks/Public-Portfolio-Challenge

The GATED deploy + cleanup flow for a NexusTrade live book — clone the finalist, preview a delta reconcile, stage UNAPPROVED orders, verify fills. Use ONLY after the human explicitly says \"deploy + clean up\" and names a finalist. Covers the clone-before-reconcile ordering, the single-tick reconcile expectation, stale-pending-order hygiene, the signal-freshness gate, and why you can never approve orders yourself. Nothing here runs during certification.

austin-starks/Public-Portfolio-Challenge

The mandatory pre-flight contract checks (Stage S0) that must pass before trusting NexusTrade's certification engine for any strategy work. Use at the start of a bakeoff or certification campaign to prove the walk-forward engine runs end-to-end, windows don't leak, fold winners persist, and the engine doesn't fabricate values for dead/not-yet-listed names. Each check has a STOP-and-report failure mode; these runs do NOT count toward any certification minimum.

austin-starks/Public-Portfolio-Challenge

The single-touch lockbox — a final anti-overfitting holdout run once, after design freeze, on a window held out from every fold, sweep, and search. Use when finalizing a bakeoff winner before deploy, setting up the A/B/C baselines as OOS bars, or running the S1.5 gate-coherence auto-relax. Covers why looking at the lockbox twice burns it, the lockbox pass conditions, and the three baselines. The lockbox is distinct from the walk-forward OOS folds.

austin-starks/Public-Portfolio-Challenge

The hard structural constraints for the Public Portfolio Challenge momentum-LEAP options book — the spread-shape rule, the take-profit convexity-cap footgun, the affordability ladder, and the known losers not to re-test. Use whenever building or auditing an options strategy structure, checking spread-shape compliance before a certification, choosing DTE/strike rungs, or deciding whether a proposed structure change is even allowed. A violation is an automatic certification FAIL.

austin-starks/Public-Portfolio-Challenge

Orchestrate an out-of-sample certification of a NexusTrade trading strategy or live book — the master discipline behind the Public Portfolio Challenge. Use whenever you must decide PASS/FAIL on whether a portfolio holds up out of sample before deploying real money, replaying the Episode 10 runbooks, or running a \"certify my book\" / \"prove it out of sample\" / \"re-certify the fix\" task with the NexusTrade MCP connected. Pulls in walk-forward-oos, breadth-audit, sweep-reoptimization, options-structure-rules, bug-protocol, and deploy-gate.

austin-starks/Public-Portfolio-Challenge

The single entry point that executes a Public Portfolio Challenge episode or addendum runbook end-to-end, delegating each stage to the functional skills. Use when asked to run/execute/replay Episode 10, its bakeoff, or its addendum with the NexusTrade MCP connected. Reads the target runbook, pins its real artifacts (IDs, the incumbent bar), sequences the stages, and stops at the gated deploy. It orchestrates; the functional skills do the work.

austin-starks/Public-Portfolio-Challenge

Run a multi-family strategy bakeoff — the SEARCH→CERTIFY funnel that screens many candidate mechanisms down to a certified deploy winner without letting the cheap search layer issue a verdict. Use when replaying the Episode 10 bakeoff, when exploring several distinct strategy families before certifying, when deciding whether \"no deployable winner\" is even a legal conclusion, or when building the per-family certification ledger. Enforces verdict-integrity: only certification can end a campaign.

austin-starks/Public-Portfolio-Challenge

Re-optimize a NexusTrade strategy with a walk-forward SWEEP and label parameter provenance — the discipline that prevents deploying inherited knobs. Use whenever a structural change (sizing, rung depth, universe membership, DTE family, adding a rank signal) forces a re-sweep, when authoring gene_intents from get_sweep_surface, when choosing sweep over GA for a deploy cert, or when selecting the cross-fold-robust winner instead of the per-fold argmax. Invoke with the NexusTrade MCP connected.

相關技能