Chuyển đến nội dung
Skillpedia
Phân tích và bảng tính81k · #1667

trader-backtest

Skill này làm gì

Skill này chạy kiểm thử lịch sử một chiến lược giao dịch bằng công cụ neural-trader, với kiểm định walk-forward. Nó dành cho người nghiên cứu ý tưởng giao dịch và muốn xem chiến lược đã hoạt động thế nào trong quá khứ.

Khi nào nên dùng

  • ✓Khi bạn muốn kiểm thử một chiến lược giao dịch trên dữ liệu giá quá khứ.
  • ✓Khi bạn muốn kiểm tra walk-forward xem chiến lược bền vững đến đâu theo thời gian.
  • ✓Khi một kết quả cần được ký trước khi xem xét cho giao dịch thật.

Liên kết skill

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

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-neural-trader/skills/trader-backtest/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Hãy backtest chiến lược momentum của tôi trên SPY từ 2020 đến 2024 với kiểm định walk-forward.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Skill kiểm tra hoặc cài gói neural-trader, tải chiến lược đã lưu, chạy backtest và báo cáo các chỉ số hiệu suất. Kết quả phải dùng dữ liệu thị trường thật trước khi được ký để đưa vào sử dụng, và kết quả tổng hợp sẽ không được ký.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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
Câu hỏi thường gặp

Backtest có đảm bảo kết quả tương lai không?

Không. Nó cho thấy chiến lược đã hoạt động thế nào trên dữ liệu quá khứ, và điều đó không hứa hẹn lợi nhuận tương lai.

Nếu dữ liệu là tổng hợp thì sao?

Skill đánh dấu kết quả là tổng hợp, không ký để đưa vào giao dịch thật và giải thích lý do.

Nó có đặt lệnh giao dịch không?

Mô tả nói về kiểm thử trên dữ liệu lịch sử, không nói về việc đặt lệnh.

Chi tiết

Mô tả gốc của tác giả

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

Độ phổ biến

Sao GitHub
81k
Vị trí xếp hạng
#1667
Giấy phép
MIT
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự