Communitygithub.com

austin-starks/Public-Portfolio-Challenge

使用滚动窗口SWEEP方法对NexusTrade策略进行重新优化,并标记参数来源——这是一套防止使用继承参数引发问题的纪律规范。当结构性变更(如规模调整、阶梯深度、标的范围、DTE系列、添加排名信号)迫使需要重新扫描时,在从get_sweep_surface生成gene_intents时,在部署证书中选择sweep而非GA时,或者选择跨折叠鲁棒胜出者而非单折叠argmax时,都需要使用本技能。该技能需配合NexusTrade MCP连接使用。

Public-Portfolio-Challenge 是什么?

这是一套针对NexusTrade策略的严格方法论规则,源自一次因使用不同结构扫描继承的参数而导致部署候选被错误认证的历史教训。技能定义了三条具约束力的规则:任何结构性变更后必须用滚动窗口SWEEP重新优化参数,不允许跨结构继承基因组;将设计方案探索与选定方案优化分离,扫描基础必须是被选中的设计本身;所有部署参数必须标注来源(来源于当前书籍扫描/继承自某研究ID/手动设定)。执行扫描时,要求先通过get_sweep_surface获取真实的可扫描字段名,使用clean种子运行walk_forward_study,引擎类型设为sweep,至少3个基因轴×3个值。选择胜出者时,必须读取crossFoldRobustSelection中的最小Sortino指标,部署跨折叠鲁棒配置,绝不能使用单折叠argmax(其方差过大)。此外,自定义指标不可通过sweep引擎扫描,需手动构建变体网格并单独验证。该技能适用于Claude Code、Coder、Codex等AI编程助手,在需要结构变更后重新扫描、生成基因意图、选择部署方案时提供规范的约束和流程指导。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/austin-starks/Public-Portfolio-Challenge/tree/HEAD/skills/sweep-reoptimization

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

扫描重新优化与来源追溯

三条常设方法论规则——其存在是因为曾有一次部署候选使用了来自不同结构扫描继承的参数,并被当作“最优”呈现。

三条常设规则(对所有未来episode具有约束力)

  1. 任何结构性变更都必须重新优化——绝不在不同结构间继承基因组。 参数(止盈、总预算、单标的大小、排名窗口、VIX门限、入场冷却期、DTE区间)是结构相关的。每当结构发生变化——平价能力阶梯、执行价深度、标的范围(例如新增一个标的)、DTE系列、入场/出场形态,或添加另类数据排名信号——必须在新账簿上重新运行engine_kind:"sweep"滚动窗口扫描,然后才能进行认证。仅对继承参数做backtest_only认证只能确认该账簿具有泛化能力,并不能证明这些参数对该结构是优的。
  2. 将“探索设计”与“优化选定设计”分开。 筛选候选设计 → 挑选一个 → 然后对该确切设计的参数进行扫描 → 然后进行backtest_only认证。如果筛选过程选中了设计X,则扫描基准必须是X本身,而不是它的邻居。绝不可扫描落选者的变体,却让选中的账簿保持手工调参状态。
  3. 在交付物中标注每个部署参数的来源 —— swept-on-this-book(基于本账簿扫描)/ inherited-from <study-id>(继承自某研究ID)/ hand-set(手动设定)。“继承”状态为黄色,而非绿色, 直到在当前结构上重新扫描为止。

自查触发词: “沿用参数”“复用胜出者的参数”“在新阶梯上使用相同配置”“已经认证,无需重新扫描”“只需提高配置比例”。遇到这些词必须触发思考:自这些参数被搜索以来,结构是否发生了变化?若已变化 → 认证前必须重新扫描。

执行扫描

  1. 首先在选定的账簿(或一份干净的克隆)上运行get_sweep_surface,以获取真实的可扫描字段名。从CLEAN种子重新扫描——对一个已扫描过的账簿重新扫描可能导致基因堆叠/重复;需进行字段审计以检查重复条件。
  2. 运行run_walk_forward_study,设置engine_kind:"sweep"、inner_mode:"optimize"、certification:true、mode:"validation",anchored,5折(4折可接受),时间范围2022→今天,oos_width_days:252。完整参数块见walk-forward-oos文档。GA过拟合,已被拒绝用于部署认证——扫描才是受认证的路径。 先以preview_only:true运行,以编译基因并进行成本检查。
  3. 每次扫描必须是非平凡的:至少3个gene_intents轴 × 每个轴至少3个值(例如BuyingPowerPct、TakeProfitPct、RollTriggerDte、排名深度、delta区间、DTE)。单轴或双值扫描不具备资格。

精确的扫描字段映射(搞错则扫描毫无意义)

  • 止盈 = Action范围内的TakeProfitPct。 绝不把它作为ExitCondition/OptionPositionPercentChange来扫描。
  • 滚动DTE = Action范围内的RollTriggerDte(仅滚动CloseOption)。
  • CloseOption盈亏触发:minPnlPercent:100 = +100%止盈;maxPnlPercent:-50 = −50%止损;DTE滚动 = {type:"dte","maxDte":45}。

选择胜出者(鲁棒,而非argmax)

读取aggregate.crossFoldRobustSelection —— metric:"minSortino"、candidateKey、score、perFoldSortino:取跨验证折中最小Sortino值最高的网格单元。 将其与每折的selectedCandidateKey、aggregate.dominantCandidateKey以及winnerStableAcrossFolds进行比较。部署跨折叠鲁棒配置,绝不使用单折叠argmax——单折叠胜出者是高方差噪声。

然后,在该胜出者被正式确定为最终候选之前,对它运行完整的walk-forward-oos Stage-C检查项1–7,并附上来源标签(规则3)。

自定义指标不可扫描

扫描引擎的allowedIndicatorTypes中不包含CustomIndicator,因此另类数据指标形态探索需通过手工构建变体网格完成(create_portfolio_variant:深拷贝基准 + JSON-Pointer补丁,先dry_run),每个变体单独进行backtest_only认证,并标记为手动设定(黄色)。经典参数(分配/预算/止盈/SelectTop/DTE)在胜出者需要重新扫描时仍可被扫描。详见alt-data-indicators文档。

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

Run and read a NexusTrade walk-forward out-of-sample study — the certification engine behind the Public Portfolio Challenge. Use when certifying a fixed portfolio (backtest_only) or re-optimizing one (sweep), when setting fold_count / anchored / validation / embargo params, when monitoring a run_walk_forward_study to completion, when reading per-fold OOS returns/Sortino/drawdown, or when a variant's fold calendar needs calendar-alignment against a base control. Invoke with the NexusTrade MCP connected.

相关技能