Skip to content

Test

Backtesting workspace, results, replay, compare, and rolling cross-validation

Before risking real capital, use Test to backtest your algorithm against historical data, review the trade-by-trade results, replay entries and exits, and run rolling cross-validation.

For a hands-on first test, see the Test Walkthrough →

On this page: Running a Backtest · Local Drafts · Fees & Slippage · Results · Replay & Compare · Optimize · Under the Hood


Open Test, select an algorithm, choose your setup, and click Run Backtest. Test uses the same strategy logic you built in Build, so it is the place to check the algorithm before you run it live.

ParameterDescription
AlgorithmSaved algorithm and version to test
Start / EndHistorical window for the backtest
SymbolMarket to test, such as BTC or ETH
ExchangeExchange venue, usually Hyperliquid
Initial CapitalSimulated starting capital for this test
LeverageLeverage assumption for the run
Trades LimitMaximum number of trades to simulate
Session Calendar PolicyWhether the algorithm pauses around configured windows
Assume Position NowStarts the test as if the strategy is already in trade
Close Position on ExitCloses any open position at the end of the test window

The Test workspace lets you make temporary edits without changing the saved algorithm.

Use the side rail to move between:

  • Setup — market, dates, capital, leverage, trades limit, and session policy
  • Entry — temporary entry condition edits
  • Exit — temporary exit condition edits
  • Reset — reset and follow-up behavior

Draft edits are useful for quick experiments. When you find an improvement you want to keep, go back to Build and save a new algorithm version.


CostDefaultDescription
FeesExchange-specific (bps)Deducted from trade value on entry and exit
SlippageExchange-specific (bps)Price impact — longs slip up on entry, down on exit; shorts the reverse

Both are applied to every trade. Position size is calculated after deducting entry fees and slippage.


These five metrics give you the fastest read on whether your strategy is working:

MetricWhat It Tells YouGood Range
winRatePercentage of winning trades> 40% (depends on R:R)
profitFactorGross profit / gross loss> 1.5 (> 2.0 is strong)
sharpeRatioRisk-adjusted return (annualized return / volatility)> 1.0 (> 2.0 is strong)
maxDrawdownPctLargest peak-to-trough equity decline< 20% (lower is better)
totalPnlUSDNet profit/loss in USDPositive, obviously
MetricDescription
totalTradesTotal completed trades
winningTrades / losingTradesProfitable vs unprofitable trades
totalPnlUSDNet profit/loss in USD
grossProfitUSD / grossLossUSDSum of winning / losing trade P&L
avgPnlUSDAverage P&L per trade
avgWinUSD / avgLossUSDAverage winning / losing trade
largestWinUSD / largestLossUSDBest and worst single trade
MetricDescription
sharpeRatioAnnualized return / volatility. > 1.0 is good, > 2.0 is strong
sortinoRatioLike Sharpe but only penalizes downside volatility — better for asymmetric strategies
calmarRatioAnnualized return / max drawdown — how well you’re compensated for worst-case pain
maxDrawdownPctLargest peak-to-trough equity decline (%)
maxDrawdownUSDLargest peak-to-trough equity decline (USD)
MetricDescription
longTrades / shortTradesCount by direction
longWinRate / shortWinRateWin rate by direction
longPnlUSD / shortPnlUSDP&L by direction
avgTradeDurationBars / avgTradeDurationSecondsAverage trade length
avgWinDurationBars / avgLossDurationBarsDuration of winners vs losers
totalFeesUSD / totalSlippageUSDTotal execution costs

Each indicator gets a usefulness score (0-100) that tells you whether it’s actually contributing to your strategy’s decisions — or just adding noise.

FieldWhat It Tells You
flipCountHow many times the signal changed
flipRateFlips per bar
avgDurationTrueBars / avgDurationFalseBarsAverage length of true/false periods
pctTimeTruePercentage of time the signal was true
triggeringFlipCountFlips that actually triggered a condition change
blockingCountTimes this indicator prevented a condition from triggering
usefulnessScoreComposite score (0-100)

Entry scoring weights: entropy (20%) + efficiency (35%) + criticality (30%) + bottleneck (15%)

Exit scoring weights: entropy (25%) + selectivity (40%) + signal density (35%)

Shows how close conditions came to triggering without actually firing. This is valuable when your strategy isn’t trading enough — near-misses tell you which thresholds are too tight and by how much.

FieldDescription
pctTimeFlatTime with no position
pctTimeLong / pctTimeShortTime in long/short positions
avgTimeFlatBarsAverage bars between trades
ReasonDescription
signalExit condition triggered
stopLossFixed SL hit
stopLossTrailingTrailing SL hit
takeProfitTP level hit
endOfBacktestPosition open at backtest end

Event-driven snapshots of portfolio value — one data point per trade entry, exit, SL, or TP:

FieldDescription
timestampUTC timestamp
equityTotal portfolio value
drawdownPctCurrent drawdown from peak

Use plot_backtest to generate an equity curve chart (PNG) with drawdown overlay.


Use replay controls to step through the test and see when signals, entries, exits, stops, and take profits happened on the chart.

You can also keep completed runs around for comparison. This makes it easier to answer practical questions like:

  • Did the new entry rule improve win rate?
  • Did the stop loss reduce drawdown?
  • Did the algorithm improve because it traded better, or only because it traded less?

Switch the Test workspace from Backtest to Optimize when you want to check whether a strategy generalizes across time. Optimize runs rolling cross-validation: each fold trains on one window and tests on the next unseen window.

|── Train ──|── Test ──|
|── Train ──|── Test ──|
|── Train ──|── Test ──|
|── Train ──|── Test ──|

The date range is divided into overlapping folds. Each fold trains on one window and evaluates on the next unseen period. Windows step forward by step_days.

SettingDescription
AlgorithmSaved algorithm and version to validate
SymbolMarket to validate
Start / EndFull historical range
Train DaysLength of each training window
Test DaysLength of each out-of-sample test window
Step DaysHow far the window slides forward between folds

12-month backtest with 90-day train, 30-day test, 30-day step:

  • Fold 1: Train Jan-Mar, Test Apr
  • Fold 2: Train Feb-Apr, Test May
  • Fold 3: Train Mar-May, Test Jun
  • ~9 out-of-sample test periods
What You SeeWhat It MeansWhat to Do
Consistent Sharpe/win rate across foldsStrategy generalizes wellConsider a small live run
Much better train metrics than testLikely overfitReduce parameter space, simplify, or add regularization
Later folds performing worseLosing edge (regime change)Re-optimize on recent data, or reconsider the strategy entirely

The Folds tab is the most important view. If the train windows look strong but the test windows are weak, the strategy may be tuned too tightly to history.


You don’t need to understand the pipeline to use backtesting, but knowing what happens helps you interpret edge cases and trust the results.

Validates inputs, loads historical candles, filters to date range, and computes warmup offset (extra bars needed for indicator calculation).

Loads intra-bar price data for accurate stop loss and take profit detection. Falls back to OHLC interpolation if high-resolution data isn’t available.

Aggregates candles into multiple timeframes (1m, 5m, 15m, 1h, 4h, 1d) for efficient multi-resolution indicator computation.

Computes all indicator values across the full date range using the warmup period.

Converts continuous indicator values into boolean signals based on signal type and threshold. Detects signal crossings — the exact bars where an indicator flips.

Runs the state machine (CASH → POSITION → TIMEOUT → CASH) over resampled signals. On each bar:

  • Checks entry/exit conditions (AND/OR logic across indicator groups)
  • Scans for stop loss and take profit hits using sub-bar data
  • Executes trades with fee and slippage deductions
  • Tracks equity, drawdown, and trade records

Want to…Go to
Take your strategy liveRun Features →
Tweak your algorithm settingsBuild Features →
Walk through your first testTest Walkthrough →