AI & ML
Build and validate with AI
Trigr layers three available AI capabilities over the studio: a conversational copilot that edits your graph, an ML optimizer that machine-learns a gate for your strategy with rigorous leak detection, and persisted ML models that generate live signals. AI actions are metered in credits (see Subscriptions & credits).
The copilot
The copilot sits beside the canvas and works in three modes:
- Decide: builds or rewrites the whole graph from a plain-English prompt ("momentum BTC long with a volatility filter").
- Ask: answers questions about your strategy without changing it.
- Suggest: proposes targeted edits (drop a weak filter, retune a parameter) you can apply with one click.
The copilot always produces a valid graph or a safe fallback, and is rate-limited.
Choosing the copilot model
A picker under the copilot's message box offers Claude Sonnet 5.5 (the default), GLM 5.3 Flash, GLM 5.3, and Claude Opus 5.5. Every plan can pick any of them. Each option shows its cost per step relative to the default: GLM 5.3 Flash is the cheapest, Claude Opus 5.5 costs the most. Each step is billed in credits from the actual cost of the model that ran it, and your choice is remembered in this browser. If you picked no model and your credits do not cover a Claude Sonnet 5.5 turn, the copilot runs that turn on GLM 5.3 Flash and says so under its reply. Studio generation stays on GLM 5.3 Flash.
How a research session works
- Your constraints win. If you restrict indicators, data sources, or approach ("only RSI", "price action only", "no external data"), the copilot stays inside them and says so when it skips a step below.
- Live market data. Each session gets a menu of the API series your market can use and still publish and deploy (for example funding, open interest, liquidations). Unless you ruled it out, a research session tests at least one non-price data hypothesis per strategy; a data experiment that does not help is reported as a result and the session continues.
- Families rotate. A strategy family is defined by its entry trigger (trend, mean reversion, breakout, data-driven). Adding or tuning filters on the same trigger is a refinement, not a new family. Unless you pinned the approach, a research plan covers at least three trigger families.
- Baseline for bare requests. Only for a goal-less build request on an empty canvas ("btc strat", "make me an ETH strategy") does Trigr pick the baseline family, so sessions do not all start from the same recipe. Any request that names an approach, indicator, or data source is followed as written.
- Long/short split. Every backtest the copilot runs reports how many long and short trades it took. It warns when a side the strategy allows took no trades (on runs with at least 10 trades and a trigger that can fire both ways), and when trades rose after the same filter was made stricter with the trigger unchanged. A filter set to
sides: sameis never blamed on mirroring, and with RISKfiltersCloseTradesfalse the trades-rose warning does not fire, since a failing filter no longer closes a trade. Both warnings usually point to the filter behaviour described in how filters behave on two-sided strategies.
AI-sim nodes
An AI-sim node (source: aisim) lets an LLM make a trading decision per bar from a point-in-time context. To keep it honest:
- The prompt contains only point-in-time indicators and API context: no absolute date, so the model can't infer the future.
- The decision is treated as a
shift(1)(lagged) feature, so it never uses the current bar's outcome. - Decisions are cached and capped, and the backtest window auto-restricts to the period the AI/social data actually covers.
ML optimization
"Optimize with ML" compares supported model families to learn an entry gate for your strategy, following López-de-Prado's Advances in Financial Machine Learning methodology over a constrained, typed pipeline:
- Point-in-time features: the loader raises on any future leakage and drops the traded bar's close.
- Triple-barrier labels: volatility-scaled, with sample weights from average uniqueness and return attribution.
- Model-family selection: LightGBM, random forest, and XGBoost candidates use fixed family parameters. The family is selected on anchored, purged walk-forward out-of-sample results; hyperparameters are not optimized.
- Separate PBO diagnostic: a CPCV configuration grid estimates overfitting risk, but it does not select the model family, its parameters, or the saved artifact.
- Honest metrics: out-of-sample Sharpe, the Deflated Sharpe Ratio (with the current run's classifier-trial count), and diagnostic PBO. Separate optimizer reruns are not yet accumulated, so repeated tuning still needs a fresh holdout or live validation.
- Feature importance: MDA / SFI in CV plus SHAP.
Leak detection
Every optimize run returns a leak verdict (a realistic/not-realistic call with specific flags) alongside the DSR and diagnostic PBO. The result also names the selected model family and discloses its fixed parameters. It shows the optimized backtest (strategy entries gated by the OOS predictions) against the baseline, with the delta.
ML models in live trading
Training is the expensive part; inference is cheap. When a strategy uses ML for live signals, the trained model is persisted (with its feature spec and the leak/DSR verdict from training) and the live-runner loads it to generate signals each bar, with the same strict point-in-time discipline as the backtest, and no retraining. After model family selection, that family and its fixed parameters are refit on the full training window for the saved artifact. Live inference matches the backtest at the same bar; a later refit is a new, metered training run.