Communitygithub.com

스위프 재최적화 및 출처 추적

NexusTrade 전략을 워크포워드 SWEEP으로 재최적화하고 파라미터 출처(provenance)를 레이블링합니다. 구조적 변경(포지션 크기, 런지 깊이, 유니버스 구성원, DTE 계열, 랭크 신호 추가 등) 시 재스위프가 필요할 때, get_sweep_surface에서 gene_intents를 작성할 때, 배포 인증을 위해 GA 대신 스위프를 선택할 때, 또는 폴드별 argmax 대신 교차 폴드 강건 우승자를 선택할 때 사용합니다. NexusTrade MCP가 연결된 상태에서 호출합니다.

스위프 재최적화 및 출처 추적란 무엇인가요?

이 기술은 NexusTrade 전략의 파라미터를 구조적 변경 시 반드시 재최적화해야 한다는 원칙을 강제하는 규율입니다. 아무리 뛰어난 배포 후보라도 다른 구조에서 얻은 파라미터를 상속받아 '최적'이라고 인증하는 사례를 방지하기 위해 설계되었습니다. 주로 Cursor, Claude Code, Codex 등 AI 에이전트 플랫폼에서 NexusTrade MCP와 함께 사용됩니다. SKILL.md는 세 가지 핵심 규칙(구조 변경 시 재스위프, 설계 탐색과 최적화 분리, 모든 파라미터 출처 레이블링)과 구체적인 실행 방법을 제공합니다. 특히 get_sweep_surface로 실제 스위프 가능 필드를 확인한 후, engine_kind:"sweep" 모드로 워크포워드 스터디를 실행하며, GA보다 스위프가 배포 인증에 적합함을 강조합니다. 우승자는 폴드별 argmax가 아닌 교차 폴드 강건 선택(cross-fold robust selection)을 사용하며, 사용자 정의 지표(CustomIndicator)는 스위프가 불가능하므로 수동 변형 실험을 권장합니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/austin-starks/Public-Portfolio-Challenge/tree/HEAD/skills/sweep-reoptimization

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

스위프 재최적화 및 출처 추적(Provenance)

세 가지 상시 방법론 규칙은 배포 후보가 한때 다른 구조에 대한 스위프에서 상속받은 노브(knobs)로 인증되어 '최적'으로 제시되었던 사례 때문에 존재합니다.

세 가지 상시 규칙 (향후 모든 에피소드에 구속력 있음)

  1. 구조적 변경 시 반드시 재최적화하십시오 — 구조 간 유전체(genome)를 절대 상속하지 마십시오. 노브(TP, 총 예산, 종목별 크기, 랭크 윈도우, VIX 게이트, 진입 쿨다운, DTE 브래킷)는 구조에 종속적입니다. 구조가 변경될 때마다 — 구매 가능성 런지, 행사가 깊이, 유니버스 구성원(예: 종목 추가), DTE 계열, 진입/청산 형태, 또는 대체 데이터 랭크 신호 추가 — 인증 전에 새 북(book)에 대해 engine_kind:"sweep" 워크포워드를 다시 실행하십시오. 상속된 노브에 대한 backtest_only 인증은 북이 일반화된다는 것만 확인할 뿐입니다. 해당 노브가 그 구조에 적합하다는 것을 입증하지 않습니다.
  2. '설계 탐색'과 '선택된 설계 최적화'를 분리하십시오. 후보 설계 스크리닝 → 하나 선택 → 그 정확한 설계의 노브를 스위프 → 그런 다음 backtest_only로 인증하십시오. 스크린이 설계 X를 선택했다면, 스위프 베이스는 X 자체여야 하며, 그 이웃이 아니어야 합니다. 선택된 북을 수동 튜닝으로 남겨두고 패자 변형을 스위프하지 마십시오.
  3. 배포되는 모든 파라미터의 출처를 산출물에 레이블링하십시오 — swept-on-this-book / inherited-from <study-id> / hand-set. '상속됨'은 녹색이 아닌 황색(amber)이며, 현재 구조에서 재스위프될 때까지 황색입니다.

자가 점검 트리거 단어: "노브를 그대로 가져와", "우승자 파라미터 재사용", "새 사다리에 동일 설정", "이미 인증됨, 재스위프 불필요", "그냥 할당만 올려". 각각 다음 질문을 유발해야 합니다: 해당 노브가 검색된 이후 구조가 변경되었는가? 그렇다면 인증 전에 재스위프하십시오.

스위프 실행

  1. 선택된 북(또는 깨끗한 클론)에서 get_sweep_surface를 먼저 실행하여 실제 스위프 가능 필드 이름을 얻으십시오. 깨끗한 시드(seed)에서 재스위프하십시오 — 이미 스위프된 북을 재스위프하면 유전자가 중첩/복제될 수 있습니다. 중복 조건에 대해 필드 감사를 수행하십시오.
  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, 랭크 깊이, 델타 밴드, DTE). 1축 또는 2값 스위프는 적격하지 않습니다.

정확한 스위프 필드 매핑 (이것을 틀리면 스위프가 무의미해집니다)

  • 이익실현 = Action 범위의 TakeProfitPct. 절대 ExitCondition/OptionPositionPercentChange로 스위프하지 마십시오.
  • 롤 DTE = Action 범위의 RollTriggerDte (CloseOption만 롤).
  • CloseOption 손익 트리거: minPnlPercent:100 = +100% TP; 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 스테이지-C 검사 1~7을 실행한 후 최종 후보가 될 수 있으며, 출처 레이블(규칙 3)을 첨부하십시오.

사용자 정의 지표는 스위프 불가

스위프 엔진의 allowedIndicatorTypes에는 CustomIndicator가 포함되지 않으므로, 대체 데이터 지표 형태 탐색은 수동으로 구축된 변형 그리드(create_portfolio_variant: 깊은 복사 베이스 + JSON-Pointer 패치, 먼저 dry_run)를 통해 수행하며, 각각 backtest_only로 인증되고 **hand-set (황색)**으로 레이블링됩니다. 클래식 노브(할당/예산/TP/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.

관련 스킬