Skip to main content
Glama

Backtest An Idea

tt_backtest_idea
Destructive

The backtest playground: "what would have happened if I bought X whenever Y, and sold it Z later?" — for NSE stocks/ETFs on daily candles. Use THIS instead of the tt_validate_markdown -> tt_create_strategy -> tt_backtest_strategy ladder for any single-stock, daily, long-only what-if. It builds the strategy, backtests it and cleans up itself.

THIS TOOL CAN CHARGE AND WRITE: run_backtest=true creates a temporary strategy in the user's account and, once the user accepts the quoted price, debits their wallet. For the free preview alone, tt_preview_idea takes the same idea arguments and is read-only.

CALL 1 (free, instant, no login needed): symbol + entry + an exit (hold_days and/or exit). Returns a daily PREVIEW replay — trades, win rate, net return vs buy-and-hold — plus the validated strategy it would run. Report the preview with its limits: it is not the engine.

CALL 2 (paid): the same arguments with run_backtest=true. It creates a temporary "Playground" strategy in the user's account and returns the PRICE QUESTION (confirmation_required, price, wallet balance). Nothing is charged. Ask the user; only after a clear yes, call retry_call (confirmation_token + confirm_charge=true). That submits to Tradetron's backtest fleet, waits for it server-side, and returns the report's own headline numbers and report_url. If still running, it returns job_id — call tt_backtest_idea(job_id=...) once when the user asks again.

EXIT IS REQUIRED AND HAS NO DEFAULT. If the user did not say when to sell, ASK. Never pick an exit, a threshold or a window for them without saying so (the window defaults to the 3 years ending 35 days before today and the response says when it did). Backtests may only use data at least 35 days old (exchange rule): an end inside the last 35 days is refused with the latest allowed date; offer that date instead.

The temporary strategy is DELETED once its backtest finishes (or if the user never confirms the price). keep_strategy=true keeps it.

Scope: long only (Indian delivery cannot be held short overnight), NSE cash, daily candles. Intraday or options ideas: tt_check_edge -> tt_promote_to_strategy.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "tt_backtest_idea"
  }
}

Input Schema

NameRequiredDescriptionDefault
endNo
exitNoOptional exit rules (same grammar), ORed with each other and with hold_days: any one closes the trade. E.g. 'rsi(14) > 60'.
entryNoEntry rules on DAILY candles, comma-separated, ANDed. The FIRST rule is the trigger and fires the session after it BECOMES true; the rest are filters. Grammar: '<term> <op> <term>', term = rsi(N) | sma(N) | ema(N) | close | open | high | low | number. E.g. 'rsi(14) < 30' or 'close > sma(200), rsi(14) < 40'.
startNo
job_idNo
symbolNoNSE stock or ETF trading symbol, e.g. RELIANCE, SBIN, NIFTYBEES. Indices cannot be bought in cash — use an index ETF.
quantityNoShares per trade. Scales rupee figures only; % results are the same.
hold_daysNoSell this many CALENDAR days after entry (Tradetron counts calendar days). 'Sold five trading days later' is ~7 calendar days — say which you used. 0 = no time exit (then `exit` is required).
run_backtestNoFalse (default): free preview only. True: also run it on Tradetron's backtest engine — PAID; the first call only returns the price.
keep_strategyNoKeep the strategy in the user's account. Default False: the temporary Playground strategy is deleted once its backtest finishes.
confirm_chargeNo
confirmation_tokenNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.9/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Goes far beyond the annotations: discloses that run_backtest=true creates a temporary strategy and debits the wallet only after user acceptance, that nothing is charged on the first paid call, that the strategy is deleted afterward unless keep_strategy=true, that polls return job_id, and that the 35-day exchange data rule can refuse an `end`. These details are consistent with destructiveHint=true and readOnlyHint=false.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well front-loaded and organized with the CALL 1 (free) / CALL 2 (paid) split, plus short bolded warnings that make the charge and exit requirements scannable. It is long and occasionally redundant (the preview/paid flow is restated in both prose and section form), but nearly every sentence carries operational information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 12-parameter, multi-phase tool with no output schema, the description still explains what each phase returns: preview trades/win-rate/net-return plus `limits`, the price-question response, and the final headline numbers with report_url or a job_id. Ambiguities that would cause a wrong invocation (charging, deletion, missing exit, stale end date) are all pre-empted.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is only 58%, so the description must compensate, and it does: exit-required-with-no-default, hold_days counted in calendar days (with the ~7-day conversion warning), run_backtest's two-phase behavior, the default 3-year window ending 35 days back, keep_strategy deletion semantics, and the confirm_charge/confirmation_token retry flow are all explained in prose rather than left to the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Uses a concrete verb and resource with an intuitive framing ('what would have happened if I bought X whenever Y, and sold it Z later?') and narrows scope explicitly to NSE stocks/ETFs on daily candles. It names the sibling ladder it replaces, so an agent can separate it from tt_validate_markdown/tt_create_strategy without reading their schemas.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

States plainly when to use this tool ('any single-stock, daily, long-only what-if') versus the ladder, versus tt_preview_idea for a free read-only preview, and versus tt_check_edge -> tt_promote_to_strategy for intraday/options. It also lists exclusions (shorting, indices) and the prerequisite that an exit must be supplied before calling.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources