# Manifoldbt Backtester

Runs a declarative strategy spec over OHLCV bars with the manifoldbt Rust engine, pairs...

- Repository: https://github.com/tradermonty/claude-trading-skills (3536 stars)
- Category: Engineering
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add tradermonty/claude-trading-skills --skill manifoldbt-backtester -g -a claude-code -y`
Codex: `npx skills add tradermonty/claude-trading-skills --skill manifoldbt-backtester -g -a codex -y`
Cursor: `npx skills add tradermonty/claude-trading-skills --skill manifoldbt-backtester -g -a cursor -y`
Gemini CLI: `npx skills add tradermonty/claude-trading-skills --skill manifoldbt-backtester -g -a gemini-cli -y`

## Description

Runs a declarative strategy spec over OHLCV bars with the manifoldbt Rust engine, pairs the fill log into round trips, and emits the eight inputs the backtest-expert skill scores. Use when the user wants to execute a backtest, measure a rule they have described, obtain win rate / average win / average loss / max drawdown from real bars, or feed backtest-expert with measured numbers instead of estimates.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# manifoldbt Backtester Skill

## Purpose

Execute what `backtest-expert` teaches. That skill grades a backtest on five
dimensions, and its prerequisites say "metrics are user-provided": it scores
numbers it never produces. This skill produces them. It runs a strategy over
real bars and returns the eight inputs its evaluator asks for.

The two chain in one direction: spec, run, evaluate.

## When to Use This Skill

- A user describes a rule and wants it measured
- `backtest-expert` is about to run and the numbers do not exist yet
- A win rate, average winner, average loser or drawdown must come from bars
- A strategy's parameter count must be established for scoring

Leave the verdict to `backtest-expert`. It owns the thresholds and the red
flags, and this skill does not duplicate them.

## Prerequisites

- Python 3.9+
- `pip install manifoldbt` (Apache 2.0 with Commons Clause; the free tier covers
  everything this skill does)
- OHLCV bars as CSV or Parquet with columns `timestamp, open, high, low, close, volume`
- No API key required

## Workflow

### 1. Write the strategy spec

A spec names indicators and one entry condition. Keep it to the smallest rule
that states the hypothesis. Every added knob makes an in-sample fit easier to
reach by accident, and the evaluator penalises the count.

```json
{
  "name": "sma_cross_costed",
  "indicators": {
    "fast": { "type": "sma", "period": 20 },
    "slow": { "type": "sma", "period": 60 }
  },
  "entry": { "left": "fast", "op": ">", "right": "slow" },
  "size": 1.0,
  "stop_loss_pct": 1.5,
  "fees_bps": 5.0,
  "slippage_bps": 2.0
}
```

Field reference: `references/strategy_spec.md`.

Set `fees_bps` and `slippage_bps` to realistic values before you read any
result. A frictionless run scores 0 on execution realism, and over short holding
periods costs decide whether an edge survives.

### 2. Run it

The rest: https://github.com/tradermonty/claude-trading-skills/blob/HEAD/skills/manifoldbt-backtester/SKILL.md
