Acting towards the end of a race: calculating race duration based on stats
Description
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.
Triggers
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:
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.
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)))))))))))))))))))))))))))))))