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がスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
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:
- 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
よくある質問
バックテストは将来の結果を保証しますか?
いいえ。過去のデータで戦略がどう機能したかを示すもので、将来の利益を約束するものではありません。
データが合成の場合はどうなりますか?
スキルは結果を合成としてマークし、ライブ取引への昇格のための署名は行わず、その理由を説明します。
取引を行いますか?
説明は過去データでのテストを扱っており、取引の実行は含まれていません。
詳細
作者による元の説明
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
コメント
- …
このリポジトリの他のスキル
agent-adaptive-coordinator
81k作業量の変化に合わせて、エージェントのグループを分割し、再配分する手助けをします。作業に合った配置を選びます。
agent-agent
81k大きな目標を順番に並んだ行動計画にし、状況が変わったときに計画を立て直す方法をエージェントに教えます。
agent-agentic-payments
81kAIの買い物のために、支出の上限、期間、販売店のルール、署名付きの承認を含む支出の委任を管理する手助けをします。
agent-analyze-code-quality
81kコードの品質を確認し、コードの臭い、技術的負債、リファクタリングの案を見つける手助けをします。ファイルは変更しません。
似ているスキル
gitcrawl
394k保存されたGitHubのイシューとプルリクエストのアーカイブを検索し、重複をまとめ、GitHub上の現在の状態を確認するようエージェントを支援します。
slacrawl
394kローカルのSlackアーカイブ内のメッセージを検索して件数を数え、アーカイブの新しさを確認し、必要に応じて更新するようエージェントを支援します。
goplaces
394kGoogle Placesを使って、場所を検索し、詳細や口コミを取得し、場所の名前を解決するようエージェントを支援します。スクリプト用にJSON出力もできます。