본문으로 건너뛰기
Skillpedia
분석 및 스프레드시트81k · #1667

trader-backtest

하는 일

이 스킬은 neural-trader 엔진과 워크포워드 검증을 써서 트레이딩 전략의 과거 테스트를 실행합니다. 트레이딩 아이디어를 조사하면서 전략이 과거에 어떻게 성과를 냈을지 보고 싶은 사람을 위한 스킬입니다.

사용하는 경우

  • ✓과거 가격 데이터로 트레이딩 전략을 시험하고 싶을 때.
  • ✓전략이 시간이 지나며 버티는지 워크포워드 점검을 하고 싶을 때.
  • ✓실거래 검토에 앞서 결과에 서명해야 할 때.

스킬 링크

https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-neural-trader/skills/trader-backtest/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-neural-trader/skills/trader-backtest/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“SPY에 대해 2020년부터 2024년까지 모멘텀 전략을 워크포워드 검증으로 백테스트해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

스킬은 neural-trader 패키지가 있는지 확인하거나 설치하고, 저장된 전략을 불러와 백테스트를 실행한 뒤 성과 지표를 보고합니다. 결과는 실제 시장 데이터를 써야 실거래 승격용으로 서명되며, 합성 결과는 서명되지 않습니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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:

  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 --live
    
    For multi-indicator strategies:
    npx 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 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.)
  1. 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.
  2. 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.
  3. 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 takes pattern, type, confidence; a data field is ignored)
  4. Train SONA on the outcome (skip for synthetic runs): `mcp__plugin_ruflo-core_ru
자주 묻는 질문

백테스트가 미래 수익을 보장하나요?

아닙니다. 과거 데이터에서 전략이 어떻게 성과를 냈을지 보여 줄 뿐, 미래 수익을 약속하지 않습니다.

데이터가 합성이면 어떻게 되나요?

스킬은 결과를 합성으로 표시하고, 실거래 승격용으로 서명하지 않으며, 그 이유를 설명합니다.

거래를 실행하나요?

설명은 과거 데이터로 테스트하는 것을 다루며, 거래를 실행하는 것은 다루지 않습니다.

상세 정보

작성자의 원본 설명

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

인기도

GitHub 스타
81k
순위
#1667
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬