APIHorseRacing

Labs / Racing Backtest

Racing Backtest

Back the favourite. Back the drifter. Dutch the front three. Every system anybody sells, tested over nine years of real prices, with the interval printed next to the return.

Python 3.9+No dependenciesFree key worksMIT
Not published yet The endpoint it uses

Racing Backtest

A sample of what it prints

Back the favourite 1.00
Back the drifter 0.94
Back 16/1 and up 0.72
0.701.001.30

What it does

Systems are sold on a run of winners and almost never on a sample size. This runs each one over the whole archive at real starting prices and prints what it actually returned, with the interval beside it.

The honest baseline is not zero. Backing everything pays the book margin every time, so the tool reports each system against what that population of prices returned rather than against breaking even.

Running it

python backtest.py --system favourite --from 2019-01-01 --min-runs 500

Each system is one flag. Add --out csv for a machine readable version that prints the document and nothing else.

What it found

These rows are illustrative. They show the shape of the output and will be replaced by a real run before this is published. Nothing here should be quoted as a finding yet.

Placeholder until the tool has been run over the full archive.

SystemRunsStrikeA/EIntervalReturn
Back the favourite 148,200 33.1% 1.00 0.99–1.01 −6.2%
Back the drifter 96,400 9.8% 0.94 0.90–0.98 −14.1%
Back 16/1 and up 494,694 1.9% 0.72 0.71–0.74 −51.0%
Top weight in handicaps 61,900 14.2% 1.02 0.98–1.06 −4.8%

What it cannot tell you

  • It assumes you get starting price. Anyone taking a shorter price does worse.
  • No commission and no place terms. Both are decisions you make, not ours.
  • A system that fails here can still be sold to you tomorrow. That is rather the point of publishing it.

Not published yet

This one is still being written. When the repository is up, this page gains the link and the card on Labs flips to published. We would rather say that than point you at nothing.