API · Agents

Agents, graphs & ML

These endpoints power the remote MCP server and can also be called directly. Catalog discovery is public; account writes and compute use a paid subscriber API key.

GET/api/v1/catalog

Returns the canonical assets, timeframes, condition node families, graph stages, AI Sim contract, Smart Money nodes, indicators, external data nodes, parameter schemas, status, node roles, and agent endpoints. A node family describes what computes a condition; a graph stage describes where it sits. Filter with q, section, and limit.

Request
curl "https://trigr.xyz/api/v1/catalog?q=momentum&section=indicators"
AI Sim & Smart Money
curl "https://trigr.xyz/api/v1/catalog?section=aiSimNodes"
curl "https://trigr.xyz/api/v1/catalog?section=smartMoneyNodes"

POST/api/v1/graph-strategies

Validates and saves a new unpublished graph draft. The server generates its id; the response includes a studioUrl. Account strategy quotas are applied atomically.

Executable request body
{
  "name": "BTC EMA trend",
  "graph": {
    "market": "BTCUSDT",
    "timeframe": "1H",
    "nodes": [
      {
        "id": "trigger-ema",
        "kind": "TRIGGER",
        "source": "indicator",
        "title": "Price above EMA 50",
        "detail": "",
        "params": [
          {
            "k": "indicator",
            "v": "ema"
          },
          {
            "k": "length",
            "v": "50"
          },
          {
            "k": "condition",
            "v": "price > EMA"
          },
          {
            "k": "tf",
            "v": "1H"
          }
        ]
      },
      {
        "id": "signal-entry",
        "kind": "SIGNAL",
        "title": "Entry signal",
        "detail": "",
        "params": [],
        "combine": {
          "mode": "all"
        }
      },
      {
        "id": "risk",
        "kind": "RISK",
        "title": "Risk",
        "detail": "",
        "params": [
          {
            "k": "size",
            "v": "10% eq"
          },
          {
            "k": "lev",
            "v": "1x"
          },
          {
            "k": "sl",
            "v": "2"
          },
          {
            "k": "tp",
            "v": "4"
          },
          {
            "k": "exitOnFlip",
            "v": "true"
          }
        ]
      },
      {
        "id": "execute",
        "kind": "EXECUTE",
        "title": "Paper execution",
        "detail": "",
        "params": [],
        "venue": "paper"
      }
    ],
    "edges": []
  }
}

Send that JSON with Authorization: Bearer $TRIGR_API_KEY. The catalog returns this same validated starter under graphContract.executableExample. Over MCP, trigr_search_catalog also returns it with every search, each indicator or data-source hit carries enumOptions and an executableExample node, and trigr_get_recipes serves a library of validated starting graphs by family (trend, breakout, mean reversion, derivatives, cross-asset, seasonality, regime, confluence, macro).

POST/api/v1/ml/backtest

Runs the same service-backed point-in-time engine as Studio over full history. Range-shaped fields are rejected instead of ignored. The graph is validated before compute, failures are not billed, and successful runs cost 50 credits plus any signed provider usage. Supply a stable requestId; include the matching owned strategyId to store the completed full-history result in Studio history. Runs are gross (fees only) by default; add frictions (slippage + slippageBps per side, funding with optional flat fundingRate per 8h) for a net run. Both endpoints accept it, and a malformed value is rejected with INVALID_FRICTIONS before any credits are spent.

With a strategyId alone, the graph must equal that strategy's saved recipe (else 409 STRATEGY_GRAPH_STALE), and the stored run becomes its verified statistics. To iterate on a strategy without overwriting it, add experimentLabel (1–60 characters, e.g. "Exp 3: ATR trail 2.5x"): the graph may then be any variant, the run is stored as a labelled experiment in that strategy's version history (alongside Studio Copilot experiments), and it never replaces the saved recipe or its current verified statistics. Save the winning variant with PATCH /api/v1/graph-strategies/{id} or trigr_edit_strategy. A label without a strategyId is rejected with 422 INVALID_EXPERIMENT before any credits are spent. Create a separate strategy only for a genuinely different idea.

POST/api/v1/ml/backtest/bounded

Runs a detached deterministic research backtest for an exact window. Supply backtestWindow.start and backtestWindow.end as canonical UTC-millisecond strings such as 2025-01-01T00:00:00.000Z. Offsets, epoch values, date-only values, and other precision are rejected. Bounded AI-Sim is unsupported. With an owned strategyId (matching the saved recipe, or with an experimentLabel) the run is written to Studio history, labelled with its window; it is never used for the verified statistics or canonical publish/deploy eligibility.

POST/api/v1/ml/optimize

Starts an asynchronous ML job with point-in-time features, purged validation, out-of-sample metrics, leakage checks, DSR, and diagnostic PBO. A successful admission returns 202 with a job id. Include the matching owned strategyId to associate the job and completed result with Studio history.

GET/api/v1/ml/optimize/{jobId}

Polls the owner-scoped job. A running, succeeded, or failed state is returned as JSON; failed jobs charge zero. Over MCP, trigr_get_optimization also lists a strategy's optimizations and adds the Studio result presentation (see below).

POST/api/v1/agents/backtest

Runs the combined backtest of a candidate Agent mix — the same run as the Agent builder's preview — without creating anything. Send capital, optional frictions, an optional venue and 1–52 slots, each { strategyId, pinnedVersionId?, allocationPct, asset? } in entry-priority order. The venue defaults to PAPER; every venue sizes from shared account equity. A strategy you do not own needs its pinnedVersionId; omit it to test your own current draft.

allocationPct is the share of equity a strategy may use, in (0, 100]. Each entry puts up equity × allocationPct × the strategy's own RISK size as margin (a 20% allocation on a strategy sized at 50% uses 10% of equity per entry; the position is that margin times its leverage). Allocations may sum past 100%. Every run uses one shared-margin account. Free margin limits concurrent entries; an entry that does not fit is skipped, and same-bar ties go to the earlier slot. The answer carries the combined metrics, each slot's metrics with a sampled Sharpe and volatility, the entries each slot took and skipped (admission), the builder's Equal / By Sharpe / Inverse vol allocations computed from this run (allocationSuggestions). The minOrderCheck is unavailable for candidate mixes without an execution account. Saving remains allowed. A cold many-strategy run answers 202 with jobId and a signed job handle.

A combined backtest costs 50 credits — the price of a Studio backtest, whatever the number of strategies — charged when its result is delivered (the job read, for a queued run). Asking for the same mix again the same UTC day (same strategies, versions, allocations, venue, frictions, and capital to two significant figures) is free from any surface, including the Agent builder; the answer's billing.charged is then 0. Refused, failed and cancelled runs are free (a request aborted before delivery is not charged; asking again pays on delivery). A balance short of 50 credits answers 402 INSUFFICIENT_CREDITS with needed and balance before anything runs.

POST/api/v1/agents/backtest/jobs/{jobId}

Reads a queued agent-mix backtest. Send { job } exactly as the run returned it; the answer is 202 with progress until the summary is ready. Slots are then named by position in the order they were sent. A handle reads only for the wallet that started the run and expires after 15 minutes.

Pair trade and Basket strategies

Pair trade (mode value spread) trades 2-10 crypto perpetual markets together as one position; a pair has two legs. It opens on the gap between markets that move together (gap reversion, the default) or on a signal: one ordinary TRIGGER plus optional FILTERs read on the first asset (entrySource: signal on the decision node) open and close the whole pair, with the hedge sizing the owner chose (beta-neutral, dollar-neutral 1:1 or custom weights; there is no default). modeContracts lists both entry sources. Basket ranks those markets by one score, buys one end of the ranking and optionally shorts the other. Which end is long depends on the score: the highest for momentum, roc, macd, ma_dist, oi_change, cvd and taker_delta; the lowest for rsi (most oversold), volatility (calmest), funding (carry), lsr (least crowded long) and liq_imbalance. Use mode spread or basket, ordered assets and a 1H, 4H or 1D timeframe. Search modeContracts for node parameters and trigr_get_recipes for spread and basket examples. Validate, create, edit and backtest use the same graph contract as Studio.

trigr_get_data_coverage accepts assets instead of asset and returns each leg plus common OHLCV windows; an unknown intersection is null. Each backtest costs 50 + 10 * (assets - 2) credits. Results count group trades and identify individual legs separately. Iterate labelled experiments on the same mode, asset set and timeframe. Pair trade and Basket publication, condition diagnosis, ML optimization and Agent mixes are unavailable on this version; walk-forward runs on them like on a single-asset strategy.

A Pair trade that opens on a signal deploys the same way. Its agent reads the entry signal on the first asset at the same bar closes as its backtest, keeps the hedge sizing it opened with, and closes every leg on any pair exit. Each entry node must be one an Agent can run live; otherwise trigr_create_agent refuses it with MULTI_ASSET_SOLO, reason signalEntryNotLive, which says why; a check that could not run answers EXECUTION_CAPABILITIES_UNREACHABLE: retry.

To run one, call trigr_create_agent with exactly one slot naming your own Pair trade or Basket and no riskGuard. It creates a paused solo Paper agent (MCP creates Paper agents only; Hyperliquid and Propr Pair trade and Basket agents are deployed from the Trigr app, from the strategy page or Studio; on Propr, legs follow your Propr account’s margin mode and rules), trading exactly the strategy’s assets together, one leg per asset, at the strategy’s own size and risk. Add sizeScale (a whole number from 1 to 5; 1 is the strategy’s own size) to run it at that multiple of the strategy’s size, as the size choice in the Trigr app does: positions are that many times larger, and leverage is raised only where the size needs it, where a leg can be liquidated sooner. The backtest stays the one run at the strategy’s own size, and a size the recipe cannot run at is refused (MULTI_ASSET_SOLO, reason sizeUnavailable). With ordinary strategies a sizeScale above 1 is refused (SIZE_SCALE_MULTI_ASSET_ONLY). The create uses the strategy’s latest completed backtest from Studio or MCP history, so no new backtest is needed after a reload; without one the create is refused (MULTI_ASSET_SOLO, reason backtestRequired). A backtest from an engine or dataset agents no longer accept is refused with reason backtestOutdated: re-run it. No strategies can be added or removed later. trigr_edit_agent can rename and pause it; trigr_start_agent starts it (or the owner presses Start in the Trigr app). Its first Start fixes the replay start time and Pause / Resume keep it; that first Start is refused if the strategy changed after the agent was created.

MCP

POST https://trigr.xyz/mcp implements stateless Streamable HTTP with JSON responses. Codex and Claude Code discover Trigr's OAuth metadata, open a browser authorization flow, and store the resulting revocable credential. Manual API-key Bearer authentication remains supported. MCP tools wrap the same validators, quotas, credit controls, and owner boundaries as the REST endpoints. Strategy writes, publication and unpublication, paused PAPER-agent creation, safe agent edits, backtests (agent-mix backtests included), and optimization use a short-lived, single-use authorization bound to the exact tool arguments. trigr_publish_strategy requires the current strategy recipeHash and calls the normal owner publication pipeline: email, paid-plan, ownership, graph, venue-provenance, and stored verified full-history backtest gates still apply, and it never starts hidden compute. An optional builderFeeBps sets the builder fee copiers pay per fill, rounded and clamped to 1-5 bps exactly like the Studio publish dialog (an inherited fee on a strategy built on another creator's strategy is kept). The fee is a backtest input, so a new fee clears the stored backtest: that call saves the fee and returns the backtest requirement; run trigr_run_backtest over full history, then publish again. Successful publication returns a compact receipt with the strategy ID, name, version, bound recipe hash, and Studio and marketplace URLs. A trigr_unpublish_strategy call uses the same exact-action and recipe-hash binding, delists without deleting immutable versions, and leaves existing subscribers pinned. A connection can require a browser confirmation for each action or auto-approve those exact actions for autonomous operation; the owner can change the mode at /settings/agent-access/permissions.

Two tools are free and need no authorization. trigr_validate_graph takes a graph, a strategyId, or both, and runs the authoring schema, the create/edit graph checks, and the graph checks /api/v1/ml/backtest applies before billing (the same functions), plus data certification as warnings, without saving or running anything. When the backtesting engine offers it, the engine's own validation runs too (stage engine): formula errors carry their path and a 0-based character position, and the explainer and warm-up come from the engine; otherwise engine.status is skipped with the reason. Run settings (frictions, builder fee, a bounded window) are not part of validation. Strategies gated by a trained ML model backtest in Studio, not through the API or MCP, and refuse graph edits until the model is detached; validate reports both. It returns ok, errors and warnings (each with its stage, code, message, node id or field path, and a suggestion), a structural explainer, liveSupport for the backtest, paper-track and agent tiers, and a warmup estimate in bars. With a strategyId and a graph, the graph is checked as an edit of that strategy and matchesSavedRecipe says whether it is the saved recipe; with only a strategyId, the saved recipe is checked. The backtesting engine still validates the graph during a backtest, and a refused run is not charged. trigr_diagnose_strategy returns Studio's per-condition pass-rate diagnostic for a graph or an owned strategyId: entries per year, each condition's pass rate, the binding condition, and one proposed relaxation. It shares Studio's diagnostic rate limit and covers crypto markets with catalog-indicator conditions. The server instructions and prompts tell agents to validate before every create, edit, or backtest.

A graph refused by trigr_create_strategy, trigr_edit_strategy, or /api/v1/graph-strategies keeps its stable error and errors fields and adds details: for each finding, the field path with node indices (or the node id), the offending key, a readable message, and a suggestion — for example Did you mean "length"? for a mistyped indicator parameter. Indicator and API nodes accept only their catalog parameter keys plus tf; a legacy alias the engine still reads, such as period for RSI, is refused with the catalog key to use instead.

trigr_create_strategy does not save a second strategy on a mode, asset set and timeframe the owner already has a graph strategy on (a Pair trade or Basket matches on its legs in any order). Instead it returns a successful result with created: false, reason: "ITERATE_EXISTING", and the matching strategies as candidates (id, name, mode, assets for a Pair trade or Basket, market, timeframe, last update), so the agent iterates on one of them with labelled experiments. The same check runs when the approval is requested and before it is consumed, so a refused draft spends no approval or credit. Pass newStrategy: true only for a genuinely different idea or when the owner explicitly asks for a separate strategy; it is part of the approved arguments. trigr_list_my_strategies returns each strategy's market and timeframe so the right one to iterate on is easy to find.

trigr_run_backtest takes an optional frictions object with the same meaning as Studio's Results → Frictions: slippage with slippageBps (per side, above 0 and at most 250), and funding with an optional flat fundingRate per 8 hours as a fraction (at most ±0.01). Without fundingRate, funding uses the real point-in-time historical series; non-perp markets accrue none. Omitting frictions runs gross. The applied costs are returned in the result's frictions block.

Every run is also split in-sample / out-of-sample: by default the first 70% of the window's bars are in-sample and the rest out-of-sample. The result's oosSplit block reports each side's return, Sharpe, max drawdown, win rate, trade count and window (trades count on the side where they entered); the headline metrics stay full window. Pass oosSplit: { enabled?, inSamplePct?, splitAt? } to change it: inSamplePct from 50 to 95, splitAt an ISO instant or epoch milliseconds (it overrides the percentage), or enabled: false to turn it off. Read effectiveWindow, windowClip and boundingInput to see what the strategy's data covers before narrowing it with backtestWindow. The split is a time split of one run, not a holdout: once its out-of-sample side has informed a choice it is research data, so validate the chosen recipe with a paper forward test.

A run with an owned strategyId (each batch variant included) also returns tries: the number of distinct variants backtested so far, this one included, across all your strategies on the same assets and timeframe, from Studio, Copilot, MCP, the API and ML optimization. A variant is the graph plus its enabled frictions, window and out-of-sample split (titles and node names don't count), so the same variant run again is not a new try, and replaying a requestId never counts twice. triesIsLowerBound is true when part of the count was rebuilt from pruned Studio history, or one of those strategies has earlier runs not counted yet (read it as “at least”). The more variants tried, the more likely the best one is luck: quote the count with any winner.

Final exam. A strategy created since the final exam was introduced keeps its most recent data sealed for one final exam, and every result of it carries { finalExam: { status, sealFrom, inProgress, offReason, note, result } }. status is pending until its first backtest, which fixes sealFrom: the data end minus the longer of 6 months and 15% of its history, capped at 12 months, on a UTC day. It is off (with offReason) when under 18 months of price history would remain before the seal, or its timeframe's 75,000-bar limit cannot hold the seal plus 18 months (always at 5m; at 15m on markets with over ~4 years of history) (short_history), an input has under 6 months before it (short_inputs), the recipe reads AI Sim, copy trading or an uploaded series (unsupported_inputs), there is no stored price history at its timeframe (no_coverage), it was measured over its full history before its first backtest (already_explored), its exam run could never be graded (exam_unreadable), or the owner switched it off before that backtest (opted_out; MCP trigr_create_strategy takes finalExam: false, and trigr_get_data_coverage takes a strategyId to report it). While sealed, every run of the strategy (saved recipe or experiment, each batch variant) ends at sealFrom: a full-history request explores from the first bar to the seal and returns explorationEnd, is kept as a bounded run and never becomes verified statistics; a backtestWindow ending after the seal is refused with 422 EXAM_SEALED before any charge; ML optimization and a combined backtest of the draft are refused with EXAM_SEALED; publishing is refused with FINAL_EXAM_REQUIRED. No metric of the sealed period is returned before the exam. trigr_take_final_exam costs 50 credits and its approval is bound to expectedRecipeHash (the saved recipe's recipeHash); request it only when finalExam.status is sealed and inProgress is false. It runs the current saved recipe over full history, split at the seal (on its first bar at or after the seal: for a stock sealed on a weekend or before the open, the next session's first bar), once, and grades the held-back side on the after-costs split (basis: net), on that split with a permanent gap disclosed (net_partial, named in basisNote), or on the run's own split when the service returns no after-costs block (gross). EXAM_RESULT_RETRY (503) means after-costs data is still arriving: nothing was spent or charged, retry later. EXAM_RESULT_UNREADABLE (422) means the run can never be graded: the exam is switched off (exam_unreadable) and nothing is charged. RECIPE_CHANGED means the saved recipe changed: re-read recipeHash and request a new approval. EXAM_NOT_AVAILABLE, EXAM_IN_PROGRESS, EXAM_ALREADY_TAKEN, RECIPE_CHANGED and INSUFFICIENT_CREDITS are checked before the approval is used. Before the final exam is switched on it returns EXAM_NOT_AVAILABLE. The original run remains the publication basis. It stamps result: { verdict, basis, basisNote, takenAt, window, exam, exploration, versionDigest }. verdict is passed (profitable, and an exam Sharpe at least half the exploration Sharpe), weak (profitable below that), failed (lost money) or too_few_trades (under 10 exam trades). A retry returns EXAM_ALREADY_TAKEN with the stamped result; later runs are full history again and may become the verified statistics.

Every completed result (each batch variant and each stored run read back included) also carries a robustness block, the same read Studio shows as its overfit-risk badge: { overfitRisk, reasons, tries, triesIsLowerBound, luckSharpe, deflatedSharpeProb, oos, exam, robustnessScore, robustnessScoreRaw, robustnessScoreNote? }. overfitRisk is low, medium or high; reasons lists { code, severity, text } with the high ones first. luckSharpe is the annualised Sharpe luck alone could reach after tries (the expected best of that many no-skill trials, Bailey and López de Prado 2014) and deflatedSharpeProb the 0–1 chance the true Sharpe beats it, computed per bar from the run's Sharpe, bar count and return shape; the trial dispersion is the variance of the strategy's recorded trial Sharpes, put on this run's horizon first and never below the Sharpe's own sampling variance (which it is with fewer than five). Units: oos.*.returnPct is percent, oos.*.sharpe and luckSharpe are annualised like the headline, deflatedSharpeProb is a 0–1 fraction and robustnessScore is 0–100, capped by the overfit risk (High at most 39, Medium at most 69, with robustnessScoreNote "capped by overfit risk" when the cap lowered it); robustnessScoreRaw is the score before that cap. An out-of-sample side with no trade (any P&L there is from positions opened before the split) is never judged on its return or Sharpe: it reads only as too few to judge. On any split other than the default 70/30 (a custom split date or share, the exam's recipe split at its seal included) the same holds under 10 out-of-sample trades, the exam's grading minimum; the default 70/30 split judges any trade. High: the out-of-sample side lost money while in-sample made money (on a side judged as just said), a probability under 0.5, under 20 trades, a failed exam, or Pair trade / Basket leg liquidations that cost more than 10% of equity combined or ruined the book (leg_liquidation; on a Pair trade, when the run's complete trade list allows it, the threshold reads what the liquidated positions lost with every leg counted from entry with costs (their losing bars compounded, percent of the equity they were opened with; on a strategy judged after costs, read from the run before the default slippage and funding, which the reason says), and the reason gives that next to the liquidated legs' own loss; on a Basket, or without a complete trade list, it reads the liquidated legs' own loss). Medium: a probability of 0.5–0.9, an out-of-sample Sharpe under half the in-sample one, 20–49 trades, under 20 out-of-sample trades, no scored split, a split moved from the default 70/30 (judge on the default: moving or disabling it never reaches Low without a passed exam, and its thin side is only too few to judge; a run of the exam's recipe split at its seal and reaching the exam's end is not a moved one), unknown tries (tries_unknown), a positive Sharpe that could not be luck-adjusted (luck_unknown), a loss over the whole run (run_loss, after costs when costBasis is after_costs), or any leg liquidation (leg_liquidation, which a passed exam never lowers). Low otherwise, which means no red flags were found, never that the strategy works; Low with an out-of-sample lowTradeCount true is still too thin to confirm. This is not the ML optimization's robustness block (PBO). exam holds the final exam's { verdict, versionDigest, matchesRecipe } once it is taken, otherwise null: a failed exam makes every recipe of the strategy High; a passed one lowers Medium to Low only for the exact recipe that took it (exam.matchesRecipe: true), read in the derived form every new write stores: when the saved recipe that took the exam is stored in that form, its nodes sent with edges: [] are that recipe, with or without an experimentLabel (a graph with an ML node matches only exactly). A run without a strategyId (or whose count failed) has tries: null, luckSharpe and deflatedSharpeProb null and the medium tries_unknown reason: never pick a winner from such detached runs, they are not counted. Every distinct variant (graph, enabled frictions, window and split) run on an owned strategy counts as a try, counted across all your strategies on the same assets and timeframe, and a variant whose overfitRisk is high is never the winner, whatever its full-history figures. Change the strategy, never the measurement: do not move, shrink or disable oosSplit, drop the strategyId, or open a new strategy to reset tries (one on the same assets and timeframe keeps the count). trigr_get_backtest_result judges a run read back against the tries counted now, so its level can rise as more variants are tried; a batch reports its final tries.

A strategy result may also carry net: the same run re-simulated with the house default costs, slippage per fill by liquidity tier (BTC/ETH 2 bp; SOL, XRP, DOGE, BNB, AVAX, LINK, SUI and unknown assets 5 bp; other crypto 10 bp; stocks, indices and commodities 5 bp) plus real point-in-time funding of the traded venue (Binance USDT-M funding when the venue's history does not cover the window, frictions.funding.fallback: true). The headline fields are unchanged and still follow your own frictions; verified statistics and publishing read the headline. status is ok (every default cost charged), partial (partialReasons lists { code, retryable, detail } for each cost not charged; retryable: true means a later re-run can come back ok) or unavailable (no figures, only status and note). Figures: returnPct, sharpe, maxDrawdownPct (≤ 0), winRatePct, profitFactor, tradeCount, headlineReturnPct, costDragPct (headline minus net, in final-equity points; negative when funding received outweighs the extra slippage), costs { feesPct, slippagePct, fundingPct, frictionPct } in percent of the starting account (fundingPct negative = received), equitySummary, oosSplit after costs and frictions (slippage tier and bp per fill, funding venue and coverage). MCP leaves out net.equityCurve and the display strings net.metrics; the API returns them. A frictions override only raises net costs (slippage is the larger of the tier default and your slippageBps; your funding rate or venue never change net). Older runs have no net: judge on the headline then. When its status is ok, or partial with every partialReasons[].retryable false, judge and report on the after-costs figures; otherwise use the headline and say costs are not settled yet. Studio leads with the after-costs return for strategies created after the after-costs rule was switched on, when net is ok or partial with only non-retryable reasons; for those runs robustness.costBasis is after_costs and robustness.oos and its reasons read net.oosSplit, while robustness.sharpe, the luck figures and the trade-count rules read net.sharpe and net.tradeCount. Otherwise costBasis is original. Existing strategies keep their original headline. Pair trade and basket results carry the same net: a basket charges every leg its own liquidity tier, a Pair trade every leg the highest of its legs' tiers (frictions.slippage.mode per_leg_tier / max_leg_tier, per leg in legs), plus each leg's real funding; partialReasons[].asset names the leg a cost was not charged on. They are judged on it the same way, and their splits count positions in tradeCount, with the leg fills as legTradeCount.

Stored runs are free to read. trigr_get_backtest_result lists a strategy's recent runs (Studio runs included) with the settings each used, and returns one run's figures by the requestId you chose or a listed clientRunId. trigr_get_backtest_trades pages through that run's trade log (offset, limit up to 200). Trade prices are reference prices before slippage, and netPnl is in units of an account that starts at 100, not USD; both returns and P&L are after fees and frictions. A run that was not stored (no owned strategyId) returns its first 100 trades inline instead.

To iterate, pass experimentLabel to trigr_run_backtest together with the owned strategyId (see /api/v1/ml/backtest above). Each listed run in trigr_get_backtest_result carries its label, an experiment flag, and isSavedRecipe (whether it measured the recipe currently saved, identified by savedRecipeHash). The server instructions and the build_strategy and improve_strategy prompts tell agents to keep one strategy per idea and iterate inside it this way.

trigr_create_strategy, trigr_edit_strategy (when the edit carries a graph), and a completed trigr_run_backtest return liveSupport: { paperTrack, agent }. Each side has supported and an issues list of { code, nodeId?, message } naming the failing node and rule: paperTrack says whether a published version would accrue the marketplace paper track, and agent whether the graph passes the Agent graph check. The verdicts come from the same gates publication and Agent creation use; agent judges the graph only, so venue, asset, and account admission still apply when an Agent is deployed. The server instructions carry a matching LIVE / PAPER SUPPORT CONTRACT listing what runs forward and what stays backtest-only, so an agent can fix a backtest-only node before calling trigr_publish_strategy. Catalog data sources and AI Sim also carry liveSupported: the static forward-run policy, not feed freshness. A live-supported series runs forward only while its feed is current, which trigr_get_data_coverage reports per asset as canLive; a delayed, stale, or missing feed blocks Agent deploys until it recovers.

trigr_get_optimization reads ML optimizations the owner started anywhere, including Studio's Optimize with ML panel. Pass strategyId without jobId to list that strategy's optimizations newest first (limit 1–20, default 5). Pass jobId to poll one job; with both, the job must belong to that strategy (else JOB_NOT_FOUND). A succeeded job adds a presentation block: the held-out before/after test, robustness checks (leak verdict, deflated Sharpe, PBO), top features, and every suggestion card in Studio's wording, each marked graph_change (with its graphPatch) or research_note. A card is a graph_change only when Studio's Apply all could apply it to the strategy's current saved graph; otherwise graphChangesBlockedReason says why. The raw engine result is trimmed to its headline keys and rawResultOmitted lists the rest; pass includeRawResult: true for the full payload (methodology and both full backtests, tens of kilobytes). Reads are free and never re-run anything.

When a strategy trades both sides, some conditions are read per side: directional data series such as funding are mirrored for shorts, while open interest, activity counts, and explicit level conditions such as RSI < 30 apply to both sides as written. The backtest explainer reads the engine's actual per-side masks. Under exit on flip with an all-mode entry, a failing entry condition closes the trade. Two opt-in params change this, both off by default and honoured by backtests, the paper track, and live Agents: FILTER sides: "same" gates shorts with the same written condition as longs (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, e.g. funding, long/short ratio, or fear & greed; refused with 422 elsewhere and on graphs with an ML node), and RISK filtersCloseTrades: "false" makes filters gate entries only, so flip exits follow the trigger alone (refused on ML graphs and copy-trigger strategies). Optimize with ML and ML training (and copy composition) refuse a graph that sets either param; remove them first. See how filters behave on two-sided strategies.

trigr_run_backtest_batch runs 1–10 such experiments of one owned strategyId under ONE approval: variants is a list of { experimentLabel, graph, frictions?, backtestWindow?, oosSplit? } and maxCredits caps the spend. The approval binds the exact arguments, so it authorizes exactly that variant set and cap, once. Variants run sequentially (one backtest per account is in flight at a time), each billed and stored as <requestId>.<content digest> (so re-sending a finished variant under the same requestId reports it already_settled instead of charging it again); a variant waits out another running backtest of the account (Retry-After) within the 240 s budget; a variant starts only while a full 50-credit run still fits under the cap, failed runs are free, and AI Sim graphs are refused. The result lists each variant's status (ok/already_settled/error/skipped), creditsUsed, requestId and headline metrics. A batch counts as one request per variant against the 60/min MCP account limit.

Walk-forward (single-asset, Pair trade and Basket strategies). Add walkForward: { folds: 3–6, anchored: true, window: { start, end } } to a batch of 2–10 variants that carry no backtestWindow or oosSplit (use the window of a full-history result). The window is cut into folds + 1 equal segments (inner cuts on whole UTC days, each at least 14 days). Fold k runs every variant once, bounded to the window start through segment k + 1, with oosSplit.splitAt at the start of segment k + 1; the variant with the best in-sample Sharpe (then return, then declared order) is the fold's pick and its out-of-sample side is the fold's score. Cost: variants × folds runs (at most 60; maxCredits up to 3,000, or what a Pair trade / Basket walk-forward's runs cost together), each a bounded labelled experiment (“<label> · WF k/K”). Tries: each variant counts as ONE try for the whole walk-forward (its graph, frictions, the walk-forward window and the fold count, with no Sharpe of its own), so 10 variants × 6 folds is 10 tries, not 60; batch.tries is the count after them. Rate limit: a walk-forward counts one request per declared variant against the 60/min MCP account limit; its fold runs are internal and paced one at a time. Before the approval is used and before anything is charged, the window is checked against the market's candle coverage and the variants' indicator warm-up: a start before the data, or a warm-up over 25% of the first fold's training segment that the candles before the window cannot cover (a single-asset run warms its indicators, each at its own timeframe, from earlier candles where the market has them), is refused with WALK_FORWARD_WINDOW_UNCOVERED and earliestValidStart; unreadable coverage is refused with WALK_FORWARD_COVERAGE_UNKNOWN (retry later). A Pair trade or Basket variant runs the same folds: each fold run splits at the fold date (oosSplit.mode date), its coverage is the latest first candle among its legs, its warm-up is its own lookbacks, and a variant its backtest would refuse is refused with that backtest's code before the approval is used. Each of its runs costs 50 + 10 per asset beyond two, so maxCredits may go up to what all runs cost together. The result carries walkForward: status (complete; incomplete when runs are missing; unscorable when every run finished but a fold cannot be scored), foldResults (windows, the pick with both sides, and unscoredReason: runs_missing, run_failed (a run refused for good, not charged), split_unscorable, window_clipped, misaligned or winner_out_of_sample_incomplete), earliestValidStart (set when the data clipped a run's start), stitchedOutOfSample (returnPct compounded over the folds, foldsProfitable, tradeCount, meanFoldSharpe, meanInSampleSharpe, efficiency, worstFoldMaxDrawdownPct) and selectionStability (mostSelected, stability 0–1, distinctWinners), plus one compact row per run in runs. A fold is scored when every variant's in-sample period starts within one timeframe bar of the others (not of the requested start) and ends at the cut. An incomplete walk-forward (time budget or credit cap) continues under a new approval for the same arguments and requestId: finished runs replay free, a run whose result was lost before it was charged runs again (charged once), and a run refused for good is reported without blocking the others. An unscorable one does not change on a retry: change the window, the folds or the variants.

Stress tests over MCP

Stress-test a saved backtest with trigr_quote_stress_test. Show its total credit quote, then approve trigr_run_stress_test with that exact test ID and maximum (maxCredits equal to creditsQuoted). trigr_get_stress_test reads progress; advance: true continues the already approved plan, and cancel: true stops unstarted checks. Monte Carlo is free; random entries and each comparison run cost at most 50 credits. Failed or skipped checks cost nothing. Results cover trade-order risk, higher costs, nearby settings, random entries and correlated markets. Checks respect the final-exam seal and never replace verified statistics. Comparison runs are robustness checks, not tries: they never add to tries or the luck-adjusted Sharpe. A stopped test can be quoted again for the same backtest. A pass means no red flags were found, not that a strategy works.

Refusals: STRESS_UNAVAILABLE: read message; “cannot be reached right now” is temporary, retry in a minute; otherwise the backtester does not offer stress tests yet and nothing runs. STRESS_REQUOTE: fees or permissions changed, quote again. STRESS_EXAM_SEALED: pick a run from before finalExam.sealFrom. STRESS_BUSY: another request is quoting or stopping the test, retry shortly. STRESS_CONFIRM_PRICE: maxCredits is not the quote, or a quoted test was advanced before it was started. INSUFFICIENT_CREDITS (402, with needed and balance): add credits. These are checked before the run's approval is created and again before it is used. STRESS_SERVICE_RETRY, STRESS_VARIANT_RETRY and STRESS_RETRY (503): the started test is saved; continue it with advance: true shortly, and no completed check is charged twice. STRESS_SETTLEMENT_PENDING: a check is dispatched or unsettled, so advance it before cancel: true.

Prop firm challenges over MCP

Two free tools and a free option answer “would this pass a prop firm challenge?” before anything is deployed. trigr_list_prop_challenges lists the Propr challenges with their full rules, fee, a fair-game pass rate for reference and where the rules were verified. trigr_simulate_prop_challenge replays one on a backtest already stored for an owned strategy, and trigr_run_agent_backtest with propChallenge replays it on an agent mix's combined curve at no extra cost (the agent backtest itself is metered as usual). propChallenge takes a preset id and/or custom rules, plus sizeScale, dailyGuardPct, attemptStartDay, monteCarloPaths and horizonDays. The answer leads with a Monte Carlo pass probability within the horizon beside the same simulation with the days' drift removed (how often a strategy with no edge passes in that horizon) and the difference in points over the attempts both runs share (with dailyGuardPct neither is available: compare the pass probability with and without the guard), then every daily start of the history, a fidelity label and caveats. See prop firm simulator for how each rule is measured.

Agents over MCP

An assistant can build and size agents of up to 52 strategies, one per asset. trigr_suggest_agent_lineup (free) returns the best deployable Trigr Official strategy for each asset as ready slots. trigr_run_agent_backtest is the MCP form of /api/v1/agents/backtest; it waits up to about 40 seconds for a cold run and otherwise answers pending, which trigr_get_agent_backtest reads with the same jobId and job. trigr_create_agent creates a PAUSED PAPER agent from the same slots (each with an asset, and a pinnedVersionId or the owned draft's current expectedRecipeHash); the list order is the entry priority. A new PAPER agent always starts with a fixed $10,000 balance: the tool takes no capital, and a capital an older client sends is ignored. trigr_edit_agent renames or pauses an owned agent and, on a PAPER agent, replaces its whole strategy list with patch.slots (list order is the 0-based priority) under the expectedConfigRevision from trigr_list_my_agents. An existing agent's capital cannot be changed — patch.capital may only repeat the stored value, any other value is refused with INVALID_CAPITAL (after performance tracking starts, with IN_USE), and Hyperliquid and Propr size off the account balance or the attested challenge. Changing strategies or allocations needs the agent effectively paused (pause it in an earlier edit, else IN_USE); restart a PAPER agent with trigr_start_agent. A slot resent with its current pinnedVersionId keeps any risk override set in the app. Resending the same slots in a new order only changes their entry priority: allowed on a running agent, effective from the next bar, it drops no pending entry and does not change configRevision.trigr_start_agent starts an owned PAPER agent (its expectedConfigRevision from trigr_list_my_agents, after its own approval) with the same checks as the app's Start; a Hyperliquid or Propr agent is refused with LIVE_AGENT_START_APP_ONLY and starts in the Trigr app. trigr_pause_agent pauses an owned agent on any venue. Saves in the Trigr app never change the order. trigr_list_my_agents returns slots in priority order with their pins, each agent's committedPct and its entryMarginPolicy. A Pair trade or Basket agent is one unit: its committedPct is null, its leg slots carry a legIndex instead of an allocation, and multiAsset describes the group. Agent refusals carry their stable code in code and the readable message in error. A strategy sized under the venue's minimum order is never refused: when its allocation covers the minimum, the entry is raised to it (subject to free margin); otherwise the slot waits until equity grows. Hyperliquid and Propr agents, their strategy changes, Propr challenge plans (at most six strategies whose allocations sum to exactly 100%), and starting any agent stay in the Trigr app.

Reading an owned agent is free and needs no approval: trigr_get_agent_status, trigr_get_agent_performance (window 7d, 30d or all, with per-strategy rows that sum to the agent totals), trigr_get_agent_positions and trigr_get_agent_trades (newest first, cursor paging, filters by slotId, strategyId and market). Another owner's agent id answers NOT_FOUND, like a missing one; a figure Trigr could not read comes back unavailable, never zero. See Read your agents for the fields and an example.