Backtest An Idea
tt_backtest_ideaThe 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
| Name | Required | Description | Default |
|---|---|---|---|
| end | No | ||
| exit | No | Optional exit rules (same grammar), ORed with each other and with hold_days: any one closes the trade. E.g. 'rsi(14) > 60'. | |
| entry | No | Entry 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'. | |
| start | No | ||
| job_id | No | ||
| symbol | No | NSE stock or ETF trading symbol, e.g. RELIANCE, SBIN, NIFTYBEES. Indices cannot be bought in cash — use an index ETF. | |
| quantity | No | Shares per trade. Scales rupee figures only; % results are the same. | |
| hold_days | No | Sell 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_backtest | No | False (default): free preview only. True: also run it on Tradetron's backtest engine — PAID; the first call only returns the price. | |
| keep_strategy | No | Keep the strategy in the user's account. Default False: the temporary Playground strategy is deleted once its backtest finishes. | |
| confirm_charge | No | ||
| confirmation_token | No |