Published on April 11, 2020, 6:03 a.m. - 3 Comments - Sports: Horse Racing
I came across this strategy when reverse engineering Betfair starting price bets. It came to my attention that certain horses had very similar patterns in terms of starting price bets. After further investigation I discovered that these were horses that have not participated in any race previously. With this I defined a very simple betting strategy for a backtest: Back bet on horses making their debut using the Betfair Starting Price (BSP).
The Strategy is easily defined: It is a applied to UK Horse Races available on the Betfair Betting Exchange. A back bet is placed on horses that have not appeared in any races before, i.e. they are newcomers. Bets are placed on the win market.
There are multiple publisher with horse racing details such as racingpost.com or gg.co.uk. When browsing through their pages you can easily identify which horse has not participated in previous races and hence is racing for the first time. On gg.co.uk you will find for instance that some horses do not have a "last run" information as shown in the following screenshot:
In this example the selection "Leopardo" does not have a last run entry. This is an example for a horse that is running for the first time and won, the BSP for this selection was 18.23.
Of course it would be possible to manually go through the races on gg.co.uk every day, record the newcomers and manually place a back bet on the selection. However, this is very time consuming and lots of work and the question is can we do better? For sure it is possible to code a script - a simple crawler- that automatically scrapes the newcomer from a website like gg.co.uk. You could then just go through the list and place the bets manually which is less effort.
For full automation of this strategy you could probably rely on the "selectionId" field that is used by the Betfair API. It seems that this field is tied to a specific horse which means that a horse with a new selectionId (a selectionId that was not seen previously) is really a newcomer. This is especially helpful for automation and creation of a betting bot since you can reduce external dependencies (no need to parse any other website) by simply maintaining an index of selectionIds.
This betting strategy was backtested and evaluated using Betfair Starting Price (BSP). Files in csv format with Betfair price data are available for free on https://promo.betfair.com/betfairsp/prices/. A simple Python script can be used to automatically download the csv files and feed the data into a simple SQL-like database.
A simple SQL database query was used to test this strategy. Within a subquery distinct selection_ids are obtained. On top of this subquery, profits are calculated using the bsp odds. A commission of 2% is taken into account at the selection level.
SELECT *, CASE WHEN win_lose THEN (bsp-1)*(1-0.02) ELSE -1 END as profit FROM ( SELECT DISTINCT ON (selection_id) * FROM data WHERE market = 'pricesukwin' ORDER BY selection_id, event_dt ) as sq WHERE event_dt >= '2014-01-01 00:00:00' ORDER BY event_dt ASC
I was quite baffled by the results of the backtest given it is such a simple betting strategy:
Given the positive returns of the betting strategy over the past couple of years, it seems that newcomers in horse races are underestimated and the edge could be exploited with an automated betting bot.
This strategy can be easily deployed as a simple Python script using the Betfair betting exchange API. The betting bot works the following way: It fetches horse races from the Betfair API. A market filter is applied to select UK win markets only with a market start time within the next couple of minutes. For each market, all the runners are checked against a file or database of previous runners (the index with selectionIds). If the runner is not included in the database, a BSP bet is placed and if the bet placement was successful, the selection is added to the database with selectionIds. The script can be deployed on a VPS using cron to automatically trigger it every couple of minutes.
Would you like to automatically apply this strategy on a betting market? Please do not hesitate to contact us and we should be able to figure out a solution that works for you.
What are your thoughts on this strategy? Please let us know in the comments below!
Please log in to leave a comment.
If you would like to learn more about this strategy, please do not hesitate to contact us.Contact Us!