Skip to content

Methodology

How the numbers are made.

A backtest is only as honest as its fill model. These are the rules every run follows, and the places where the results can still mislead you.

Rule · 01

A fixed UTC clock.

Decisions happen every 4 hours on the UTC clock (00:00, 04:00, 08:00 …), whatever the strategy. A signal only counts from the first anchor at or after its timestamp, so a strategy can never act on a price it couldn't have seen.

Rule · 02

Limit orders, never chased.

At each anchor the engine compares the target exposure with the current position and places one limit order for the difference, 2 bps better than the last closed 15-minute bar: below it for buys, above it for sells.

The order fills on the first bar in the next 4 hours where price trades through the limit (a buy needs a low strictly below it). Touching isn't enough. If nothing fills, the order is cancelled at the end of the window and re-evaluated at the next anchor, at the then-current price.

Rule · 03

Conservative fills.

Fills are all-or-nothing and always at the limit price, even if price gapped through it. There's no price improvement, no partial fill and no queue position, and each fill pays a 5 bps fee.

Limit orders also suffer adverse selection: they tend to fill when price is moving against you. That cost is real, and it's why a random strategy loses money here even before fees.

Rule · 04

Independent sleeves.

Each asset trades its own slice of the capital (PAXGUSD 70%, BTCUSD 30%). Sleeves aren't rebalanced against each other, so a winning sleeve grows its share of the portfolio. Sizing uses the whole sleeve, so fees can take cash a hair below zero.

Rule · 05

Metrics.

Sharpe and Sortino use daily returns sampled at 00:00 UTC, annualised with √365 because both markets trade every day, with a zero risk-free rate. Max drawdown uses every 4h equity point. A trade is a round trip from flat back to flat (or through zero), and its PnL includes fees. Positions still open at the end don't count as trades.

Rule · 06

Bring your own signals.

Any JSON signal file can be mapped onto the engine with a small field mapping: time, asset and either a side (BUY, SELL, FLAT) or a target exposure between −1 and 1. See the README.

Data

Where prices come from.

Bitstamp public OHLC15m bars
  • Gold (PAXG/USD)
    Pair
    paxgusd
    Range
    MAR 19, 2026 → NOV 25, 2026
    Bars
    24,082
    Zero-volume bars
    59%
  • Bitcoin (BTC/USD)
    Pair
    btcusd
    Range
    NOV 25, 2025 → NOV 25, 2026
    Bars
    35,040
    Zero-volume bars
    0%
Caveat · thin market

Gold (PAXG/USD) is a tokenised-gold proxy, not spot XAUUSD, and it's thin on Bitstamp: 59% of its 15-minute bars have no trades at all. A limit order can only fill when someone trades, so the gold sleeve fills far less often than BTC does. That's exactly the kind of gap a backtest that assumes instant fills at the close would hide.