all work

13 · sometimes the question was enough

hft backtesting engine

how much of the latency story is real?

built with
rust · backtesting
status
runs on a macbook
links

fig. 13xau/usd, tick by tick

backtesting at tick resolution is where a personal project usually dies. the naive version takes hours per run, so you stop iterating, so you stop learning anything.

rust turned it into something i could run between edits. the point was never a profitable strategy.

scoped to one instrument on purpose. gold against the dollar is volatile enough to be interesting and liquid enough that the fills are not fiction.

what it runs on

one week of real ticks, gold against the dollar, january 1 to 7, 2025, from dukascopy. 733,538 ticks, about 22 megabytes. a full run takes roughly a second on an 8gb macbook.

what the strategies did

two strategies, scalping and mean reversion. the scalper traded on nearly every tick, 733,526 trades, and lost $179,153.58. mean reversion made 127,802 trades and lost $4.38.

neither won a single trade. the engine was the point, and an engine that reports a bad strategy plainly is working.

how it is put together

rust for ingestion, the engine and the analysis, behind a small cli. strategies are yaml configs, so trying a new one means editing a file. a python script reads the run directories afterwards.