Backtesting

Test on point-in-time data, with disclosed costs

Backtests run on the Trigr engine over point-in-time market data: every feature is computed only from information available at the bar's close. The result includes equity, monthly returns, trade-level detail, and an audit trail. Trading and builder fees are applied. Optional flat slippage and perpetual funding default off, so the initial result is gross before those two costs and is not a forecast of live execution.

Execution frictions

Trading and builder fees are included in every run. Slippage and funding are separate, opt-in assumptions. When enabled, each appears as a line item with a before/after delta.

Flat slippage

When enabled, the engine applies the positive basis-point value you enter as an adverse adjustment to every entry and exit fill. A missing or zero value is rejected rather than silently enabling a zero-cost model.

  • Modeled: your flat bps-per-fill assumption, applied in the unfavorable direction.
  • Not modeled: live spread or order-book depth, volume participation, market impact, latency, or volatility-dependent slippage.

There is no automatic house slippage estimate or liquidity-tier price adjustment. Choose a flat assumption that fits the market and order size you are researching.

Funding

When enabled for a perpetual, funding accrues at each ~8h settlement while a position is held and is signed by side. Leave the rate blank to use the service's point-in-time source-venue funding series, or enter your own flat %/8h assumption. Non-perp markets carry no perp funding. Source-venue history is not a quote for the rate another venue would have charged.

Intrabar handling

  • Replay, then stop-loss first. If TP and SL both fall inside one bar on a timeframe coarser than 5 minutes, the engine replays that bar on 5-minute candles to find which level was hit first. On 5-minute strategies, when a 5-minute candle is itself ambiguous, or when finer data cannot be loaded within the run's time budget, the SL resolves first (the conservative outcome).
  • No fabrication. If a required input is missing for a bar, the engine doesn't invent a value; the signal stays pending rather than firing on guessed data.

Pair trade exits

A Pair trade that opens on a signal decides at each bar close and fills at the next bar's open on every leg. Its take profit, stop loss and trailing stop read pair P&L at every closed 5-minute bar while the pair is held and fill at the 5-minute close that crossed (a leg without 5-minute data falls back to the bar close, reported in intrabarExits), the same in Agents. Each trade carries the reason it closed, checked in this order: stop loss, take profit, trail, exit rule, flip, time (maxBars); liquidation, ruin and the end of the data close a pair too. The trail's peak starts at entry (before any profit it is a stop trailPct below entry), a flip is the signal leaving the position's side (going flat included), and a pair never exits and re-enters on the same close. A signal on a bar the hedge legs have no data for is dropped and counted. The result shows the hedge weights each entry used.

Reading the results: luck-adjusted Sharpe, not raw Sharpe

A tuned strategy can post a flattering Sharpe by luck. Every strategy backtest compares its Sharpe with what luck alone could reach after its tries (see Overfit risk below), and the Robustness Score uses that figure. The overfit risk also caps the score: a High risk shows at most 39 and a Medium risk at most 69, marked "capped by overfit risk", so a likely-overfit run never reads as robust. An Optimize with ML run adds the same luck check over the models it compared (shown as DSR, the deflated Sharpe ratio), and PBO:

  • PBO (Probability of Backtest Overfitting): a separate check over many splits of the history (a CPCV grid) of how often the choice that looked best on the earlier part does worse on the later part. That grid does not select the saved ML model or its parameters.

Raw Sharpe is still shown, but demoted. The luck check and PBO add robustness evidence; neither guarantees a live edge.

Built on and checked on: the time split

A Studio strategy backtest splits the strategy's own covered period by default: it is built on the first 70% and checked on the last 30%. Right under the headline, results show what the strategy did on the period it was built on and on the later period it was checked on (return, Sharpe and trades, with a caution when a side has too few trades). More details holds the full comparison (window, return, Sharpe, max drawdown, win rate and trade count), and the equity and monthly charts shade the later period. The headline numbers still cover the full window. Strategies driven by a copy source run on the copy engine and have no split.

  • Setting. In Backtest configuration, switch “Out-of-sample split” off or set the built-on share anywhere from 50% to 95%, then re-run.
  • Trades. A trade belongs to the side where it was entered. A position open across the split counts as a built-on trade, and its profit or loss after the split counts toward the checked-on return; the results say when that happens.
  • Too little data. Each side needs at least 30 bars. With less, the results say the split could not be scored instead of showing numbers. A side with fewer than 20 trades is marked as too few to judge.
  • Switched off. With the split off (or too short to score), the robustness score falls back to a recent-period read of the same curve, so switching it off never improves the score.

It is a time split of one backtest run: the later period is only a clean check if the strategy was not tuned on those bars. Once you tune or pick a strategy after reading that period, it becomes part of your research data, so a strong number there after many edits is weaker evidence than the same number on the first run.

An honest final check reserves a later period before research, freezes one winner and all cost assumptions, then evaluates only that unchanged winner on the untouched period. If it fails, do not tune against the same period again or substitute a runner-up. Normal strategy backtests use full available coverage and do not accept arbitrary general date windows, so for a fresh final check use the walk-forward test of ML optimization where applicable (each step is scored only on data its choice never saw), or collect new paper-forward data after freezing the winner.

Tries

Every backtest of a saved strategy counts how many different versions have been tested so far across all your saved strategies on the same assets and timeframe, its tries: a new strategy on the same market does not start again from zero. A version is the strategy's logic and risk settings plus the costs it was run with, its date window and its built-on / checked-on split (moving or switching off the split is a new try), so running the same version again is not a new try. Titles and node names don't count. Runs from Studio, Copilot, MCP, the API and ML optimization all count (an ML optimization adds each model it compared). The more versions you try, the more likely the best one is luck, which is why the count travels with the result.

Strategies that had backtests before tries were counted start from what their saved history still holds; older history is pruned, so their count reads as “at least N” for good, and so does the count of your other strategies on the same assets and timeframe (also until that history has been read, at the strategy's first counted run). API and MCP results carry the count as tries and triesIsLowerBound; a run without a strategy id has none.

Walk-forward for parameter sweeps

Picking the best of several parameter settings on the same history you report is optimistic by construction. A walk-forward test (MCP: trigr_run_backtest_batch with walkForward) cuts the history into 3 to 6 folds. In each fold it picks the setting that did best on the bars before the fold, then scores only that pick on the fold itself. The stitched result of those picks, and how often the same setting won, tell you whether choosing parameters this way would have held up. It costs one backtest per setting per fold, shown before you approve, and each setting counts as one try for the whole test (10 settings over 6 folds is 10 tries, not 60). It works the same on a Pair trade or Basket: every fold run splits at the fold date, and the coverage check reads every leg.

Before anything is charged, the window is checked against the market's data and the strategy's indicator warm-up: a start before the data, or a warm-up that would use more than a quarter of the first fold's training period (indicators warm up from the candles before the window where the market has them, each at its own timeframe), is refused with the earliest valid start. A fold is unscored if a run did not finish (run the same request again: finished runs are free), or if the data clipped a run's start, the variants' training periods do not start within one timeframe bar of each other, or the selected variant lacks its test history (a retry changes nothing: change the window). On stocks, indices and commodities a fold cut on a weekend or holiday splits at the next session's first bar. Returns are compounded before display rounding.

Overfit risk

Every result shows one quiet line, Overfit risk: Low, Medium or High, with the tries behind it, such as “37 tries · luck alone could look this good”. Tap it for the reasons in plain words, how the Sharpe compares with the best of that many versions with no edge at all, and the odds it beats luck.

  • High when the strategy made money on the period it was built on but lost money on the period it was checked on (a checked period with no trade opened in it is only too few to judge: any P&L there is from positions opened before it; so is one with fewer than 10 trades when the split was moved from the default), when luck alone could explain the result (chance the edge is real under 50%), with fewer than 20 trades, or after a failed final exam.
  • Medium when that chance is 50% to 90%, the checked period's Sharpe is under half the built-on period's (not when the checked period is too few to judge, as above), the run has 20 to 49 trades, the checked period has fewer than 20 trades, there is no checked period at all, the split was moved from the default (built on the first 70%, checked on the last 30%), or the tries could not be counted (a strategy that is not saved yet: save it to count tries).
  • Low otherwise. Low means no red flags were found, not that the strategy works.

Judge a strategy on the default split. Moving the split or switching it off never reaches Low without a passed final exam (a moved split's thin checked period only reads as too few to judge), and every version aimed at the badge is one more try: change the strategy, never the measurement.

The luck adjustment is the method of Bailey and López de Prado (2014), known as the deflated Sharpe ratio. It compares the run's Sharpe, per bar, with the expected best Sharpe of as many no-skill versions as you tried, using how widely your versions' Sharpes spread, the number of bars and the shape of the run's returns. With fewer than five recorded Sharpes, and as a floor otherwise, that spread is the Sharpe's own sampling noise over the run. Versions run over different windows are put on this run's horizon first (a 6-month run is noisier than a full-history one). When the tries cannot be counted, no luck figure is shown and the score keeps its capped heuristic: unknown tries never read as one try. Studio, Copilot, MCP and the API all use the same rules; MCP and API results carry them as the robustness block. The Robustness Score now uses this luck-adjusted figure when there is one, so the heuristic ceiling no longer applies (the overfit-risk cap above still does).

After costs

Every strategy backtest is also re-run with realistic default costs: slippage on every fill by how liquid the market is (BTC and ETH 2 bp; SOL, XRP, DOGE, BNB, AVAX, LINK and SUI 5 bp; other crypto 10 bp; stocks, indices and commodities 5 bp) and the real funding the traded venue paid or charged over the window (Binance funding stands in where the venue's own history does not cover it). Your own cost settings still drive the main figures; the after-costs run sits next to them.

Once the after-costs rule is switched on, strategies created after that moment lead with the after-costs return (“After costs”), say right under it which costs it includes, and show the return before slippage and funding on the next line. Their run history shows the after-costs return too. Strategies created before the switch keep their headline exactly as before. When a cost cannot be charged for good (for example funding on a market without funding history), the headline says which; when a cost is only missing for now (funding not stored yet), the run keeps its original headline until a re-run settles it. Publishing still checks the main figures; the marketplace card and strategy page of such a strategy show its backtest return, Sharpe and drawdown after costs, labelled “after costs”, with the figures before slippage and funding in the line below. MCP and API results carry the after-costs run as the net block (status, returnPct, sharpe, maxDrawdownPct, costs, costDragPct, the split after costs, and which slippage tier and funding venue were used); older results have none.

The after-costs headline is a separate calculation. When the headline leads after costs, the built-on and checked-on figures under it, the overfit risk badge and Copilot's check on the later period read the split after costs too, so they all judge the same numbers (when a run has no split after costs, those figures say they are before slippage and funding); Copilot cannot claim that check passed when the split is missing. The badge's luck check, its trade count, the verdict checklist, the Honesty Lens and the Sharpe tile read the after-costs figures as well, and a run that lost money after costs is never Low. The chart, the trade list and the figures below them stay on the original run's cost settings, and a note under the headline says so.

Final exam

A tuned backtest can always look good on the data it was tuned on. So a strategy created since the final exam was introduced keeps its most recent data sealed for one final exam. Its first backtest fixes the seal date: the longer of the last 6 months and the last 15% of its history, capped at 12 months. Until the exam is taken, every backtest of it, from Studio, the Copilot, MCP or the API, stops at that date, so the sealed months stay held back from its backtests. These runs stay in your history as research and never become the strategy's verified statistics.

  • Take it once. When the recipe is final, press Take final exam (or let an MCP agent call trigr_take_final_exam after your approval). It runs the current recipe over the held-back months for one standard backtest and grades it for good, after default costs where they are available: Passed (it made money, at least half as steadily as in a profitable backtest), Weak (profitable, but much less steadily), Failed (it lost money) or Too few trades to grade (under 10 trades). After that, backtests cover the full history again. The price is taken before the run and returned if it cannot be graded. A failed verdict counts against every later recipe of the strategy; a passed one only for the recipe that took it.
  • Publishing waits for it. A strategy with a sealed exam can be published only after its exam, whatever the verdict. 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.
  • Some strategies have none. No exam when fewer than 18 months of history would remain to build on, when an input has less than 6 months of history before the seal (the cross-exchange open interest and long/short series, for example, or a new listing), or when the strategy uses AI Sim, copy trading or an uploaded series, or when one backtest cannot reach that far back at its timeframe (a backtest reads at most 75,000 bars: about 260 days at 5 minutes). You can also switch it off before the first backtest that runs; after that it is fixed. Strategies created before the final exam was introduced are unchanged.

A passed exam means no red flags were found on data held back from its backtests. It is not proof the strategy works: backtests are hypothetical, and past results are not advice.

Out-of-sample since publish

Strategy pages and the Agent Live vs backtest tab label the forward record with its start date. After 14 elapsed days, the expected range compounds the backtest's daily log returns over the elapsed days: from their daily mean and standard deviation, the range runs from e^(mean × days − 2 × standard deviation × √days) − 1 to e^(mean × days + 2 × standard deviation × √days) − 1, and the forward record's compounded return (last value over first, minus one) is compared with it. The status says whether the forward return is within, below or above that range.

The daily statistics come from the backtester's own daily summary (computed from the full simulated equity, per UTC calendar day, before the curve is thinned for display) when the run carries it, and otherwise from real daily equity marks before the forward record. Monthly summaries, missing days and sparse historical curves do not provide daily volatility; those records show that the range is unavailable. Existing snapshots and paper tracks are not rewritten. For Agents, the forward window starts at the last change of the Agent's trading configuration (its strategies or their versions, assets, allocations, slot risk or portfolio rules); pausing, resuming or renaming the Agent does not restart it. This is a historical comparison, not a forecast or a guarantee.

Stress test a saved run

Open a saved backtest in Studio, choose Trades, then Stress test. The quote shows the maximum credit cost before you confirm. The five checks cover trade ordering, higher costs, nearby settings, random entries and similar markets. Each row explains whether it passed, failed, remains unclear or is only for information. Unavailable checks are not passes.

Checks use that saved run's recipe and window, even if the canvas changes. They are robustness checks of the run you chose, not new tries: they never add to its tries or its luck-adjusted Sharpe, and they do not replace the strategy's verified statistics. A completed panel shows the actual credits charged. If the connection drops or you leave the page, reopen the same saved run and resume its existing plan. Reopening first reads its saved state without starting more work. Stop ends a running test: checks not yet run are not charged, and Run again starts a fresh test of the same run. When the backtester does not offer stress tests yet, the button is disabled and says so.

Publishing a new version

A new backtestable published version needs at least 30 trades in its backtest and 10 trades in the later period it was checked on: the last 30% of a full backtest with the default split, or the sealed months of its final exam. A missing, disabled or too short split, or one moved to a date you chose, cannot meet that requirement: run a full backtest of the saved strategy, then publish. The API and MCP return LISTING_TRADE_MINIMUM_NOT_MET with the missing requirement. Publication does not run a backtest for you. Unchanged republishing keeps the existing version and its original statistics. New cards can show the tries counted at publication, the final exam grade for that exact recipe, and overfit risk from the same rules used in Studio (Medium and High in a warning colour). A strategy judged after costs also shows its backtest figures after costs. Missing historical risk inputs leave that label absent; older cards are unchanged.

Data coverage

Beta strategy authoring and backtests currently cover 43 certified crypto markets. The broader 53-asset research catalog also lists stocks, indices, commodities, and markets whose history or execution certification is still coming soon. The capability catalog labels the status of every asset explicitly.

Open interest and long/short data come in two families. The default open_interest and long_short_ratio nodes read a cross-exchange aggregate with a short hourly history (since spring 2026 for most perps; the data coverage shows each start). The Binance nodes (binance_oi, binance_oi_usd, binance_lsr, binance_top_lsr, binance_top_pos_lsr) read Binance USDT-M only: hourly snapshots from Binance's public data archive, back to September 2020 for BTC and December 2021 or the listing date for most other perps, continued live from the same Binance statistics. Each hourly value becomes usable 15 minutes after its snapshot, in backtests and live alike. They run in backtests, the paper track and live Agents, but not in a graph with an ML node.

Funding also comes in two forms. The default funding_rate node reads the rate per 8 hours. The hl_funding node reads Hyperliquid's own funding, which settles every hour: its value is the rate per hour (0.0000125 is 0.00125% per hour), so the same funding shows as a value 8 times smaller than on funding_rate and a threshold tuned on one does not carry over to the other. History starts on 8 June 2023, for crypto perps only. It runs in backtests, the paper track and live Agents, but not in a graph with an ML node.

fear_greed reads the Alternative.me Crypto Fear & Greed Index: one global value per UTC day since February 2018, the same on every crypto market. Alternative.me publishes each day's value at 00:00 UTC, and Trigr treats it as usable from 01:00 UTC in backtests and live alike, so a daily bar uses the value published at its open, not the one published at its close. A value that arrives late in live trading becomes usable only when it was first seen. Data by Alternative.me.