Communitygithub.com

Optimización de Re-Sweep y Procedencia

Reoptimiza una estrategia de NexusTrade con un SWEEP walk-forward y etiqueta la procedencia de los parámetros: la disciplina que evita implementar perillas heredadas. Úsalo cada vez que un cambio estructural (tamaño, profundidad de escalones, membresía del universo, familia DTE, agregar una señal de rango) fuerce un nuevo barrido, al crear gene_intents a partir de get_sweep_surface, al elegir sweep sobre GA para un certificado de despliegue, o al seleccionar el ganador robusto entre pliegues en lugar del argmax por pliegue. Invócalo con el MCP de NexusTrade conectado.

¿Qué es Optimización de Re-Sweep y Procedencia?

Esta habilidad impone una disciplina rigurosa de reoptimización y etiquetado de procedencia para estrategias NexusTrade. Garantiza que cualquier cambio estructural en una cartera (como modificar escalones de asequibilidad, profundidades de strike, añadir un nuevo activo, cambiar la familia de DTE o incorporar una señal de rango de datos alternativos) active un nuevo barrido walk-forward con motor "sweep" en lugar de heredar parámetros de una estructura diferente. El objetivo es evitar que un candidato de despliegue se certifique con perillas optimizadas para una configuración anterior, lo que invalidaría la optimalidad en la nueva estructura. La habilidad también exige etiquetar cada parámetro desplegado con su origen (barrido en este libro, heredado de otro estudio, o ajustado manualmente) y prioriza la selección del ganador mediante la métrica robusta entre pliegues (cross-fold-robust) en lugar del argmax por pliegue, que es ruidoso. Está diseñada para funcionar con el MCP de NexusTrade y soporta las plataformas de agentes de IA como Claude Code, Cursor y Codex, siguiendo fielmente la documentación SKILL.md proporcionada.

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

Preguntar en tu IA favorita

Abre un nuevo chat con esta habilidad de agente ya precargada.

Documentación

Reoptimización de Barrido y Procedencia

Las tres reglas metodológicas permanentes que existen porque un candidato de despliegue fue certificado una vez con perillas heredadas de un barrido en una estructura diferente y presentado como "óptimo".

Las tres reglas permanentes (vinculantes en todos los episodios futuros)

  1. Reoptimizar ante CUALQUIER cambio estructural — nunca heredar un genoma entre estructuras. Las perillas (TP, presupuesto total, tamaño por nombre, ventana de rango, puerta VIX, período de enfriamiento de entrada, corchete DTE) son dependientes de la estructura. Cada vez que la estructura cambie — escalones de asequibilidad, profundidades de strike, membresía del universo (p. ej., agregar un nombre), familia DTE, forma de entrada/salida, o agregar una señal de rango de datos alternativos — vuelva a ejecutar el walk-forward de engine_kind:"sweep" en el NUEVO libro antes de certificar. Una certificación de backtest_only con perillas heredadas solo confirma que el libro generaliza; no establece que las perillas sean buenas para esa estructura.
  2. Separar "explorar diseños" de "optimizar el diseño elegido". Evaluar diseños candidatos → elegir uno → luego barrer las perillas de ese diseño exacto → luego certificar con backtest_only. Si la evaluación elige el diseño X, la base del barrido debe ser X mismo, no sus vecinos. Nunca barrer las variantes de los perdedores mientras se deja el libro elegido ajustado manualmente.
  3. Etiquetar la procedencia de cada parámetro desplegado en el entregable — barrido-en-este-libro / heredado-de <id-de-estudio> / ajuste-manual. "Heredado" es ámbar, no verde, hasta que se vuelva a barrer en la estructura actual.

Palabras desencadenantes de autoverificación: "transferir las perillas", "reutilizar los parámetros del ganador", "misma configuración en la nueva escalera", "ya certificado, no es necesario volver a barrer", "solo aumentar la asignación". Cada una debe provocar: ¿cambió la estructura desde que se buscaron esas perillas? En caso afirmativo → volver a barrer antes de certificar.

Ejecutar el barrido

  1. get_sweep_surface en el libro elegido (o un clon limpio) PRIMERO para obtener los nombres reales de campos barribles. Volver a barrer desde una semilla LIMPIA — volver a barrer un libro ya barrido puede apilar/duplicar genes; auditar campos en busca de condiciones duplicadas.
  2. run_walk_forward_study con engine_kind:"sweep", inner_mode:"optimize", certification:true, mode:"validation", anclado, 5 pliegues (4 aceptable), 2022→hoy, oos_width_days:252. Ver walk-forward-oos para el bloque de parámetros completo. El GA sobreajusta y se rechaza para la certificación de despliegue — el barrido es la ruta certificada. preview_only:true primero para compilar genes + verificar costo.
  3. Cada barrido debe ser no trivial: ≥3 ejes de gene_intents × ≥3 valores cada uno (p. ej., BuyingPowerPct, TakeProfitPct, RollTriggerDte, profundidad de rango, banda delta, DTE). Un barrido de 1 eje o 2 valores no califica.

Mapeos exactos de campos de barrido (si se equivoca, el barrido no tiene sentido)

  • Take-profit = TakeProfitPct en el ámbito Action. Nunca barrerlo como ExitCondition/OptionPositionPercentChange.
  • Roll DTE = RollTriggerDte en el ámbito Action (hacer roll de CloseOption únicamente).
  • Disparadores de PnL de CloseOption: minPnlPercent:100 = +100% TP; maxPnlPercent:-50 = −50% stop; roll DTE = {type:"dte","maxDte":45}.

Seleccionar el ganador (robusto, no argmax)

Leer aggregate.crossFoldRobustSelection — metric:"minSortino", candidateKey, score, perFoldSortino: la celda de la cuadrícula con el Sortino de validación mínimo más alto entre pliegues. Compararla con selectedCandidateKey, aggregate.dominantCandidateKey y winnerStableAcrossFolds de cada pliegue. Desplegar la configuración robusta entre pliegues, nunca el argmax por pliegue — el ganador por pliegue es ruido de alta varianza.

Luego ejecutar todas las verificaciones de la etapa C del walk-forward-oos 1–7 en ese ganador antes de que pueda ser el finalista, y adjuntar las etiquetas de procedencia (regla 3).

Los indicadores personalizados NO se pueden barrer

El allowedIndicatorTypes del motor de barrido no incluye CustomIndicator, por lo que la exploración de formas de indicadores de datos alternativos es una cuadrícula de variantes construida manualmente (create_portfolio_variant: copia profunda de la base

  • parche JSON-Pointer, dry_run primero), cada una certificada con backtest_only y etiquetada como ajuste manual (ámbar). Las perillas clásicas (asignación / presupuesto / TP / SelectTop / DTE) siguen siendo barribles si un ganador justifica un nuevo barrido de perillas. Ver indicadores-de-datos-alternativos.

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.

Skills relacionados