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.
Methodology
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.
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.
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.
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.
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.
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.
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
| Market | Pair | Range | Bars | Zero-volume bars |
|---|---|---|---|---|
| Gold (PAXG/USD) | paxgusd | MAR 19, 2026 → NOV 25, 2026 | 24,082 | 59% |
| Bitcoin (BTC/USD) | btcusd | NOV 25, 2025 → NOV 25, 2026 | 35,040 | 0% |
paxgusdbtcusdGold (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.