Strategy builder
Compose a strategy as a node graph
The Studio is a visual builder: you wire together nodes that read market data, decide when to enter, size the trade, and decide when to leave. Every strategy compiles to a flat list of nodes the Trigr engine evaluates bar-by-bar, strictly point-in-time, with no look-ahead.
The node kinds
Each node has a structural kind and a data source. The kinds form a pipeline that produces one signal per bar:
| Kind | Role |
|---|---|
| TRIGGER | The primary condition that fires the entry pipeline. Exactly one per strategy. |
| FILTER | Optional gates: extra conditions that must also hold (regime, volatility, time, a cross-asset confirmation). |
| SIGNAL | Combines the trigger + filters into the actual long/short signal. |
| RISK | Sizing, leverage, take-profit / stop-loss, direction, and max concurrent positions. |
| EXECUTE | How the resolved signal turns into an order on the chosen venue. |
A node's source is where its data comes from: indicator (RSI, EMA, SuperTrend…) and api (the beta's supported market and macro datasets), plus AI-sim, smart-money, and copied-signal sources. External-provider sources remain visible in Studio as coming soon.
Cross-asset nodes
Any node can carry an asset so it reads a different market than the one you trade (for example, gate a SOL entry on BTC's trend, or confirm with BTC's CVD). The strategy still trades its primary market; cross-asset references are resolved point-in-time (a coarser timeframe is carried forward, never peeked ahead).
Risk: sizing, direction, and barriers
The RISK node controls how a fired signal becomes a position. Its fields:
- Sizing & leverage:
size(1–100% of book),lev(leverage, 1–50×), andmax positions, which must be 1: graphs with more, or with a TP/SL ladder, are refused when saved and at publish. - Take-profit / stop-loss: optional
tp/slpercentage barriers (0.2–50%). Leave empty to disable that barrier only when another supported full-close control protects the position. - Direction.
direction: long | short | both(defaultboth) filters which sides the strategy is allowed to take. - Opposite-signal handling.
onOpposite: reverse | ignore | reduce_only(defaultreverse) governs what happens when a signal fires against an open position:reversecloses it and opens the opposite side;ignorekeeps the position and skips the opposite entry;reduce_onlycloses it (withexitOnFlipon) but does not open the opposite side on the bar it closes; the opposite side can open on a later bar if the signal still holds. Withignoreandreduce_only, an entry never opens against a position still held when the order would fill (the next bar's open). A trade that a TP/SL or trailing stop closed during the bar no longer counts as held, so the opposite entry can still open at the next open.
Exits are RISK controls
Expression formulas in RISK exitLong and exitShortclose the corresponding side. They require engine support for formula exits. For EMA cross entries, use opposite-trend exit formulas and set exitOnFlip=false. Set filtersCloseTrades=false when filters must gate entries only.
filtersCloseTrades defaults to true. WithexitOnFlip=true, a failing filter can close a trade. While exitLong is true, new long entries are blocked;exitShort blocks new short entries the same way.
With exitOnFlip=false, an opposite signal never closes an open position, so leave onOpposite unset or set it to ignore; reverse and reduce_only are refused. To close and reverse on the opposite signal anyway, set exitLong to the short entry condition and exitShort to the long entry condition. The exit and the opposite entry then fill at the same next-bar open, and the position still holds while the signal is flat.
Expression TRIGGER delivery defaults to level. With engine support, rising_edge emits one base-bar pulse when the full formula changes from false to true. FILTER, regime, and exit formulas cannot set delivery. Use api("source_id") for point-in-time data; read IDs and units in the source catalog. Constants are valid operands, but a formula must reference a market input.
A strategy has one entry decision pipeline. Closing behavior belongs to its RISK node; custom indicator, API, or AI exit sub-pipelines are not a supported authoring surface.
A position is reduced or closed when any of these trips, whichever comes first:
- A scalar TP/SL barrier closes the whole position (layered TP/SL ladders are not supported).
- An ATR trailing stop (
trailAtrandtrailAtrPeriod) is hit. In a backtest the stop is recomputed every bar as the best price since entry minustrailAtr× the ATR known through the prior bar. The best price only ratchets in your favour, but the stop itself can move back when ATR widens. Forward runs (the marketplace paper track and Agents) never loosen a stop once set, so they can exit earlier than the backtest did. - Its break-even stop is hit. With
breakEvenAtset, once a bar closes that many percent in profit the stop moves to the entry price, shiftedbreakEvenOffsetpercent in your favour (to cover fees), from the next bar on, and never moves back. A wick through the level does not arm it. In a backtest it then fills like a resting stop (at the stop, or at the open on a gap); the tighter of it and an ATR trailing stop wins. On its own it is not an exit: the strategy still needs one of the others. - Its time stop reaches
maxBars, closing at that bar's close. Only bars that exist in the data count: a TradFi weekend or session break adds no bars, so a 24-bar time stop on a 1h strategy opened on a Friday evening does not fire over the weekend. - A side's exit formula becomes true at the bar's close. It fills at the next bar's open, before any signal-flip exit.
- The entry signal flips and
exitOnFlipis on (default true), subject to theonOppositepolicy. The flip is decided at a bar's close and, with next-bar-open fills (used by Studio, MCP, and official backtests), filled at the next bar's open. The entry signal includes its filters (see how filters behave on two-sided strategies).
These older spellings of the managed-exit settings are read as RISK params exactly like their canonical keys: trail, trailing, chandelier, trailMult (for trailAtr), trailPeriod, chandelierPeriod (for trailAtrPeriod), timeStop, maxBarsInTrade (for maxBars), targetVol and volatilityTarget (for volTarget). This applies in backtests, on the marketplace paper track, and in Agents. Set each setting once; a RISK node that sets the same setting under two spellings is rejected.
Intrabar precedence
Within one bar the exits are checked in a fixed order: the trailing stop first, then the TP/SL barriers, then the time stop at the bar's close, then the side's exit formula, then a signal flip. Formula exits and signal flips fill at the next bar's open. After a time stop, or a trailing stop the bar crossed intrabar, that same bar's entry signal can open a new trade at the next open.
When both the TP and SL fall inside the same bar on a timeframe coarser than 5 minutes, the engine replays that bar on 5-minute candles to see which was hit first. On 5-minute strategies, or when it still cannot tell (or finer data cannot be loaded in time), it resolves stop-loss first (the conservative outcome), so a backtest never flatters itself by assuming the take-profit won the race.
How filters behave on two-sided strategies
With RISK direction: both, one set of conditions decides both longs and shorts. The trigger and its filters combine into one entry signal per bar, and some conditions are read per side. The backtest's plain-English explainer reads the engine's actual per-side masks, so check it when a result looks one-sided.
- Directional data series are mirrored for shorts. Funding, long/short ratio, fear & greed, DXY and other macro trend reads, liquidations, and price-vs-trend reads written for a long are read in mirror image for a short. For example,
funding_rate < 0.002means "funding below 0.002" before a long and "funding at or above 0.002" before a short. If funding rarely reaches that level, the strategy takes almost no shorts. - Some conditions gate both sides as written: open interest and activity counts (social volume, whale counts, developer activity, active addresses); RSI, ROC, and Williams %R with an explicit comparator and threshold (
RSI < 30must hold before a long and before a short); Bollinger, Keltner, Donchian, and breakout band conditions; up/down bar counts and streaks; and seasonality or time-window gates. - Other indicator reads are per side. ADX, stochastic, CCI, MACD, and similar reads pass a long when they read bullish and a short when they read bearish, and a neutral read passes both sides: for example,
ADX > 25lets every entry through while ADX is below 25. - Under exit on flip, a failing entry condition can close the trade. With
exitOnFlipon and filters combined withall(or a single filter), the trade closes as soon as one entry condition stops holding (decided at the bar's close and filled at the next open), not only when the opposite signal fires. Making a filter stricter can therefore add trades: positions close earlier and re-enter later. Withany, a score threshold, or grouped conditions, the trade closes only when the combined conditions stop passing. Strategies whose trigger copies a trader or a marketplace strategy are the exception: their filters gate entries only and never close a trade.
Two opt-in filter options
Both are off by default, so existing strategies behave exactly as before. They run the same way in backtests, on the marketplace paper track, and in live Agents.
- FILTER
sides: samegates shorts with the same written condition as longs instead of its mirror image.funding_rate < 0.002withsides: samerequires funding below 0.002 before a long and before a short. Longs are never changed. The default issides: mirror. It is accepted only on a top-level FILTER comparing one API series to a threshold with an explicit comparator, where the written condition is the long side (for example funding, long/short ratio, or fear & greed). It is refused on indicator, ML, AI-sim, and smart-money filters, on triggers, on rules nested inside RISK, on rolling-baseline and paired-series reads, and on any strategy with an ML node. - RISK
filtersCloseTrades: falsemakes filters (including required gates) gate entries only. A filter that stops passing no longer closes an open trade; withexitOnFlipon, the flip exit follows the trigger alone. It is refused on strategies with an ML node and in copy-trigger strategies, whose filters already gate entries only.
Optimize with ML and ML training (and copy composition) refuse a graph that sets either param; remove them first.
Pair trade
A Pair trade (stored mode spread) trades 2-10 crypto perpetual markets together as one position on a 1H, 4H or 1D timeframe. The decision node's Opens on control picks where entries come from.
- Gap reversion. The markets move together; the pair opens when the gap of their weighted mix is far from normal and closes when it returns.
- Signal. You build an ordinary single-asset entry: one trigger plus optional filters, any supported indicator, data series or formula, read on the first asset (the signal asset). A long signal buys the first asset and sells the hedge; a short signal does the mirror. "Long BTC, short ETH when BTC breaks out" is a signal pair on BTC, ETH. AI Sim, ML, copy, marketplace strategies and uploaded series cannot drive a pair.
Hedge sizing
A signal pair has no default sizing: Backtest stays disabled until you choose one.
| Sizing | What the hedge legs hold |
|---|---|
| Beta-neutral | A rolling regression of the first asset’s log returns on the hedges’ over your lookback (at least assets + 9 bars), frozen at entry. |
| Dollar-neutral 1:1 | Equal dollars on the other side, split evenly across the hedge legs. |
| Custom weights | The weight you type on every leg: the first positive, at least one other negative. |
Pair risk
Risk applies to the combined pair. Take profit, stop loss and the trailing stop are percent of pair P&L (price only, against the first leg's entry notional) and are checked at every closed 5-minute bar, filling at that 5-minute close (the same in Agents). maxBars caps the hold, exit on flip closes when the signal is no longer on the position's side (flat included), and exit formulas (exitLong / exitShort) read the first asset. Any exit closes every leg. With exit on flip off, every traded side needs another exit. An agent running a signal pair applies the same exits on the same 5-minute closes as its backtest.
- The trailing stop's peak starts at entry, so before any profit it acts as a stop
trailPctbelow the entry. - A pair never closes and opens on the same bar close: after an exit, the next entry waits for a later close.
Backtest-only vs forward-runnable
Backtests accept more than forward runs do. A published strategy accrues its marketplace paper track, and an Agent deploys, only when every node can run forward: indicator, ML, and live-supported API sources; one RISK node with max positions 1; scalar TP/SL, trailing ATR, a maxBars time stop, vol-target sizing, exit on flip, direction, and any onOpposite policy. AI-sim nodes and research-only data series cannot be published; smart-money nodes and API series without a live feed (for example DXY) can be published but stay backtest-only, with no paper track and no Agent.
What the engine guarantees
- One entry trigger. The strategy has exactly one trigger in its entry pipeline, enforced on the server.
- No look-ahead. A node only reads data available at the bar's close. Cross-asset carry-forward, RISK exits, and ML features are all strictly causal.
- Honest badging. Every backtest runs on the real Trigr engine and the audit log flags which inputs were real vs simulated, and names any cross-asset references, direction, and exit controls.