Communitygithub.com

austin-starks/Public-Portfolio-Challenge

Reotimiza uma estratégia NexusTrade com um SWEEP walk-forward e rotula a proveniência dos parâmetros — a disciplina que impede a implantação de knobs herdados.

O que é Public-Portfolio-Challenge?

Esta skill é um guia metodológico rigoroso para reotimizar estratégias de portfólio no NexusTrade usando o motor de sweep walk-forward, com foco em garantir que cada parâmetro implantado seja derivado da estrutura correta do livro de estratégia. Ela estabelece três regras permanentes: reotimizar em qualquer mudança estrutural (como alterações em rungs, profundidade de strikes, membresia do universo, família DTE ou adição de sinais de ranking), nunca herdar parâmetros de uma varredura anterior em estrutura diferente, e rotular a proveniência de cada parâmetro (varrido neste livro, herdado ou definido manualmente). A skill é essencial para desenvolvedores que trabalham com o ecossistema NexusTrade (suportado via MCP) e precisam certificar estratégias para implantação, evitando overfitting e garantindo robustez. Ela explica como executar o sweep corretamente, mapear campos como TakeProfitPct e RollTriggerDte, selecionar o vencedor usando o critério cross-fold robust (não argmax por fold), e indica que indicadores personalizados não são varridos, exigindo exploração manual via variantes. A skill desencadeia auto-verificações sempre que frases como "carregar os knobs" ou "reutilizar parâmetros do vencedor" são usadas.

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

Perguntar na sua IA favorita

Abre um novo chat com esta habilidade de agente já pré-carregada.

Documentação

Reotimização de Sweep & Proveniência

As três regras metodológicas permanentes que existem porque um candidato a implantação foi certificado em knobs herdados de uma varredura em uma estrutura diferente e apresentado como "ótimo".

As três regras permanentes (vinculativas para todos os episódios futuros)

  1. Reotimizar em QUALQUER mudança estrutural — nunca herdar um genoma entre estruturas. Knobs (TP, orçamento total, tamanho por nome, janela de ranking, gate VIX, cooldown de entrada, bracket DTE) são dependentes da estrutura. Sempre que a estrutura mudar — rungs de acessibilidade, profundidades de strike, membresia do universo (ex.: adicionar um nome), família DTE, forma de entrada/saída, ou adicionar um sinal de ranking de dados alternativos — reexecute a varredura walk-forward com engine_kind:"sweep" no NOVO livro antes de certificar. Uma certificação backtest_only em knobs herdados apenas confirma que o livro generaliza; ela não estabelece que os knobs são bons para aquela estrutura.
  2. Separar "explorar designs" de "otimizar o design escolhido". Analisar designs candidatos → escolher um → então varrer os knobs desse design exato → então certificar com backtest_only. Se a análise escolher o design X, a base da varredura deve ser o próprio X, não seus vizinhos. Nunca varrer as variantes dos perdedores enquanto deixa o livro escolhido ajustado manualmente.
  3. Rotular a proveniência de cada parâmetro implantado no entregável — varrido-neste-livro / herdado-de <id-do-estudo> / definido-manualmente. "Herdado" é amarelo, não verde, até ser revarrido na estrutura atual.

Palavras-gatilho de auto-verificação: "carregar os knobs", "reutilizar os parâmetros do vencedor", "mesma configuração na nova escada", "já certificado, não precisa re-varrer", "só aumentar a alocação". Cada uma deve provocar: a estrutura mudou desde que esses knobs foram pesquisados? Se sim → re-varrer antes de certificar.

Executando a varredura

  1. Execute get_sweep_surface no livro escolhido (ou um clone limpo) PRIMEIRO para obter os nomes reais dos campos varridos. Re-varrer a partir de uma semente LIMPA — re-varrer um livro já varrido pode empilhar/duplicar genes; audite o campo para condições duplicadas.
  2. Execute run_walk_forward_study com engine_kind:"sweep", inner_mode:"optimize", certification:true, mode:"validation", ancorado, 5 folds (4 aceitáveis), 2022→hoje, oos_width_days:252. Veja walk-forward-oos para o bloco completo de parâmetros. O GA sofre overfitting e é rejeitado para certificação de implantação — sweep é o caminho certificado. Use preview_only:true primeiro para compilar genes + verificar custos.
  3. Cada varredura deve ser não trivial: ≥3 eixos gene_intents × ≥3 valores cada (ex.: BuyingPowerPct, TakeProfitPct, RollTriggerDte, profundidade de ranking, banda delta, DTE). Uma varredura de 1 eixo ou 2 valores não se qualifica.

Mapeamentos exatos de campos de varredura (errá-los e a varredura se torna sem sentido)

  • Take-profit = TakeProfitPct no escopo Action. Nunca varra como ExitCondition/OptionPositionPercentChange.
  • Roll DTE = RollTriggerDte no escopo Action (rolar apenas o CloseOption).
  • Gatilhos de PnL do CloseOption: minPnlPercent:100 = +100% TP; maxPnlPercent:-50 = −50% stop; roll DTE = {type:"dte","maxDte":45}.

Selecionando o vencedor (robusto, não argmax)

Leia aggregate.crossFoldRobustSelection — metric:"minSortino", candidateKey, score, perFoldSortino: a célula da grade com o maior Sortino mínimo de validação entre os folds. Compare-a com selectedCandidateKey de cada fold, aggregate.dominantCandidateKey, e winnerStableAcrossFolds. Implante a configuração robusta entre folds, nunca o argmax por fold — o vencedor por fold é ruído de alta variância.

Em seguida, execute as verificações completas de Estágio C do walk-forward-oos 1–7 naquele vencedor antes que ele possa ser o finalista, e anexe rótulos de proveniência (regra 3).

Indicadores personalizados NÃO são varridos

O allowedIndicatorTypes do motor de sweep não inclui CustomIndicator, portanto a exploração da forma de indicadores de dados alternativos é uma grade de variantes construída manualmente (create_portfolio_variant: cópia profunda da base + patch JSON-Pointer, dry_run primeiro), cada uma certificada com backtest_only e rotulada como definida manualmente (amarelo). Os knobs clássicos (alloc / budget / TP / SelectTop / DTE) permanecem varridos se um vencedor justificar uma revarredura de knobs. Veja 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.

Habilidades Relacionadas