Acting towards the end of a race: calculating race duration based on stats


Many betting strategies involve doing something before the off, e.g. at 1 minute before the scheduled start of a race. It is a common perception that predicting when the race is going to finish is close to impossible. While we agree that the actual duration of a race has always a factor of chance to it, still we can roughly estimate the average duration of a race given its distance.

We have gathered a vast amount of data on the horce racing markets that were running on BetFair and came up with a formula for calculating the duration of a race in seconds, based on its distance. 


Click here to download the trigger file.

The constants here are very basic:

seconds_to_end : This is the key constants of the trigger. The number of seconds to the supposed end of the race when the trigger must fire;

bet_size : The size of bet for the laying trigger.

In Action

Obviously, the trigger can kick in both before and after the actual point of time when 20 seconds are left till the end of the race, because we only have the average figures. However, the formula is pretty accurate in the long run. Take a look at an example below:

The time the trigger has kicked in

Here you can see that the bet was placed at 19:29:45. The trigger is set to fire this bet at 20 seconds before the end of the race.

The moment the market was suspended

At 19:30:04, 19 seconds later, the market gets suspended.

Please note that the formula is based on the race distance extracted from the market name, i.e. "6f", "1m5f", etc. This information is only available in win markets, so it won't work for place market. But with place markets there is an easy workaround: just load both types of markets into the program and replace market_name with winplace_market_name in the formula.

Here is the full notation of the "magic" formula that returns the duration of a race in seconds.

IF(FIND("2m4f", "market_name") > 0, 324, IF(FIND("3m1f", "market_name") > 0, 381, IF(FIND("2m1f", "market_name") > 0, 258, IF(FIND("2m3f", "market_name") > 0, 282, IF(FIND("2m6f", "market_name") > 0, 355, IF(FIND("2m2f", "market_name") > 0, 263, IF(FIND("1m6f", "market_name") > 0, 212, IF(FIND("1m3f", "market_name") > 0, 135, IF(FIND("2m5f", "market_name") > 0, 326, IF(FIND("2m7f", "market_name") > 0, 354, IF(FIND("1m4f", "market_name") > 0, 142, IF(FIND("1m2f", "market_name") > 0, 125, IF(FIND("1m5f", "market_name") > 0, 189, IF(FIND("1m1f", "market_name") > 0, 102, IF(FIND("3m3f", "market_name") > 0, 419, IF(FIND("3m7f", "market_name") > 0, 389, IF(FIND("3m4f", "market_name") > 0, 467, IF(FIND("3m2f", "market_name") > 0, 393, IF(FIND("3m5f", "market_name") > 0, 476, IF(FIND("3m6f", "market_name") > 0, 450, IF(FIND("4m1f", "market_name") > 0, 523, IF(FIND("4m3f", "market_name") > 0, 520, IF(FIND("1m7f", "market_name") > 0, 228, IF(FIND("4m2f", "market_name") > 0, 546, IF(FIND("5f", "market_name") > 0, 55, IF(FIND("6f", "market_name") > 0, 61, IF(FIND("7f", "market_name") > 0, 79, IF(FIND("4m", "market_name") > 0, 497, IF(FIND("3m", "market_name") > 0, 360, IF(FIND("2m", "market_name") > 0, 228, IF(FIND("1m", "market_name") > 0, 91, 0)))))))))))))))))))))))))))))))


If you have not heard of BetFair yet or do not have an account, register today and get £20 free. Use the link below:
New customers only, bet up to €/£20 on the Exchange and if your first bet loses, we’ll refund you €/£20 in Cash. Bet must be placed in first 7 days of account opening. T&Cs apply.
Gamble responsibly! Always be aware that betting is NOT risk-free. You must be 18+ years old before you try gambling, but even as an adult, withhold from spending money in an ill-judged manner. Our company does not encourage you to prefer gambling over other meaningful activities. If gambling is affecting your life or the lives of people close to you, please contact GamCare
© 2005-2023 WellDone Creative Software. All rights reserved. Terms and conditions.
BetFair® and the BetFair Logo are registered trade marks of Flutter Entertainment plc. Gamble responsibly.