
Trader Backtest
- 655 installs
- 67k repo stars
- Updated August 4, 2026
- ruvnet/ruflo
trader-backtest is a ruflo agent skill that runs neural-trader Rust/NAPI historical backtests with walk-forward validation and Ed25519-signed artifacts for developers who need tamper-evident strategy proof before live pr
About
trader-backtest is a ruvnet/ruflo skill with 562 skills.sh installs that runs historical backtests through the neural-trader Rust/NAPI engine, reported as 8–19× faster than pure JavaScript alternatives. It retrieves strategy configs from claude-flow trading-strategies memory, executes npx neural-trader --backtest with --walk-forward over a ticker and date range, and captures return, Sharpe, Sortino, drawdown, win rate, and trade counts. Results deduplicate prior runs by paramsHash in trading-backtests memory, then Ed25519-sign into SignedBacktestArtifact bodies per ADR-126 Phase 4 for paper-to-live promotion gates. Unsigned artifacts log warnings and block promotion until a witness key from RUFLO_WITNESS_KEY_PATH or verification/witness-key.json is available. Sharpe above 1.5 triggers agentdb_pattern-store and neural_train calls. Developers reach for trader-backtest when validating quantitative strategies inside ruflo before promoting configs to live trading.
- trader-backtest
Trader Backtest by the numbers
- 655 all-time installs (skills.sh)
- +6 installs in the week ending Aug 5, 2026 (Skillselion tracking)
- Ranked #566 of 4,347 Backend & APIs skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/ruvnet/ruflo --skill trader-backtestAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 655 |
|---|---|
| repo stars | ★ 67k |
| Last updated | August 4, 2026 |
| Repository | ruvnet/ruflo ↗ |
How do you backtest trading strategies with signed results?
Use trader-backtest for development tasks
Who is it for?
Quantitative developers on ruflo who prototype strategies with neural-trader and need cryptographically signed backtest artifacts before live promotion.
Skip if: Discretionary trading without coded strategies or teams not using claude-flow memory and neural-trader in the ruflo plugin stack.
When should I use this skill?
A named trading strategy needs historical backtesting, walk-forward validation, signed artifact storage, or paper-to-live promotion evidence.
What you get
SignedBacktestArtifact with metrics, paramsHash, witnessSignature, and trading-backtests memory record ready for paper-to-live verification.
- SignedBacktestArtifact JSON with witnessSignature
- Performance metrics report with walk-forward results
- trading-backtests namespace memory record
By the numbers
- 562 skills.sh installs for ruvnet/ruflo trader-backtest
- neural-trader Rust/NAPI engine reported 8–19× faster than JS alternatives
- Captures Sharpe, Sortino, max drawdown, win rate, and profit factor metrics
Files
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__claude-flow__memory_retrieve({ key: "strategy-STRATEGY_NAME", namespace: "trading-strategies" }) If not found, list available: mcp__claude-flow__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-forwardFor multi-indicator strategies:
npx neural-trader --backtest --strategy multi-indicator --position-sizing kelly --symbol SPY --period 2020-20244. 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__claude-flow__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__claude-flow__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.)
6. 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:
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)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.
7. Store the (possibly signed) artifact to the canonical trading-backtests namespace: mcp__claude-flow__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__claude-flow__agentdb_pattern-store({ pattern: "profitable-STRATEGY_TYPE", data: "PARAMS_AND_RESULTS" }) 9. Train SONA on the outcome: mcp__claude-flow__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 byRUFLO_WITNESS_KEY_PATH. Keep it OUT of the repo. For local development, generate one once withnode -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
trustedPublicKeytoverifyBacktestArtifact(...)— never trust thewitnessPublicKeyfield 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.
Related skills
How it compares
Use trader-backtest for signed neural-trader validation inside ruflo; use general data-science skills for non-trading time-series experiments.
FAQ
What engine does trader-backtest use for historical simulation?
trader-backtest runs npx neural-trader with a Rust/NAPI engine described as 8–19× faster than alternatives, supporting --backtest, --walk-forward, and multi-indicator strategies with optional Kelly position sizing.
Why does trader-backtest Ed25519-sign backtest artifacts?
trader-backtest signs SignedBacktestArtifact bodies per ADR-126 Phase 4 so paper-to-live promotion gates have cryptographic tamper evidence; unsigned runs warn and block promotion until a witness key is configured.
Where does trader-backtest store backtest results?
trader-backtest stores JSON artifacts via mcp__claude-flow__memory_store in the trading-backtests namespace, deduplicating prior entries matching the same strategyId and paramsHash before saving the newest signed run.