Lay The Field At BSP Limit

Published on Jan. 2, 2021, 10:37 a.m. - Sports: Greyhound Racing Horse Racing

With this betting strategy lay bets are placed on selections using the Betfair Starting Price (BSP) with an odds limit. As a result only horses and greyhounds with very low BSP are laid (lower than a threshold of X) and profitability is evaluated on historical exchange data.

Please note: Here I will only focus on BSP bets. Have a look at the "Lay The Field strategy" if you are interested in betting inplay or before the start of the race.

A couple of years ago it was quite difficult to work with historical exchange data. You would either need to pay for the data or collect the data yourself. One of few resources that offered data for free was where Betfair publishes csv files with starting prices for horse racing and greyhound racing.

Setting up a Data Processing Pipeline for Betfair BSP Data

On you will find a list of csv files which are rather easy to work with. They contain selections with starting price information for various betting markets:

  • Horse Racing and Greyhound Racing
  • Win and Place Markets (Win has one winner, place multiple winners)
  • Multiple Countries: UK (United Kingdom), IRE (Ireland), RSA (South Africa), USA (United States of America) and AUS (Australia)

The csv files follow a certain naming convention that contains above information along with the date. The data structure of the csv file is explained on the site. In every file the rows correspond to selections (horses or greyhounds) with some meta data.

If you want to work with the data you could simply manually download the files and use some Excel functionality (e.g. external references) to work with the data. However, this seems to be rather cumbersome and instead I would like to propose a simple Python data processing pipeline that consists of the following steps:

  1. Use requests and pandas library to open the relevant csv files
  2. Iterate through the selections in the csv file
  3. Save every selection to a SQL database (I will be using PostgreSQL)

The advantage of this is approach is that we have the data with some structure in a format that is easy to work with. We can simply use SQL queries to select certain selections and calculate outcomes of bets on historical data.

Analysing BSP Data

For this analysis I will use all the data, so both horse racing and greyhound racing. I will include all countries and both win and place markets. Data for the years between 2010 and 2020 will be used (10 years of history). I assume that the data is stored in a SQL table with a column called "bsp" that contains the starting prices.

I personally like to use Jupyter Notebooks (now Jupyter Lab) for data analysis. It allows me to execute certain portion of my code and I can easily modify and re-run. The first thing we can do is to look at the distribution of the starting price, plotting it as a histogram. For this I just select all prices from the table, use Pandas to generate the histogram and plot it:

import pandas as pd

query = "SELECT bsp FROM data"
df = pd.read_sql(query, con=engine)
df.hist(bins=100, density=True)

The chart looks like the following:

BSP Histogram

As expected prices are somewhere in the range between 1.0 and 1000. Zooming into the range between 1.0 and 20.0 shows the following:

BSP Histogram Low Odds

The maximum of the distribution seems to be in the odds range of 2-4. You can go much further with your analysis, add filters etc. to come up with betting or trading strategies. However I will focus on a very simple and broad approach here.

Deriving a Betting Strategy for BSP Lay Bets

If you want to earn money with sports betting you need to back prices that are too high or lay prices that are too low. That is the basic idea behind value betting. Without any additional knowledge about the selection, I can just select horses or dogs that are priced very low hoping that their price is too low.

I will introduce a threshold a value somewhere between 1.01 and 1000 (possible BSP prices) and assume that I place a lay bet on the selection if the price is equal or lower (<=) the threshold. In the code I will just pick a few thresholds and iterate over them in Python, use SQL to select relevant runners and aggregate the profit:

thresholds = np.linspace(1.025, 2.0, num=40)  # 1.025, 1.05, 1.075,...
profits = []
amount = 1
commission = 0.1
for t in thresholds:
    query = f"""
    SELECT sum(profit) FROM (
            CASE WHEN win_lose THEN -{amount} ELSE  (1-{commission}) * {amount} / (round(bsp, 2) - 1.0) END as profit 
        FROM data
            bsp <= {t} and bsp > 1 and event_dt > '2010-03-03 00:00:00'
    ) as sq
    df = pd.read_sql(query, con=engine)
    profits.append([t, df.loc[0, "sum"]])

data = {
    "bsp": [p[0] for p in profits],
    "profit": [p[1] for p in profits],
source = ColumnDataSource(data=data)

p = figure(plot_width=400, plot_height=400, title="Profit by BSP Threshold", x_axis_label="BSP", y_axis_label="Profit")
p.scatter(x="bsp", y="profit", source=source, line_width=2)

When plotting the profit against the threshold, the following chart was generated:

Profit for BSP Lay the Field

On a first glance it seems that laying selections below 1.1 might be profitable. You can easily re-generate above chart with a higher resolution for limits in the range 1.01 - 1.1 which looks like the following:

Profit for BSP Lay the Field Low Odds

When looking at the bets per month or similar measure you will notice that only a handful of bets are placed as extremely low BSP prices rarely occur. This was a concern that I had but still I went ahead and tried it out on the exchange with minimum stakes.

Applying the Betting Strategy

It is very easy to automate this strategy on the Betfair exchange as Betfair allows you to place BSP lay bets with a maximum odds filter. In this case the bet is only placed if the odds is below or equal to a value and voided otherwise. I personally applied this strategy with minimum stake on the Betfair exchange using a odds limit of 1.04 over a period of one year or so. During this period I made some discoveries which explain why blindly laying selections at low BSP does not generate any profit on the long term. Most of the issues are starting price related which I discussed in a separate blog post called Be cautious when using starting price bets.

BSP and Non-Runner

One of the problems with betting at BSP is the handling of non-runners. You need to place your BSP bet before the start of the race, otherwise you won't be able to bet at starting price. However, if you place your bet too early you have the risk of non-runner which means that your odds limit and size gets adjusted and you might miss a selection. This could cause some deviation from the back test.

BSP Matching and Bet Placing Order

There is a special case when you place a BSP bet with an odds limit and the BSP is equal to your odds limit. Let's say you place a lay bet at BSP with a limit of 1.5 and the BSP is also 1.5. For such an event there are several possibilities:

  1. Your bet gets fully matched (all your liability is matched)
  2. Your bet gets partially matched (only a fraction of your liability is matched)
  3. Nothing gets matched (no bet)

Especially when working with a very low odds threshold (< 1.1) chances are high that a significant fraction of your bets is falling into this category. In order to take this into account we can somehow adjust the backtest for a worse case scenario: If the BSP is equal to the limit and the selection loses I assume that the bet is fully matched (maximum loss). If the BSP is equal to the limit and the select wins, I assume that nothing was matched (0 profit). This is kind of a worst case scenario.

Discrepancy between Historical Data and Live Betting

When you place a bet at BSP it is not guaranteed that the bet gets matched. To me it happened a couple of times that selections qualified (BSP lower than threshold) but for some reason my bet did not get matched, especially for markets with low liquidity. It also happened to me that betting on the exchange was suspended (not possible to place any bet at BSP) but in the backtest it would appear as a 1.01 selection that lost.

Blindly Laying Low BSP Selections is Not Profitable

Although the backtest suggested that this strategy is profitable - I have applied this strategy on the betting exchange for about one year as a test with an automated betting bot. The result is that in reality this betting strategy was not profitable at all.

Do you like our content? Please share with your friends!

Share on Facebook Share on Twitter


No comments published yet.

Please log in to leave a comment.

Similar Strategies
See all Strategies!
Any Questions or Suggestions?

If you would like to learn more about this strategy, please do not hesitate to contact us.

Contact Us!