Docs
Set up TapeLeaf and run your first backtest.
TapeLeaf is a remote MCP server. Add it to your AI client once, sign in with Google, then just talk about strategies.
Connect
Pick your client. The first time your agent uses TapeLeaf, it opens a Google sign-in. Your account starts with 10 free credits.
- In Claude (web or desktop), open Settings → Connectors.
- Choose Add custom connector, name it TapeLeaf, and paste this URL:
https://tapeleaf-api.onrender.com/mcpClaude opens a Google sign-in the first time. Then start a new chat and ask for a backtest.
Run this in your terminal:
claude mcp add --transport http tapeleaf https://tapeleaf-api.onrender.com/mcpThen open /mcp in Claude Code, select TapeLeaf and sign in with Google.
Add this to ~/.cursor/mcp.json (or your project’s .cursor/mcp.json):
{
"mcpServers": {
"tapeleaf": {
"url": "https://tapeleaf-api.onrender.com/mcp"
}
}
}Finish the Google sign-in from Cursor’s MCP settings.
Run this in your terminal:
codex mcp add tapeleaf --url https://tapeleaf-api.onrender.com/mcpIf Codex asks you to authenticate, run codex mcp login tapeleaf.
Your first backtest
Describe the trade in plain language. Your agent reads TapeLeaf’s instructions, asks about anything it needs (index, strikes, expiry, exits, dates), runs the test and reports progress while it works. Most runs finish in about a minute.
Prompts to try
Backtest a NIFTY 9:20 short straddle with a 40% stoploss, exit at 15:15, last three months.
Same strategy, but compare a 30% and a 50% stoploss.
Run it with charges off and last-price fills so I can see how much costs matter.
SENSEX iron condor at 9:30: sell 2 strikes out, buy 5 strikes out, 50% target. Show the daily P&L table.
Save this as “Morning straddle” and run it again over June instead.
What you can describe
Every strategy becomes a structured spec. Your agent writes it for you; this is what it can contain.
| Index | NIFTY, BANKNIFTY, SENSEX, FINNIFTY or MIDCPNIFTY. |
|---|---|
| Legs | 1 to 8 option legs. Each is a buy or sell of a CE or PE, with its own lots. |
| Strike | Distance from the ATM strike at entry, in strike steps: ATM, 1 up, 2 down, up to 30 either way. |
| Expiry | The nearest live expiry on each day (often same-day), or the next, up to 3 further out. |
| Entry | A time of day (IST), applied to every trading day in the period. |
| Exits | Stoploss % and target % on the position’s net premium, a squareoff time, or holding to the last bar. The first exit to trigger wins. |
| Period | Any start and end date within the data coverage. Weekends and holidays are skipped. |
| Costs | Discount-broker charges (₹20 per order plus statutory charges), your own brokerage, or no charges. Bid/ask, mid or last-price fills, plus optional slippage. |
What comes back
- Net and gross P&L, with every charge itemised: brokerage, STT, exchange fees, GST, stamp duty and SEBI fees.
- Day statistics: winning and losing days, win rate, average win and loss, max drawdown, profit factor and daily Sharpe.
- Daily P&L for every trading day. Your agent shows the full table, with a running total, for runs up to about 40 days.
- Every fill your strategy made: time, strike, side, quantity, price and why it exited.
Results are kept forever. Ask your agent for past runs any time.
Fills and charges
By default, TapeLeaf buys at the ask and sells at the bid at the minute your rule fires. Every order pays brokerage plus the statutory charges at current published rates. SENSEX contracts use BSE exchange fees and the others use NSE’s.
To see how much costs drag a strategy down, ask for the same run with charges off and last-price fills. Treat those numbers as optimistic: real trades pay the spread.
Data coverage
Minute-level option chains for every listed strike, with bid, ask and last price.
| Index | History from | Exchange |
|---|---|---|
| NIFTY | 25 Aug 2022 | NSE |
| BANKNIFTY | 28 Apr 2026 | NSE |
| FINNIFTY | 28 Apr 2026 | NSE |
| MIDCPNIFTY | 28 Apr 2026 | NSE |
| SENSEX | 28 Apr 2026 | BSE |
New sessions are added every trading day. Your agent can check the latest available date and real expiry dates before it runs anything.
TapeLeaf returns results only. Candles, option chains and ticks are not available through any tool or export.
Save, organise, share
- Save a strategy by name. Saving again under the same name creates a new version.
- Re-run a saved strategy over a different period. The same strategy over the same dates returns instantly, free.
- Workspaces group related strategies and can be shared with other TapeLeaf users by email.
- Share links make a read-only public page for one strategy or one result. They’re only created when you ask.
Current limits
The following are not yet supported. Your assistant will say so if a request depends on one of them.
- Entries are by time of day only. No indicator or signal entries yet.
- One position per day, and all legs use the same expiry.
- Weekly and monthly expiries aren’t distinguished yet. Expiries are picked by their order among the live ones.
- Futures legs aren’t simulated yet.
- Percentage exits apply to the whole position’s net premium, not per leg. They don’t trigger on near-zero-premium balanced spreads.
- Holding to expiry currently squares off at the last bar of the session.
TapeLeaf does not offer live trading, paper trading or scheduled runs.