Backtest assistant (AI): reading replay and backtest statistics
The Backtest assistant is a chat panel that reads the statistics of the selected replay session or automatic backtest with your own Claude API key, comments on them without congratulating or predicting, and, in the automatic backtest panel, can rewrite the strategy script into the editor.
Senzoukria · Documentation · Updated September 2026
Where to find it
- Where
- Replay header → 'Backtest assistant' button; Automatic backtest panel → 'Ask the AI'
- Key
- Your own Claude key, kept in the Windows credential store; nothing passes through Senzoukria servers
- Context sent
- Selected run (or the most recent), up to 8 previous runs, the strategy code (truncated at 6,000 characters), the last 12 messages
- Send
- Enter sends, Shift+Enter inserts a line break; 'Clear' resets the conversation
What it does
The panel (title 'Backtest assistant', tooltip 'An assistant that reads your backtest statistics') opens from the Replay header, or from the automatic backtest card via 'Ask the AI'. Its system prompt is built from the selected run in the Performance history: contract, day, mode, context sessions, then a flat block of statistics (trades with W/L/scratch, net P&L, gross profit and loss, win rate, expectancy, payoff, profit factor, SQN, Kelly, Sharpe and Sortino per trade, standard deviation, max drawdown and %, recovery, ulcer, streaks, best and worst trade, long and short breakdown, average hold, time in market, exits by reason). Up to eight other runs are listed with trades, net and SQN for comparison.
The empty state reads 'It reads the statistics of {symbol} · {day} and says what they are worth. It does not congratulate, and it does not predict.' When no run exists: 'Finish a replay session or run a backtest: its statistics will appear here and can be commented on.'
Controls and starter questions
| Element | Default | What it does |
|---|---|---|
| Model picker (compact) | The model chosen in the AI settings | Shows and changes the engine used for this panel. |
| API key gate | Shown until a key is saved | Explains that the key is yours and stored in the Windows credential store, then lets you save it. |
| Starter question 1 | — | 'Is this result usable, or too few trades?' |
| Starter question 2 | — | 'What cost the most in this session?' |
| Starter question 3 | — | 'Suggest sweep axes to improve this' |
| Starter question 4 | — | 'Compare this session with the previous ones' |
| Input | 'A question about this backtest…' | Two-line textarea; the send button is disabled while a reply streams. |
| 'Put this script in the editor' | Only in the automatic backtest panel | Drops a complete ```js block proposed by the assistant into the strategy draft and opens the editor; Ctrl+Enter then re-runs the backtest. |
What the assistant is told to do
- Lead with sample size: under 20 trades no ratio means anything, and it must say so every time.
- Then the SQN: under 1.6 weak, 2.5 and above good, above 5 on a small sample a red flag rather than a triumph. These are the same thresholds as the verdict line.
- Then the shape of the losses (max drawdown, loss streak, ulcer index), the long/short asymmetry, and the exit breakdown.
- For a walk-forward, read the efficiency figure: below 50 % most of the result was curve fitting.
- When suggesting parameter sweeps, propose specific axes and values and keep the total under 100 combinations.
- When rewriting a strategy, emit one complete runnable script following the sandbox contract decide(bars, params, ctx, state) with bars newest first, and read every tunable from params with a default.
- Never congratulate, never predict, and state that drawdown is measured on closed trades and that the platform places no orders: strategies drive the simulated evaluation account only.
Limits or pitfalls
The assistant only sees the statistics block and the code it is given; it cannot open the charts or the trade list. A reply that quotes a number absent from that block is a hallucination and should be discarded. Replies are limited to 2,000 output tokens and the conversation history sent is the last twelve messages, so long threads lose their beginning.
The API calls are billed to your own key. The panel needs the Tauri app: it listens to the desktop's ai_agent events and streams the answer into the last bubble.
Related pages
- Automatic backtest
- Performance panel (past sessions)
- Walk-forward analysis
- How to test a trading strategy
This page in other languages
Frequently asked questions
- Which session does it talk about?
- The run selected in the Performance panel; if none is selected, the most recent one. Without any run it asks you to finish a replay or a backtest first.
- Can it change my strategy?
- In the automatic backtest panel it can propose a complete script; a button puts it into the editor as an unsaved draft and Ctrl+Enter re-runs the backtest. It never runs anything by itself.