docs › Build a strategy by chat
Build a strategy by chat
Ask the analyst for a strategy, then back-test it on your recorded history, forward-test it on live data on paper, and promote it one step at a time to the always-on service and, only if you choose, to real mode. Every step needs evidence; nothing is promoted by the model. Paper by default, not financial advice.
The ladder#
A strategy you build climbs one ladder, one rung at a time:
draft → backtested → forward-tested → always-on (paper) → real
| rung | what it needs | who does it |
|---|---|---|
| draft | a strategy that validates | the analyst proposes it, you apply it with a key |
| backtested | a backtest on your recorded history, with the held-out split | you or the analyst |
| forward-tested | a forward test that ran its whole window on live data, on paper | you or the analyst starts it; it runs by itself |
| always-on | a member of autotrade.json, run by the always-on service on paper | the analyst can propose it; only you apply it |
| real | real mode armed on your own terminal, with caps you set, above the evidence floor: a completed forward test with at least 10 closed paper trades and a backtest | only you, with a typed phrase (real mode) |
Every rung counts evidence measured on the strategy's exact rules. Renaming it, rewording its description or arming it for real keeps its evidence; changing any rule (an entry filter, a size, an exit, a limit) starts the ladder again from draft. No rung can be skipped, and dexterm autotrade journey <id> (or J on the Q screen) always shows where a strategy stands and what the next rung needs.
1. Ask for a strategy#
Open the analyst and say what you want, for example: "build me a strategy that buys young pairs on a 5-minute push, takes the cost back at 2x and lets the rest ride". The analyst works only through typed tools: it reads the presets, then proposes a new strategy (a copy of a preset with its changes) and any edits after that. Each proposal arrives on the Q screen as a card with the fields that change, the validation result and TIGHTER, NEUTRAL or LOOSER; o opens it, y applies it (a looser edit needs a second y), n dismisses it. Nothing exists until you apply it, and a new strategy always starts on paper. Your mode, bankroll, model budget and exit-liquidity floor stay yours: the analyst cannot change them. See changing a strategy by chat.
2. Backtest it (held-out split)#
dexterm autotrade backtest <id> (or b on the Q screen's journey view, or asking the analyst, which calls strategy_backtest) runs the strategy on your recorded history, then runs it again on each half of a held-out split: the newest 30% of coins, which nothing was ever tuned on, against the rest. The result is recorded as the strategy's backtest evidence.
The evidence rule is strict: gain wording is allowed only with at least 20 trades in both halves and a held-out net above 0. Below that the report says "too few trades to claim anything", and the analyst is told to quote the trade counts and nothing more. A backtest is modelled fills on recorded snapshots, not a prediction; its data limits are printed with it.
3. Forward-test it on live data (paper)#
A forward test runs the same version on the live tape, on paper, with its own bankroll and its own run file, for a window you choose:
dexterm autotrade forward start <id> --hours 24 # or --trades 30, or both (whichever comes first)
dexterm autotrade forward status [<id>]
dexterm autotrade forward stop <id>
dexterm autotrade forward report <id> [--json]
- It starts in the background and runs next to the always-on service (it does not take the runner's lock).
--foregroundkeeps it in your terminal;--bankroll-usd Nsets its paper bankroll (default: the strategy's own). - The strategy is frozen at the version it started with. A forward test of a strategy in real mode runs its paper twin: it never sends a signal.
- At the end of its window it sells everything at the next tick (so its numbers are closed numbers), writes its report and records the result. The panic switch stops it like any run.
- The analyst can start and stop one too (
strategy_forward_start,strategy_forward_stop), after a backtest, for at most 72 hours or 200 trades, with the strategy's own bankroll. On the Q screen's journey view, F starts a 24-hour test and X stops it. - Only a test that ran its whole window on live data counts as the forward-tested rung. A test stopped early, run on a replay (
--replayis a smoke run) or whose process died is shown, never counted. - A strategy that needs a chat approval for every entry cannot be forward-tested: no tap reaches a forward test. Model sessions of an agent strategy run on your own engine within the strategy's budgets, as in any run.
The report#
forward report sets the forward test next to the backtest of the same rules, column by column: trades, win rate with its 95% interval, net, max drawdown, rug rate, and the fill cost against the mid price (with the drift from the backtest). It flags a forward win rate outside the backtest's interval, a deeper drawdown and more rugs than the history showed. Under 20 closed forward trades it says plainly that the sample is too small to claim anything, and it allows gain wording only when the backtest passes the evidence rule and the forward test made money on 20 or more trades.
4. Promote it to always-on (paper)#
When the forward test is done, the analyst can propose the promotion (strategy_promote_propose) or you can ask for it yourself:
dexterm autotrade promote <id> --to always-on
dexterm autotrade promote list | show <pp-id> | apply <pp-id> | dismiss <pp-id>
Every promotion shows an evidence card first: the ladder, the backtest, the forward test and the comparison. Applying it needs your y on your own terminal (a pipe, a flag or an agent cannot give it), or A then y on the Q screen's journey view. The strategy then joins autotrade.json as a paper member, next to your other entries, and the always-on service runs it from its next start (dexterm autotrade service status).
5. Real, only if you choose#
Real mode sends each of the strategy's trades as a LIVE TRADE FIRE signal to your own executor; dexterm still holds no key and signs nothing. On this ladder it is the last rung and it is entirely yours:
- Set your own limits:
dexterm autotrade limits set perTradeSol=X dailySol=Y buysPerDay=N maxOpenPositions=Nand any of the others (Going real, safely);signal caps setsets the same four. A promotion to real refuses until you have. - Set up a channel your executor reads (
dexterm autotrade signal channels ...). - Have the evidence: a completed forward test of these exact rules with at least 10 closed paper trades (your limit
minForwardTrades) and a backtest on record. Below that the promotion refuses and says what is missing. dexterm autotrade promote <id> --to real(orpromote apply <pp-id>for one the analyst proposed) hands over todexterm autotrade signal arm <id>: the evidence panel, now with the journey line and the held-out verdict, then a typed phrase with a one-time code.
The analyst can propose real (never below the evidence floor), never apply it, set a cap, choose a bankroll, lower the floor or arm anything. Arming directly with signal arm when a rung is missing, or below the evidence floor, refuses unless you type the OVERRIDE phrase it shows on your own terminal; the override is journaled. A real strategy runs in the foreground with dexterm autotrade run <id> --real; in 0.2.0 the always-on service runs paper strategies only, so stop the service while a real run is on (one runner per computer). See real mode.
What the analyst knows#
The analyst's tools for this: strategy_journey (the ladder for one strategy), strategy_backtest (with the held-out split), strategy_forward_start, strategy_forward_stop, strategy_forward_report and strategy_promote_propose. It is told the whole ladder, refuses to skip a rung, and reports numbers with their trade counts and the verdict lines as they are. An observe-only scan session gets none of the starting, stopping or proposing tools.
Paper by default; experimental; not financial advice.