Skills Agentes

Trader Backtest

Ejecuta un backtest histórico con neural-trader (motor Rust/NAPI, 8-19x más rápido) y validación walk-forward; firma el resultado con Ed25519 como evidencia anti-manipulación.

Solicitabash read mcp__plugin_ruflo-core_ruflo__memory_store mcp__plugin_ruflo-core_ruflo__memory_retrieve mcp__plugin_ruflo-core_ruflo__memory_search mcp__plugin_ruflo-core_ruflo__memory_delete mcp__plugin_ruflo-core_ruflo__neural_train mcp__plugin_ruflo-core_ruflo__agentdb_pattern-store
Estrellas
69.4k

en todo el repo

Actividad
54

0–100, la ruta de este skill

Actualizado
el mes pasado

último commit aquí

Commits
1

últimos 90 días

Contexto
1.4k tok

48 tok en reposo

Paquete
1 archivo

5 KB

Instalar

Funciona con cualquier agente que lea SKILL.md

npx -y skills add ruvnet/ruflo --skill trader-backtest --agent claude-code

Se instala solo en este repositorio.

Qué hace

  • Ejecuta un backtest histórico vía neural-trader con validación walk-forward y captura métricas (retorno, Sharpe, Sortino, drawdown, win rate).
  • Elimina backtests previos duplicados (mismo strategyId + paramsHash) antes de guardar el nuevo.
  • Firma el artefacto con Ed25519 usando una clave witness; si no hay clave, avisa y lo guarda sin firmar.
  • Si el Sharpe supera 1.5, guarda el patrón como exitoso y entrena SONA con el resultado.

Úsalo cuando

  • Necesitas evaluar históricamente una estrategia de trading antes de llevarla a real.

No lo uses cuando

    Qué lo activa

    Di cualquiera de estas frases y el agente debería cargar este skill.

    • Haz un backtest de la estrategia multi-indicator en SPY de 2020 a 2024
    • Ejecuta un backtest walk-forward para mi estrategia

    SKILL.md

    En inglés

    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:

    1. Ensure neural-trader is available: npm ls neural-trader 2>/dev/null || npm install --ignore-scripts neural-trader
    2. 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 })
    3. Run backtest via neural-trader CLI:
      npx neural-trader --backtest --strategy <name> --symbol <TICKER> --period <range> --walk-forward
      
      For multi-indicator strategies:
      npx neural-trader --backtest --strategy multi-indicator --position-sizing kelly --symbol SPY --period 2020-2024
      
    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 stored paramsHash equals 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.18 runs every 6h and will eventually converge. Doing it inline keeps memory_search results deterministic immediately after a re-run.)
    6. Sign the artifact (ADR-126 Phase 4):
      • Build the SignedBacktestArtifact body — { strategyId, paramsHash, dataRange: {from,to}, metrics, runsHash, generatedAt } — where paramsHash = sha256(canonical params JSON), runsHash = sha256(canonical runs array JSON), and generatedAt = new Date().toISOString().
      • Resolve the witness signing key. The skill reads the key path in this order; the FIRST that resolves wins:
        1. RUFLO_WITNESS_KEY_PATH env var — points to a JSON file with { "privateKey": "<hex>" }.
        2. verification/witness-key.json (the ADR-103 default path, if present).
      • If the key resolves: call signBacktestArtifact(body, privateKeyHex) from plugins/ruflo-neural-trader/src/signed-artifact.mjs. The returned value is a SignedBacktestArtifact with schema, witnessPublicKey: "ed25519:<hex>", and witnessSignature: "<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.
    7. Store the (possibly signed) artifact to the canonical trading-backtests namespace: mcp__plugin_ruflo-core_ruflo__memory_store({ key: "backtest-STRATEGY-TIMESTAMP", value: JSON.stringify(signedArtifact), namespace: "trading-backtests" }) The stored value contains witnessSignature + witnessPublicKey when signed; downstream consumers (trader-cloud-backtest) MUST call verifyBacktestArtifact(artifact, trustedPublicKey) before promoting any artifact to live.
    8. If Sharpe > 1.5, store as successful pattern: mcp__plugin_ruflo-core_ruflo__agentdb_pattern-store({ pattern: "profitable-STRATEGY_TYPE", data: "PARAMS_AND_RESULTS" })
    9. Train SONA on the outcome: mcp__plugin_ruflo-core_ruflo__neural_train({ patternType: "trading-strategy", epochs: 10 })

    Key sourcing & key rotation (ADR-103)

    • The witness key is a 32-byte Ed25519 private key, stored as { "privateKey": "<64-hex-chars>" } in a JSON file referenced by RUFLO_WITNESS_KEY_PATH. Keep it OUT of the repo. For local development, generate one once with node -e "import('@noble/ed25519').then(async ed=>{const sk=crypto.getRandomValues(new Uint8Array(32));console.log(Buffer.from(sk).toString('hex'))})" and write it to ~/.ruflo/witness-key.json.
    • Production deployments pin the corresponding PUBLIC key in project config and supply it as trustedPublicKey to verifyBacktestArtifact(...) — never trust the witnessPublicKey field on the artifact itself (CWE-347 / #1922).
    • Key rotation: re-sign existing backtest entries with the new key OR explicitly mark pre-rotation artifacts as non-promotable. Same pattern as ADR-103.

    Reproducido de ruvnet/ruflo bajo licencia MIT. Leer esta página en markdown.

    Archivos

    1 archivo en el paquete. Solo se lee SKILL.md al activarse — las referencias se cargan si el skill decide que las necesita.

    Antes de instalar

    Necesita neural-trader instalado; para firmar el artefacto requiere una clave witness Ed25519 en RUFLO_WITNESS_KEY_PATH o verification/witness-key.json.

    Detalles

    Creador
    ruvnet
    Categoría
    Finanzas
    Licencia
    MIT
    Recursos incluidos
    Solo SKILL.md
    Repositorio
    ruvnet/ruflo
    Código fuente
    Ver SKILL.md

    Etiquetas

    Más de ruvnet/ruflo

    Este repo incluye 275 skills. Si instalas uno, normalmente ya tienes los demás.

    Inspecciona y audita genomas GEPA: carga y valida un genoma, renderiza el system prompt que compila, o clasifica los modos de fallo de una transcripción de ejecución.

    Costo de contexto al activarse
    833 tok
    Tamaño del paquete
    1 archivo
    Última actualización
    hace 4 días
    Permisos
    herramientas desarrollo

    Completion de un solo turno contra el modelo deepseek-chat de DeepSeek vía /v1/chat/completions. Lee DEEPSEEK_API_KEY y degrada con status:degraded si falta o la API no responde. Para tareas sin razonamiento.

    Costo de contexto al activarse
    566 tok
    Tamaño del paquete
    1 archivo
    Última actualización
    hace 4 días
    Permisos
    automatizacion

    Completion en modo razonamiento contra deepseek-reasoner (R1) de DeepSeek. Devuelve el chain-of-thought por separado de la respuesta final. Lee DEEPSEEK_API_KEY y degrada si falta o la API no responde.

    Costo de contexto al activarse
    627 tok
    Tamaño del paquete
    1 archivo
    Última actualización
    hace 4 días
    Permisos
    automatizacion

    Construye o reconstruye el índice de ADRs y su grafo de dependencias ejecutando scripts/import.mjs, en vez de cientos de llamadas MCP.

    Costo de contexto al activarse
    866 tok
    Tamaño del paquete
    1 archivo
    Última actualización
    hace 27 días
    herramientas desarrollo

    Crea un nuevo Architecture Decision Record con numeración secuencial y registro en AgentDB.

    Costo de contexto al activarse
    680 tok
    Tamaño del paquete
    1 archivo
    Última actualización
    hace 27 días
    herramientas desarrollo

    Muestra el estado de la integración AGNTCY/SLIM/CASA: si los paquetes están instalados, qué transporte está activo y si el enforcement de CASA está habilitado.

    Costo de contexto al activarse
    443 tok
    Tamaño del paquete
    1 archivo
    Última actualización
    hace 26 días
    devops infraestructura

    Skills relacionados

    Especialista en autorización de pagos multi-agente para comercio autónomo con IA: verificación criptográfica y consenso Byzantine entre agentes.

    Costo de contexto al activarse
    1.3k tok
    Tamaño del paquete
    1 archivo
    Última actualización
    hace 6 meses
    finanzas

    Especialista en gestión de créditos y facturación. Procesa pagos, gestiona sistemas de créditos, niveles de suscripción y operaciones financieras dentro de Flow Nexus.

    Costo de contexto al activarse
    959 tok
    Tamaño del paquete
    1 archivo
    Última actualización
    hace 6 meses
    finanzas

    Agente de trading financiero que usa algoritmos sublineales para predecir movimientos de mercado y calcular ventajas temporales frente a la transmisión de datos, con fines de arbitraje y HFT.

    Costo de contexto al activarse
    2.5k tok
    Tamaño del paquete
    1 archivo
    Última actualización
    hace 6 meses
    finanzas