manifoldbt-backtester

Runs declarative strategy specs over OHLCV bars and produces backtest evaluation metrics.

2.8k|632|Updated Oct 19, 2025
One-click install
npx skills add https://github.com/tradermonty/claude-trading-skills --skill manifoldbt-backtester
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: manifoldbt-backtester
Source: https://github.com/tradermonty/claude-trading-skills/tree/main/skills/manifoldbt-backtester
Command: npx skills add https://github.com/tradermonty/claude-trading-skills --skill manifoldbt-backtester

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires manifoldbt, pandas, and includes scripts (resource) and references (resource) components.

What problem does it solve?

Measuring a trading rule against real price data is error-prone: fills get miscounted as trades, drawdown signs get flipped, and frictionless runs inflate results. This Skill executes a strategy spec over OHLCV bars with the manifoldbt engine and produces the eight validated metrics the backtest-expert evaluator scores.

Core Features & Use Cases

  • Declarative Strategy Specs: Define strategies in JSON using sma, ema, or rsi indicators with a single entry condition, optional stop-loss/take-profit, and fee/slippage modeling.
  • Round-Trip Pairing: Converts raw fill logs into completed round trips with net-of-fee returns, correctly handling scaling, sign flips, and per-symbol position tracking.
  • Evaluator Handoff: Emits the exact eight inputs (win rate, average win/loss, max drawdown, years tested, parameter count, and more) plus a ready-to-run command for the backtest-expert skill.
  • Use Case: A trader describes an RSI oversold rule, runs it against two years of BTCUSDT bars with realistic fees, and receives measured win rate and drawdown figures ready for quality scoring.

Quick Start

Ask the assistant to backtest your trading rule by writing a JSON strategy spec and running scripts/run_backtest.py against your OHLCV CSV or Parquet data file.

Frequently Asked Questions about manifoldbt-backtester

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I backtest a trading strategy with manifoldbt?

Write a JSON spec naming your indicators and one entry condition, then run scripts/run_backtest.py with the spec, an OHLCV data file, and a symbol. The script validates the spec, runs the engine, and prints the measured metrics plus a handoff command.

What indicators does the strategy spec support?

The spec supports sma, ema, and rsi indicators over the open, high, low, or close columns. Entry conditions use one comparison operator (>, <, >=, <=) against another indicator, a price column, or a numeric threshold.

Why does my backtest trade count look doubled?

The engine's raw trade count records fills, and a round trip requires two fills, so the raw count runs at roughly twice the real number. The round_trips module pairs fills into completed trips, which is the count the evaluator's sample-size dimension expects.

Can I backtest short selling or multi-asset strategies?

No. The skill is long-only and single-symbol by design, and it refuses multi-condition entries, shorting, and multi-asset universes. The underlying engine supports those shapes, but this skill covers only one-sentence hypotheses.

Why does the backtest refuse to produce a score?

The handoff stops when there are no completed round trips, when max drawdown is missing or non-finite, or when scratch trades exist. Each condition would let the evaluator produce a plausible but wrong score, so the bridge fails closed instead.