Manifoldbt Backtester logo

Manifoldbt Backtester

CommunityPopular
tradermonty
manifoldbt-backtester

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.

Overview

Publishertradermonty
Repositoryclaude-trading-skills
Skill namemanifoldbt-backtester
Stars
2.8K
Forks
647
Bundled files
12
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 12 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by tradermonty on GitHub. Read the source before you install it.

Installation

Install the Manifoldbt Backtester AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/tradermonty/claude-trading-skills.git /tmp/claude-trading-skills
mkdir -p .claude/skills
cp -r /tmp/claude-trading-skills/skills/manifoldbt-backtester .claude/skills/manifoldbt-backtester
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Manifoldbt Backtester in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Manifoldbt Backtester on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Manifoldbt Backtester is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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

bash
python3 scripts/run_backtest.py \
  --spec strategy.json \
  --data bars.csv \
  --symbol BTCUSDT \
  --json-out result.json

The script validates the spec before it touches the data, so you see a spec mistake in a second instead of after a long load.

3. Read the warnings before the numbers

The run prints warnings that change how you should read the result: a sample under 30 trades, a span under a year, no friction modelled, or a gap between the engine's win rate and the paired one. Each one is a reason to fix the setup and run again.

Three conditions stop the handoff instead of producing a score: no completed round trips, missing or non-finite maximum drawdown, and scratch trades. The evaluator has no scratch input, so passing a population that contains them would make its derived expectancy disagree with the completed trades.

4. Hand off to backtest-expert

The run ends with a command you can paste. Run it, or invoke the backtest-expert skill with the same figures:

bash
python3 skills/backtest-expert/scripts/evaluate_backtest.py \
  --total-trades 3854 --win-rate 20.24 \
  --avg-win-pct 0.2917 --avg-loss-pct 0.2342 \
  --max-drawdown-pct 99.2893 --years-tested 0 \
  --num-parameters 3 --slippage-tested

Four conversions that fail without an error

Between an engine's output and the evaluator's inputs sit four conversions. Each one yields a plausible number and scores the strategy wrongly. None of them raises.

A fill is one execution, a round trip is two. The raw trade count runs at about twice the number of round trips. Feed fills to the sample-size dimension and you double the apparent sample, which can lift a thin backtest over a threshold it should not clear.

Buy and sell alternate only in the simplest case. That holds for a single-symbol long-only strategy that never scales a position. Shorting breaks it, because a sell can open. Scaling breaks it, because one exit answers several entries. A universe breaks it, because fills interleave. This skill tracks position per symbol and closes a trip when it crosses back through flat. Entry and exit quantities and cash values accumulate across that whole lifecycle; their weighted-average prices are display values, while PnL comes from the cash flows themselves.

Costs decide small trades. At 7 bps a side, a trade that gains 0.1% on price loses money. Expectancy comes from the win rate and the average winner together, so a gross win rate beside net averages misstates the edge. Percentages here are net of fees, and gross_return_pct sits alongside for inspection.

The engine signs drawdown negative. The evaluator wants a positive magnitude. Pass the raw value and a 38% fall scores as a flawless run.

Scope

Supported: sma, ema, rsi over any OHLC column; one entry condition using >, <, >=, <= against another indicator, a price column or a number; optional stop-loss and take-profit; fees and slippage in basis points; long-only.

Refused: multi-condition entries, shorting, multi-asset universes, and indicators outside the three above. The engine does all of these. This skill covers the shapes a one-sentence hypothesis produces, and rejects the rest instead of half-handling it.

Reference Files

  • references/strategy_spec.md covers every spec field, its default, and what validation refuses
  • references/metric_bridge.md covers the eight inputs, how each is derived, and the trap in each conversion

Scripts

  • scripts/run_backtest.py runs a spec against bars
  • scripts/spec.py validates a spec and counts its parameters
  • scripts/round_trips.py pairs fills into round trips with net returns
  • scripts/bridge.py assembles the evaluator's eight inputs

spec.py, round_trips.py and bridge.py carry no dependencies and import without the engine, so you can test the logic without running a backtest.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Manifoldbt Backtester AI skill do?

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.

Why use Manifoldbt Backtester on TypingMind?

Because you install it once and use it with any model. Manifoldbt Backtester is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Manifoldbt Backtester in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/tradermonty/claude-trading-skills/tree/main/skills/manifoldbt-backtester. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Manifoldbt Backtester?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Manifoldbt Backtester?

As many as you like. As long as a model supports skills, you can use Manifoldbt Backtester with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Manifoldbt Backtester AI skill free?

Yes. It is published on GitHub by tradermonty under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇