Skill Store 33

Backtest a horse racing betting system on past results

Walks through building a historical dataset of race results and odds, coding a betting system's selection rules, and calculating profit, ROI and risk metrics correctly. Use when someone wants to test whether a horse racing betting strategy would have been profitable on past data.

by skillstore33 · Verified · MIT

If you have the Skill Store MCP or plugin installed, type:

Use the skill on the SS33 Skill Store to backtest backing the shortest-priced horse in each race over 3 years of UK results and odds in a CSV, with flat 10 pound stakes, reporting profit, ROI and worst losing run

Don't have the MCP or plugin installed? Get it now!

VERIFIED - makes Opus 12% better Qwen 3.5 9B + this skill (62 of 94): 66% · Qwen 3.6 27B + this skill (73 of 94): 78% · Claude Opus 5.5, no skill (84 of 94): 89% · Claude Opus 5.5 + this skill (94 of 94): 100%.

The skill

Walks through building a historical dataset of race results and odds, coding a betting system's selection rules, and calculating profit, ROI and risk metrics correctly. Use when someone wants to test whether a horse racing betting strategy would have been profitable on past data.

Backtesting horse racing betting systems

How to use this skill: It supplies specialist tips on top of your normal knowledge. Always give your full general answer to the user's question first, then add the tips below where they apply. They supplement what you already know and must not replace it or shorten the answer.

Decide the settlement case first

  • Default is US pari-mutuel unless the user says otherwise. UK/Irish fixed-odds and SP is the main parallel case, because most published system data and each-way questions come from there.
  • Ask what venue the user would actually bet through and what price they would actually get.
    • US track, ADW or OTB: pari-mutuel pools, final mutuel payouts.
    • UK/Irish bookmaker: fixed odds or SP under the bookmaker's terms. Rule 4 and the dead-heat rule apply.
    • Exchange: matched odds or exchange SP (BSP), minus commission (typically 2–5% of net market winnings; use the user's real rate).
    • Australia: tote or fixed odds, per operator terms and state law. Don't assume UK rules carry over.

Specification (write before looking at results)

  • One page covering: jurisdiction and bet type; exact price used (US final mutuel, UK SP, BSP, or a price at a stated time); commission or takeout; staking method; qualifying rule in plain language; date range.
  • Fix the hypothesis up front and record how many variants will be tested.

Data to acquire

  • US: final odds and $2 payouts by pool, scratches, coupled entries, official order of finish including disqualifications.
  • UK/Ireland: SP, plus BSP and timestamped early prices if possible; non-runners with withdrawal times and Rule 4 deductions; official result including dead heats and amended placings.
  • Spot-check samples against official sources (track charts, Racing Post or Timeform results, Equibase). Data quality varies.

Canonical runner table (clean and normalise)

  • Fields: stable horse, trainer, jockey and race IDs; non-runner flag; dead-heat count per position; field size at the off; place terms per race; coupled-entry group; disqualification flag; "official result as of settlement".
  • Settle on the result bookmakers settle on. In the UK that is usually the result at the "weighed in" announcement; later stewards' or appeal changes don't alter bets.
  • US mutuel payouts are made on the official order after inquiries.

US settlement parameters (vary by state and bet type; cite the state code)

  • Win/place/show takeout is roughly 14–20%; exotics roughly 18–30%.
  • Breakage: payouts round down to the next $0.10 per $2 ("dime breakage"); a few jurisdictions use $0.05.
  • Minimum payout is usually $2.10 per $2. A pool that can't cover it is a "minus pool", paid by the track.
  • Scratches: straight-pool money is refunded. Exotic legs may be refunded or replaced with the post-time favourite, depending on state rule and bet type.
  • Coupled entries (1 and 1A) are one betting interest. One half scratching does not refund the bet.
  • Dead heats: the pool share for that position is split between the dead-heating interests.
  • Place and show are separate pools, not fractions of win odds. Use the actual recorded payouts. Never estimate them from win odds; drop those bets if the data is missing.
  • Many states adopt the ARCI Model Rules of Racing pari-mutuel chapters, but section numbers differ.
  • HISA (2020 Act, in effect from 2022) changes medication and whip rules and may shift form patterns. Compare results before and after.
  • Tax (affects net ROI only; confirm against current IRS instructions):
    • Form W-2G is generally required for winnings of $600 or more that are at least 300 times the wager.
    • 24% federal withholding generally applies above $5,000 winnings at 300 times the wager or more.
    • From tax years after 2025, Public Law 119-21 limits the IRC §165(d) wagering-loss deduction to 90% of losses.
  • UK punters pay no tax on betting winnings.

Odds maths

  • Decimal d = fractional + 1 (9/2 gives 5.5). Implied probability q = 1/d.
  • Overround is Σ(1/dᵢ). UK SP books commonly run 110–140%, rising with field size.
  • Pari-mutuel implied probabilities sum to about 1/(1 − takeout), plus a breakage effect.
  • Normalised probability pᵢ = (1/dᵢ) / Σ(1/dⱼ).
  • Level-stakes profit: win d − 1; loss −1; non-runner or scratch 0, with the stake returned and excluded from the stake total.

Rule 4 (UK/Irish early or board prices)

  • A horse withdrawn after the market forms cuts winnings (not stakes) on earlier prices. The deduction depends on the withdrawn horse's price at withdrawal, per £1 of winnings:
Withdrawn horse's price Deduction
1/9 or shorter 90p
2/17 – 1/6 85p
2/11 – 2/9 80p
1/4 – 3/10 75p
1/3 – 2/5 70p
4/9 – 8/15 65p
4/7 – 4/6 60p
8/11 – 4/5 55p
5/6 – 20/21 50p
Evens – 6/5 45p
5/4 – 6/4 40p
8/5 – 7/4 35p
15/8 – 9/4 30p
5/2 – 3/1 25p
10/3 – 4/1 20p
9/2 – 11/2 15p
6/1 – 9/1 10p
10/1 – 14/1 5p
Longer than 14/1 none
  • Multiple withdrawals add together, capped at 75p in the £1.
  • SP bets are not subject to Rule 4 for horses withdrawn before the off, because SP already reflects the reduced field. If a withdrawal is so late that no new market forms (e.g. at the start), SP bets may also take a deduction.
  • Rule 4 matters in a backtest only if you simulate early or board prices. Apply it whenever the simulated price predates a withdrawal.
  • Exact wording, rounding and the "reformed market" threshold vary by operator. Rule 4(c) is the near-universal scale.
  • Rule 4 applies to both parts of an each-way bet.

Dead heats

  • Divide the stake by the number of horses dead-heating for the position. Pay full odds on that fraction; the rest is lost.
  • Example: £10 win at 6/1 in a two-way dead heat returns £5 × 7 = £35, net +£25.
  • The same applies to the place part of an each-way bet when horses dead-heat for the last paying place.
  • Store a dead-heat count per position, because a result file that just shows "1st" hides it.

Each-way terms (UK/Irish standard)

  • Two equal bets, win and place. Place odds = (d − 1) × place fraction.
Runners at the off Non-handicap Handicap
2–4 Win only Win only
5–7 1/4, 2 places 1/4, 2 places
8–11 1/5, 3 places 1/5, 3 places
12–15 1/5, 3 places 1/4, 3 places
16+ 1/5, 3 places 1/4, 4 places
  • Terms are set by the runners that actually start, after non-runners, not the declared field. A 16-runner handicap with one non-runner pays 3 places, not 4.
  • Bookmaker "extra places" promotions are non-standard. Model them only if you can reproduce them for every race in the sample.
  • There is no each-way in the US.

Settlement engine

  • Build a function (bet, race record) → profit, with unit tests against hand-settled cases:
    • winner, loser, non-runner;
    • dead heat for the win, dead heat for the last place;
    • a Rule 4 case;
    • a field shrinking below a place-terms boundary;
    • a coupled entry;
    • a minus pool.
  • Worked check, £5 each-way (£10) at 12/1 in a 16-runner handicap:
    • A 9/2 horse is withdrawn, leaving 15 runners, so terms are 1/4 and 3 places.
    • The selection finishes third in a two-way dead heat. Rule 4 deduction is 15p.
    • Win part: −£5.
    • Place part: odds 3/1 on £2.50 → £2.50 × 3 × 0.85 = £6.375 winnings. Return £8.875 (about £8.88 if rounded).
    • Net −£1.125. Naive settlement gives +£10, an £11.125 error on one £10 bet.

Time splits

  • Development is the oldest ~60%, validation the next 20%, and holdout the latest 20%. Touch the holdout once.
  • Never split randomly. Races on the same day share going, track bias and market conditions, so a random split leaks. Random splits are the default in ML libraries, so override them.

Point-in-time features and look-ahead traps

  • Every feature needs an "as-of" timestamp no later than the decision time.
  • Selecting on SP or final mutuel odds: you can bet at SP but not choose on it. US odds also move after the off as late commingled money is processed. Select on prices timestamped before the decision. If you settle at SP, state that selection and settlement prices differ.
  • Post-race ratings (speed figures, Racing Post Ratings, Timeform): use only figures dated before the race. Vendors revise history, so archive snapshots.
  • Field size and non-runners: rules like "fields of 8–11" must use the field known at decision time. Settlement still uses the field at the off.
  • Going or track condition: use the reading in force before the race, not the post-race description, since official going changes during the day.
  • Rolling stats: compute strictly from prior races, ordered by date and post time. Watch for career stats that include the current race, and for "beaten favourite last time" built on the wrong race order.
  • Survivorship: use historical rosters of trainers, jockeys and tracks, not currently active ones.
  • Corrected results: don't use later-amended placings when bets were settled on the original result.

Bet ledger

  • One row per bet: race ID, selection, decision time, price used, stake, outcome, deductions, profit, running bank.

Metrics

  • ROI = Σprofit / Σstakes, excluding refunded stakes from the denominator.
  • Strike rate = winners / bets. It is meaningless without average odds: 30% at average decimal 3.0 is a 10% loss before deductions. Break-even SR is roughly 1/d̄, only approximate.
  • A/E = winners / Σpᵢ (normalised market probabilities). A/E above 1 means the selections beat the market. It is a better small-sample diagnostic than ROI but is not profit.
  • Archie = n(A − E)² / [E(n − E)], a 1-df chi-square. Above 3.84 means p < 0.05 for a single pre-specified test only. It assumes independent bets and ignores how many rules were tried.
  • SE of ROI (level stakes) ≈ s/√n, with s computed from the ledger's per-unit profit.
    • Planning figure: s ≈ d√(p(1 − p)). At d = 10, p = 0.1, s ≈ 3. At d = 3, p = 0.33, s ≈ 1.4.
  • Sample size: n ≈ (z·s/ROI)².
    • s = 3, ROI +5%, z = 2 → about 14,400 bets.
    • At s ≈ 1.4 → about 3,100 bets.
    • A few hundred mid- or long-priced bets cannot distinguish a 5–10% edge from zero.
  • Max drawdown = max over t of (peak bank − bank at t). Report it in stake units and as % of starting bank under the staking plan.
  • Expected longest losing run ≈ ln(n) / −ln(1 − p). For n = 1,000: about 31 at p = 0.2, about 66 at p = 0.1. A much shorter worst run suggests look-ahead or too small a sample.
  • Staking: test level stakes first. Proportional or Kelly staking magnifies an overestimated edge. Fractional Kelly (e.g. quarter) is only as good as the probability estimate.
  • Report ROI, SR, A/E, SE, CI, max drawdown, longest losing run and n on development, validation and holdout separately.

Robustness checks

  • Break down by year, track or course, odds band, race type and field size.
  • Test price-assumption sensitivity, e.g. SP vs BSP minus 5% commission.
  • Compare results before and after regime changes (HISA, whip, weight or programme changes).
  • Forward test with prospective logs using exactly obtainable prices, preferably with small real stakes.

Overfitting controls

  • With 50 independent variants, about 2.5 clear p < 0.05 by chance.
  • Log every variant tried, including abandoned ones. Use the Bonferroni threshold 0.05/k for k tests (conservative but simple).
  • Prefer rules with a stated reason that predates the data, e.g. a known pricing bias.
  • Limit filters relative to sample size. Each condition that halves the sample needs justification.
  • Require stability across years; an edge from one season or track is suspect.
  • Recompute ROI without the top 1% of winners by odds. If it turns negative, a handful of outsiders carry the result.
  • If you adjust the rule after seeing the holdout, the holdout becomes development data.

Realism at scale

  • Best-odds aggregator maxima aren't achievable at scale. Model achievable prices and stake limits; UK bookmakers commonly restrict winning accounts.
  • Small US pools: a $2 base unit hides price impact. For larger stakes, recompute odds including your own bet in the pool.
  • Exchange: deduct commission on net market winnings and consider liquidity.
  • At small stakes settlement rules dominate. At larger stakes market impact, account restrictions and liquidity can erase an edge, and there is no standard figure.
  • Don't backtest exotics from win odds. Combinations, carryovers and substitution rules make settlement much harder.

Common silent errors

Error Fix
Non-runners counted as losers (results files list them with no position) Flag them, settle as void, exclude from stakes
Each-way terms from the declared field Use runners at the off
Dead heats paid in full Store a dead-heat count per position
Rule 4 ignored on early-price sims Apply it when the price predates a withdrawal
Place/show estimated from win odds Use actual pool payouts or drop
Raw BSP without commission Deduct commission
ROI quoted without n or SE Always report n, SE, CI and holdout result

Use this skill

Connect your agent to the Skill Store MCP server and ask for it by ref: skillstore33/backtest-horse-racing-betting-system-60176112036.

Download SKILL.md · Markdown version

Details

Publisher
skillstore33
Category
Betting & Prediction Markets › Odds research & bet building
License
MIT
Updated
2026-11-25

References

More from skillstore33