# backtest-sanity-checker

> Audits a trading backtest or order-book replay for fake profit. Checks data holes, unrealistic fills, look-ahead, missing fees, and profit concentrated in a few days, then returns a PASS/WARN/FAIL report with numbers.

backtest-sanity-checker is a free AI agent skill on Agensi by Mohd Jaun Rizvi, in Trading & Investing. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [Mohd Jaun Rizvi](https://www.agensi.io/creators/mohd-jaun-rizvi)
- Category: [Trading & Investing](https://www.agensi.io/skills/trading-investing)
- Version: 1.0
- Last updated: 2026-11-23
- Security: scan passed (2026-11-23); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/backtest-sanity-checker
- Tags: trading, data-analysis, code-review

## About this skill

Use this skill when the user has a backtest, replay, or paper-trading result and wants to know if the profit is real. Most "great" backtests are wrong because of bad data or generous fill rules, not because the strategy works. Your job is to try to break the result before real money does.

Ask only for what is missing:
- The result (PnL, trade list, or equity curve) and the code or script that produced it.
- The raw data used (trades, order book snapshots/updates, candles) and its source.
- Fee, latency and fill assumptions the backtest uses.
- Optionally, real exchange records (fills, order history) to reconcile against.

If you cannot read the code or data, say so and list which checks you could not run. Never mark a check PASS that you did not run.

Return a short report:

## Requires

- Backtest code or results
- Market data files

## Known limitations

Audits a backtest; it does not build strategies or guarantee live profit. Cannot check data or code it cannot read. Exchange reconciliation needs the user to provide real fill records.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the backtest-sanity-checker skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### Does it work with any trading bot or backtest?

Yes. It works with any backtest, replay or paper-trading result, as long as your AI agent can read the code and the data files. It is not tied to one exchange, language or framework.

### Will it tell me my strategy will make money live?

No. A clean report only means the test was not obviously wrong. It cannot promise live profit. It looks for problems that make backtests look better than reality.

### What problems does it look for?

Holes and errors in the market data, fills that would not have happened in real life, look-ahead bias, missing fees, positions that grow too large, profit that comes from only a few days, and results that do not match real exchange fills.

### Does it change or rewrite my strategy or code?

No. It only audits and reports. It gives you the top fixes in order of impact, and you decide what to change.

### Does it send my data or keys anywhere?

No. It reads only the local files you point to. It needs no API keys and makes no network calls.

### What do I need to give it?

The backtest result or trade list, the code that produced it, and the market data it used. Real exchange fill records are optional, but they allow the strongest check.

### What if I cannot share some of the data?

It will list the checks it could not run and mark them NOT RUN. It never marks a check as passed when it did not run it.

### Is it good for market-making and spread strategies?

Yes. It has specific checks for resting-order fills, queue position, one-leg fills, inventory build-up and book gaps, which matter most for those strategies. It also works for directional and candle-based strategies.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
