Communitygithub.com

austin-starks/Public-Portfolio-Challenge

NexusTradeのウォークフォワード・アウトオブサンプル検証を実行・読み取り、パブリックポートフォリオチャレンジの認定エンジンとして機能します。固定ポートフォリオの認定(backtest_only)や再最適化(sweep)、fold_count/anchored/validation/embargoパラメータの設定、ウォークフォワードスタディの完了監視、各フォールドのOOSリターン/Sortino/ドローダウンの読み取り、ベースコントロールに対するバリアントのカレンダー調整を行う際に使用します。NexusTrade MCPが接続された状態で呼び出します。

Public-Portfolio-Challenge とは?

このスキルは、NexusTrade上でウォークフォワード検証スタディを実行・監視・解釈するための包括的なガイドです。固定ポートフォリオの認定(inner_mode: backtest_only)から、スイープによる再最適化(inner_mode: optimize, certification: true)までをサポートし、特にPublic Portfolio Challengeの認定エンジンとして設計されています。主な機能には、5フォールドのアンカード検証(2022年〜現在まで)、フォールドカレンダーのプレビュー、完了までのポーリング監視、各フォールドのOOSメトリクス(リターン、Sortino、最大ドローダウン、分散度など)の検証が含まれます。また、バックテストとの再現性チェック、スプレッド形状のコンプライアンス、ベースコントロールとバリアントのカレンダー調整など、厳格な前提条件とチェックリストが要求されます。失敗モード(無音エラー、窓ずれ、バックテスト汚染、ゼロトレードなど)も明示的に列挙され、報告すべき内容が定義されています。対応プラットフォームはNexusTrade MCPのみで、CLIツールやjqによるペイロード解析を前提としています。

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

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

ウォークフォワード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 — 固定構成の認定ではスイープは拒否されます)。
  • 再最適化(FAIL時または構造変更時のみ): engine_kind: "sweep"、inner_mode: "optimize"、certification: true、gene_intents。GAは過学習を引き起こし、デプロイ認定では拒否されます — スイープが認定パスです。 スイープ再最適化を参照。
  • certification: trueはアクティビティフロア + percentChange ≥ 0 + sortino ≥ 0.5ポリシーを適用し、validation_percentを50にデフォルト設定します。

ライブブック認定前の事前確認

  1. get_portfolio — 戦略セット、conditionFieldAudit、エグジットラダーを取得します。
  2. LaunchAgentの削除。 LaunchAgent戦略は履歴的に実行できません — 一度発火して数千のcooldownSkipイベントをログに記録し、フォールドを汚染します。LaunchAgentを含まないクローン(リバランスとクローズルールのみ)を認定し、そのように報告します。
  3. スプレッド形状チェック ライブ構造に対して実施(オプション構造ルールを参照)。期日まで長い垂直スプレッドは重大な違反です → ブックは現状のままでは認定できません。直接再最適化に進みます。
  4. 凸性キャップの落とし穴: 複数の「常時」利確クローズが存在する場合(例:P/L ≥ 20% / 50% / 200%)、最も低いものが最初にバインドされ、すべての勝ちポジションを約+20%でキャップし、アウトライトコールの根拠を無効にします。フラグを立ててください — リターンがレットウィナーズランブックに劣る最も可能性の高い原因です。

スタディの監視

ターミナル状態(COMPLETE / ERROR / CANCELLED)になるまでlist_walk_forward_studies / get_walk_forward_study_results <study_id>をポーリングします。jqでパース — ペイロードは大きいため、ダンプしないでください。 既知の失敗モードを監視し、表面化させます(ごまかさない — それはバグプロトコルのトリガーです):

  • サイレントフェイル / ERROR — フォールド統計なし / validationAggregateが空。報告してください。判定を捏造しないでください。
  • 窓の誤り — フォールドカレンダーが2022-01-01から開始していない / ベア相場をスキップしている。
  • バックテスト汚染 — LaunchAgentがフォールド内で発火している(事前確認で削除されているべきでした)。
  • ゼロトレード / NaNフォールド — 上流のポジションマーキングの破損。どのフォールドかを報告し、NaNを平均しないでください。
  • スタディが推定コスト・時間を超えて本当にハングしている場合 → 停止、要約、人間を待つ(エンジンが別のタブで修理中かもしれません)。

必須のフォールドごとのチェック(これらが判定結果です)

  1. フォールドごとのOOSテーブル — 各フォールドについて:トレインウィンドウ、OOSウィンドウ、OOSリターン、OOS最大DD、OOS Sortino、中央値デプロイメント、個別原資産数、参加率。さらにvalidationAggregate。
  2. 独立した再バックテストスポットチェック — 全サイクル(2022-01-01→今日)、2022年ベア相場(2022-01-01→2023-01-01)、過去12ヶ月に対してbacktest_portfolio($25k)を実行。全サイクル実行に対してaudit_backtest_postureを実施。スタディのフォールドは、新規のスタンドアロンバックテストと一致する必要があります。ベースライン≠SPY(オプションブックの場合)— 実質的な原資産または等ウェイトユニバースのバイ&ホールドを使用し、その旨を記載します。
  3. 劣化 — フォールドごとのトレイン vs OOS。トレイン→OOSの大きな低下 = 過学習。たとえ全サイクルのバックテストが良好に見えても。
  4. ドローダウンの正直さ — フォールドごとのOOS最大DDとOOSリターンを並べて表示。リスクを先に提示します。このレバレッジでは、フォールドが大きなリターンと50~77%のドローダウンを両方記録する可能性があります。
  5. 分散度ゲート 固定$25kで実施(分散度監査)。
  6. 再現性 / フィールド監査 — conditionFieldAuditが意図したノブと一致。再実行時にcompare_backtests {tolerance_bps: 0}。表示名ではなく、フィールドで検証します。
  7. スプレッド形状コンプライアンス(オプション構造ルール) — 違反はハードリジェクト。

カレンダー調整(バリアント 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.

関連スキル