Backtest¶
Open Backtest, pick the Trading Pair and the Strategy, then Execute Backtest. Trades show on the chart and in the table, with fees. A backtest needs the exchange enabled, not API keys, and does not ask the license service.
How a backtest fills orders, and why live results can differ, is on When orders fill.
Date range¶
Start and End can cover at most 100,000 candles of the strategy's Main timeframe. A new backtest starts on the most recent 5,000. On 1h the default 5,000 is 208 days 8 h. The picker reads "Max range: 100000 × {interval} candles = {duration} (this strategy's main timeframe). Default: the last 5,000 candles." and, when the range is longer than the maximum, "Longer than the maximum: the server will refuse it. Shorten it or use a larger timeframe." A range past the maximum is not shortened; running it is refused with "range must be positive and at most 100000 candles; shorten it or use a larger timeframe".
Some exchanges have less history than the range you pick, for example a young pair, Kraken's latest 720 candles, or Hyperliquid's newest 5,000. The backtest then runs on the candles the exchange has and adds this warning to the report: "The exchange did not have candles for the whole selected range ({n} of {expected} {tf} candles). The backtest used the available history only; missing candles were not filled in." Missing candles are never made up.
Funding¶
A Standard backtest on a Perpetual market charges funding at the open of the first candle that opens at or after each settlement, from the exchange's public funding history. It is charged on the positions whose entry filled before the settlement, and backtest and paper use the same timing. On isolated margin it is booked to the position's margin so the liquidation level can move; on cross it is booked to the run's cross pool (a backtest runs on its own, so the pool is the run's own balance). Funding history is read up to 200,000 settlements; if the exchange's funding history doesn't cover the whole range, the report says so, and a read stopped early is flagged partial. When funding history is missing, the report says funding wasn't modelled and gives the reason; it never shows 0 as real data.
The result includes margin mode, a funding block and total funding, and lists the venue's per-mode rows (margin_mode_detail). Margin mode offers Isolated and Cross; a run with no mode set uses the venue's default (default_margin_mode), which is cross on a cross-only venue.
0.13.1 (unreleased)
A perpetual Grid backtest charges funding with the same timing. A Grid backtest on supplied candles takes optional funding rows; without them it reports funding as not modelled: no venue. See Grid perpetuals and recenter. Details are in the 0.13.1 release notes.
Funding Carry¶
When a Funding Carry backtest fetches its data from the exchange, a missing or partial entry-gate timeframe does not stop the run. Entries stay blocked until the gate has candles. The report shows a short note, such as "Entry gate: no 15m candles from
Order-flow conditions¶
A backtest can show "Ignored in backtest:" followed by any conditions that were skipped. That does not disable Execute Backtest. See Order flow & derivatives.
Shared-balance backtest¶
Shared-balance backtest on the Backtest page runs up to 16 saved strategies together on the default paper wallets (one per exchange and market type). No linked exchange account is used. A Funding Carry member uses a spot wallet and a perp wallet. Members share the wallet: an order the wallet cannot cover is refused whole, longs go first, and positions never flip. Mixed timeframes step on the finest one. Advanced run settings starts collapsed; leaving it empty uses the saved defaults. Start and End use the browser's date and time fields, and follow the same 5,000-candle default and 100,000-candle maximum as a single backtest. Conditions a backtest cannot evaluate are listed as Ignored in backtest and do not refuse the run.
Both strategies¶
For a Both strategy on On candle touch, the backtest estimates which side was touched first from the candle-colour path, so paper and live can differ. After a mid-bar exit, no new touch entry is taken on that bar in the backtest. Hedge mode follows the linked account's last detected value; see Both and hedge mode.
Result widgets¶
Each result slot has a widget picker. The choice is saved on this computer. If that save fails, the slot goes back to the previous widget and the status line says so.
5m stops and trailing¶
When the strategy's Main timeframe is coarser than 5m (15m and longer), the backtest walks stops, Trailing take-profit, Take-profit % and a Trailing entry on nested 5m candles inside each main bar, so the first exit stays in order. Entry and exit signals, including a touch entry, still decide on the main timeframe. The percents themselves are unchanged; there is no setting.
A main bar the 5m candles do not fully cover keeps the coarser path, for example at a gap or past a venue limit such as Kraken's latest 720 candles. A 5m or 1m main timeframe always keeps it. When the finer path was used, the status line's Fills text says so.