The BTC Horse Racing Thread
-
We've made some improvements to our Betfair price grabber that provides the prices for the backtesting.
Previously, we took a price snapshot once per second and wrote that to the DB for later retrieval in your strategies. 1-second intervals are obviously pretty granular (already resulting in about 10 million price snapshots per month of data
) and provide a good indicator of price trends and entry / exit points.However when a race goes in-play, the prices obviously become very volatile and we've seen that the price can easily dip below or surge above the "snapshotted" price between snapshots, often for significant enough traded amounts that you would want to be aware of it in backtesting (where you're basically always interested in whether the price touched a particular level).
To solve this problem without literally writing every tick to the database and needing a data-centre to rival OpenAI's, we're now analysing the ticks that make up each snapshot in memory and then storing the highest and lowest values as the snapshots.
The upshot of this is a more reliable indication of whether your entry or exit price was hit and therefore a closer correlation between your simulated backtesting results and your real life trading.
This will most benefit people who are exiting their trades in-running, or those doing lay the field type strategies.
-
@Shannon-Townsend You only have one rule in that strategy and it's a scope rule looking back at past races. It's therefore failing some validation in the daily qualifiers task because it's lacking a value for the upcoming race.
We can add some handling for this but as a workaround for now, if you add another strategy rule and just select all the options that should "trick" it into passing the validation.
E.g. add the Race Type rule and just select all the options so it doesn't actually filter anything out but will have a value for the upcoming race to work with.
-
@Shannon-Townsend Difficult to say without more info but I do see some daily qualifiers in the DB for your dobbing and outsider strategies and it looks like they updated a couple of minutes ago.
-
anyone know why my daily qualifiers are not showing on my front screen? i have to run the stratagy each time to get them, i have pressed the toggle but do not show... am i missing something?
-
@Adam Ive actually used Deepseek to average the times across all courses and lumped them in to Good to soft and below and good and above. As well as setting them so they trade out around 1f from home. So 2 automations per distance, but for jumps only...
The race completed % rule on BA seems to be proving reasonably accurate for flats. Ive got 1 at the moment but will probably group them into lots of 2 or 3 furlongs to get over the increase in time as the distances get longer.
Its been quite fun to work out so if it doesnt work...at least theres that

-
@Tony-Hastie If you create a couple of them and export the rules file, ChatGPT might be able to generate the rest of the rule file that will import every course, distance and going combo...
-
@Tony-Hastie I'm not sure tbh, I use their API to set stored values but thinking about it they're more for dynamic numbers that change over time.
Can you just hardcode them in an automation rule? I know you'd need a rule for each course / distance / going combo, but maybe you could just use the minimum times for each 4 furlong distance increment as a starting point or something.
-
@Adam Try as I might Ive not been able to put this file into BA stored values. Forum unhelpful and AI just seemed to take me around in circles!(using notepad mainly) Would you have any insight into how to do it? Could it be as simple as it not being an exel file? I run Libre office....
-
@Greg-Mitchell said in The BTC Horse Racing Thread:
Ok experts, can you help me out so I can check my calculations are correct please?
The Scenario is this:
I back a horse pre-off at odds of 4.0.
I want to trade out in running at a better price by 20% with a stop loss at a worse price by 40%For a £1 initial bet stake, what is my P & L (excluding commission) in the following scenarios:
- It trades out at the better price
- It trades out at the stop loss price
This is the maths I would use if calculating manually:
Back price = 4.0 Back stake = 1.0 Desired odds movement = 20% Desired exit price = 4.0 * (1 - 0.2) + (0.2) = 3.4 Desired lay stake = (4.0 * 1.0) / 3.4 = £1.18 Profit = 1.18 - 1.0 = £0.18 Stoploss odds movement = 40% Stoploss price = 4.0 * (1 + 0.4) - (0.4) = 5.2 Stoploss lay stake = (4.0 * 1.0) / 5.2 = £0.77 Loss = 0.77 - 1.0 = -£0.23 -
Ok experts, can you help me out so I can check my calculations are correct please?
The Scenario is this:
I back a horse pre-off at odds of 4.0.
I want to trade out in running at a better price by 20% with a stop loss at a worse price by 40%For a £1 initial bet stake, what is my P & L (excluding commission) in the following scenarios:
- It trades out at the better price
- It trades out at the stop loss price
-
@Tony-Hastie I guess for this it would be good to know the fastest times as well so you don't get caught short trying to exit too late, so these are those:
I haven't restricted these to the last year so those are literally the fastest times in our entire DB for the same breakdown.
-
@Adam This is awesome! Thanks a bunch...
The race % completed seems fairly accurate on BA for flats but jumps are much less so! Admittedly a very small sample size of the last 2 weeks but a 93% trade out time has traded me out anywhere from 5 to 59 seconds for the 2m jumps. Other distances not much better...
-
@Tony-Hastie Attached is a CSV with the times for each course, distance and going combo.
Some notes:
- This is calculated from the last year's worth of races (there's a tendency towards faster races as time goes on)
- It uses the median time rather than average to remove outliers
- I've rounded to the nearest second which should be fine for this
- It uses the actual going rather than the pre-race predicted going
- The distances are also rounded to the nearest furlong or there would have been even more results!
Not sure about BFBM but you should be able to load these into BA as stored values so you can use them as automation triggers.
-
There are issues with Betfair's streaming API currently so advise everyone to be careful if you're running bots on Aussie horses, dogs etc right now.
As usual their service status page is the last to know and is currently reporting everything is fine

EDIT: Seems to now be resolved as of about 08:58 UK time.