# Canli Backtest

This server builds SEC-based factors and tests signals against your price data, accounting for trade delays and costs. Use it to inspect a strategy or compare a set of variants.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 5
- Author: arhancanli
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/arhancanli/canlicapital/tree/HEAD/mcp-backtest
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/mcp/canli-backtest

## What it does

Canli Backtest derives factors from company filings, using only information that had reached the SEC by each historical date. It then ranks a signal to form positions and tests those positions against prices you supply. The server also includes tools for market-breadth analysis, parallel parameter sweeps, and a trial ledger that records each run.

It runs locally over stdio, so prices, signals, and ledgers stay on your machine. You must bring the price CSV; errors in split or dividend adjustments carry through to the result. Trading costs use a flat rate per amount traded. Market impact, short-borrow charges, and financing are excluded unless included in `cost_bps`. A backtest describes a historical path, not proof that a signal will keep working.

## Requirements
- Needs: Node.js (commands run via npx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add canli-backtest-mcp -- npx -y canli-backtest-mcp
```

### Codex

**Platform CLI**
```bash
codex mcp add mcp-backtest -- npx -y canli-backtest-mcp
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "mcp-backtest": {
            "command": "npx",
            "args": [
                "-y",
                "canli-backtest-mcp"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "mcp-backtest": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "canli-backtest-mcp"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add mcp-backtest npx -y canli-backtest-mcp
```

## When to use it
- test a signal against historical prices with a trading delay
- include transaction costs when rebalancing positions
- compare strategy variants while accounting for the full search
- derive date-aware factors from SEC filings

## Example prompts
- Build the `roa` factor for my tickers and save the signal as a CSV.
- Test my signal on `prices.csv` with monthly rebalancing and trading costs.
- Compare these settings in the trial ledger and assess the best result against all runs.

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 392262
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33989
- [World Monitor](https://affpapa.org/en/nevibecode/mcp/world-monitor.md) — MCP server · ★ 89609
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81163
- [Front-End Checklist](https://affpapa.org/en/nevibecode/mcp/front-end-checklist.md) — MCP server · ★ 74569
- [Scrapling MCP Server](https://affpapa.org/en/nevibecode/mcp/scrapling-mcp-server.md) — MCP server · ★ 89899

From the same set: [arhancanli/canlicapital](https://affpapa.org/en/nevibecode/by/arhancanli/canlicapital.md) — 4 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
