trader-backtest
Qué hace
Esta skill ejecuta una prueba histórica de una estrategia de trading usando el motor neural-trader, con validación walk-forward. Es para personas que investigan ideas de trading y quieren ver cómo habría funcionado una estrategia.
Cuándo usarla
- ✓Cuando quieres probar una estrategia de trading con datos de precios pasados.
- ✓Cuando quieres una revisión walk-forward de cómo se sostiene una estrategia en el tiempo.
- ✓Cuando un resultado debe firmarse antes de considerarlo para trading en vivo.
Link de la skill
https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-neural-trader/skills/trader-backtest/SKILL.mdCópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.
Cómo usar
La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.
Mensaje listo para pegar
Para Claude Code, Codex o Cursor: ejecútalo en la carpeta del proyecto y la skill queda instalada.
Descarga el SKILL.md y ponlo en la carpeta de skills de tu agente.
Ejemplo de qué pedirle a la IA
“Haz un backtest de mi estrategia de momentum sobre SPY de 2020 a 2024, con validación walk-forward.”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
La skill revisa o instala el paquete neural-trader, carga una estrategia guardada, ejecuta el backtest e informa las medidas de desempeño. Los resultados deben usar datos de mercado reales antes de firmarse para su promoción, y los resultados sintéticos no se firman.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de GitHub.
Run a historical backtest using the neural-trader Rust/NAPI engine, then Ed25519-sign the result so the paper→live promotion gate has cryptographic tamper evidence (ADR-126 Phase 4 + CWE-347 pattern).
Steps:
- Ensure neural-trader is available:
npm ls neural-trader 2>/dev/null || npm install --ignore-scripts neural-trader - Check for saved strategy config:
mcp__plugin_ruflo-core_ruflo__memory_retrieve({ key: "strategy-STRATEGY_NAME", namespace: "trading-strategies" })If not found, list available:mcp__plugin_ruflo-core_ruflo__memory_search({ query: "strategy", namespace: "trading-strategies", limit: 10 }) - Run backtest via neural-trader CLI:
For multi-indicator strategies:npx neural-trader --backtest --strategy <name> --symbol <TICKER> --period <range> --walk-forward --livenpx neural-trader --backtest --strategy multi-indicator --position-sizing kelly --symbol SPY --period 2020-2024
3b. Check the data source. Without --live the backtest runs on synthetic bars, and when the live fetch fails it silently falls back to them. Read dataSource for every symbol in the result. Only yahoo-finance is real data. If any symbol is synthetic or mixed, store the result with synthetic: true in the body, do NOT sign it for paper→live promotion, and tell the user why.
4. Capture performance metrics from output: total return, annualized return, Sharpe ratio, Sortino ratio, max drawdown, win rate, profit factor, number of trades.
5. Dedup prior backtests for the same (strategyId, paramsHash) before storing the fresh one (ADR-125 lifecycle / ADR-126 Phase 2 — keep-newest semantics):
- Search:
mcp__plugin_ruflo-core_ruflo__memory_search({ query: "backtest STRATEGY paramsHash:PARAMS_HASH", namespace: "trading-backtests", limit: 10 }) - For each hit whose key matches
backtest-STRATEGY-*AND whose storedparamsHashequals the current run's hash, delete it:mcp__plugin_ruflo-core_ruflo__memory_delete({ key: "OLD_KEY", namespace: "trading-backtests" }) - (Note: even without this proactive step, the
MemoryConsolidator.dedup('keep-newest')background pass introduced in@claude-flow/memory@3.0.0-alpha.18runs every 6h and will eventually converge. Doing it inline keepsmemory_searchresults deterministic immediately after a re-run.)
- Sign the artifact (ADR-126 Phase 4):
- Build the
SignedBacktestArtifactbody —{ strategyId, paramsHash, dataRange: {from,to}, metrics, runsHash, generatedAt }— whereparamsHash = sha256(canonical params JSON),runsHash = sha256(canonical runs array JSON), andgeneratedAt = new Date().toISOString(). - Resolve the witness signing key. The skill reads the key path in this order; the FIRST that resolves wins:
RUFLO_WITNESS_KEY_PATHenv var — points to a JSON file with{ "privateKey": "<hex>" }.verification/witness-key.json(the ADR-103 default path, if present).
- If the key resolves: call
signBacktestArtifact(body, privateKeyHex)fromplugins/ruflo-neural-trader/src/signed-artifact.mjs. The returned value is aSignedBacktestArtifactwithschema,witnessPublicKey: "ed25519:<hex>", andwitnessSignature: "<hex>"populated. - If NEITHER path resolves: log a loud warning —
"[WARN] ruflo-neural-trader: no witness signing key found (RUFLO_WITNESS_KEY_PATH unset, verification/witness-key.json missing) — storing backtest artifact in UNSIGNED degraded mode. paper→live promotion will be refused by trader-cloud-backtest until a signed artifact replaces this one."— and store the body unsigned. NEVER silently fall back.
- Build the
- Store the (possibly signed) artifact to the canonical
trading-backtestsnamespace:mcp__plugin_ruflo-core_ruflo__memory_store({ key: "backtest-STRATEGY-TIMESTAMP", value: JSON.stringify(signedArtifact), namespace: "trading-backtests" })The stored value containswitnessSignature+witnessPublicKeywhen signed; downstream consumers (trader-cloud-backtest) MUST callverifyBacktestArtifact(artifact, trustedPublicKey)before promoting any artifact to live. - If Sharpe > 1.5, store as successful pattern:
mcp__plugin_ruflo-core_ruflo__agentdb_pattern-store({ pattern: "profitable-STRATEGY_TYPE: PARAMS_AND_RESULTS", type: "trading-strategy", confidence: 0.8 })(the tool takespattern,type,confidence; adatafield is ignored) - Train SONA on the outcome (skip for synthetic runs): `mcp__plugin_ruflo-core_ru
Preguntas frecuentes
¿Un backtest garantiza resultados futuros?
No. Muestra cómo habría funcionado una estrategia con datos pasados, lo cual no promete rendimientos futuros.
¿Qué pasa si los datos son sintéticos?
La skill marca el resultado como sintético, no lo firma para promoción en vivo y explica por qué.
¿Ejecuta operaciones?
La descripción cubre pruebas con datos históricos, no la colocación de operaciones.
Detalles
Descripción original del autor
Run a historical backtest using npx neural-trader with Rust/NAPI engine (8-19x faster) and walk-forward validation; Ed25519-sign the result for paper→live tamper evidence (ADR-126 Phase 4)
repo: ruvnet/ruflo
Popularidad
- Estrellas en GitHub
- 81 mil
- Posición en el ranking
- #1667
- Licencia
- MIT
- Actualizada
- 2/11/2026
Comentarios
- …
Más skills de este repositorio
agent-adaptive-coordinator
81 milAyuda a tu agente a dividir y reequilibrar un grupo de agentes de IA cuando cambia la carga de trabajo, eligiendo una distribución que encaje con la tarea.
agent-agent
81 milEnseña a tu agente a convertir una meta grande en un plan ordenado de acciones, y a replanificar cuando cambien las condiciones.
agent-agentic-payments
81 milAyuda a tu agente a administrar mandatos de gasto para compras con IA, con topes de gasto, ventanas de tiempo, reglas por comercio y aprobaciones firmadas.
agent-analyze-code-quality
81 milAyuda a tu agente a revisar la calidad del código, encontrando malos olores, deuda técnica e ideas de refactorización sin cambiar los archivos.
Skills parecidas
gitcrawl
394 milPermite que tu agente busque en un archivo guardado de incidencias y pull requests de GitHub, agrupe duplicados y revise su estado actual en GitHub.
slacrawl
394 milPermite que tu agente busque y cuente mensajes en un archivo local de Slack, revise qué tan reciente es y lo actualice cuando haga falta.
goplaces
394 milAyuda a tu agente a buscar lugares, obtener sus detalles y reseñas, y resolver nombres de lugares usando Google Places, con salida JSON para scripts.