Check a backtest's completion and fetch what its engine returns.
A job_id need not come from the user: tt_list_backtests returns every run
in their account with its job_id already attached.
Call this after tt_backtest_strategy. A backtest takes ~10-75s; if it's not
finished yet this returns state 'queued'/'running', so poll it after a short
beat. THE SHAPE DEPENDS ON WHICH ENGINE SERVED THE RUN (the response's
`engine` field says which):
- engine 'tradetron-fleet' (job ids 'ttbt-…' — the normal path since
2026-08-25): completion + report_url ONLY. You may also pass the BARE
backtest id the user reads off their Tradetron report page or the
trades-CSV filename (e.g. 10053270260902); it is normalised onto this
route, so a run started on the website is reachable too. The numbers live on the
public per-run report page; this response carries NO results block,
csv_url or raw payload — present report_url and read the numbers there,
never invent a P&L figure here. To READ the run without a browser (any
chat channel, or the ttmcp CLI), call tt_backtest_trades with its
job_id: that returns the fills plus a summary computed over all of them.
- engine 'btengine' (16-hex job ids — sweeps and non-default-knob runs):
done => {summary_md, results:{net_pnl, roi_pct, max_drawdown, charges,
trading_days, fills, currency, ...}, report_url, csv_url}, plus `raw`
(the untouched btengine payload).
- failed (either engine): {done: True, failed: True, error, summary_md
(incl. auto-refund note)}.
- not_found: Tradetron is returning no record for this id — it is wrong,
or the run belongs to another account. TERMINAL: do not poll again,
ask the user to re-check the id on their Backtests page.
- unavailable: the status could NOT be read. This is NOT evidence the run
is progressing — never report it as "still running". Retry once, then
send the user to their Backtests page.
RELAY `summary_md` verbatim (it's unit- and currency-correct — crypto is USD,
not ₹). Then add the report_url as a clickable link. If the submit charged the
user (the tt_backtest_strategy `billing` block), remind them of that charge in
the same message, quoting the submit's own value (never a hardcoded figure);
on a failed run, the fee auto-refunds — say so.