Betfair Historical Data – Easy When You Know How

Betfair Historical Data has been, for some time now, openly available for free but it seems that no one is prepared to share just how you open the damned stuff!!!
There are plenty of sites out there willing to share their python knowledge but stop short of a full explanation – very frustrating.
At this point I have to give credit to “Trading The Market” guys who have finally given me the Eureka Moment!
If you follow the steps below you will soon have all the research information to back test your systems.
To begin with you do need to have a betfair account and to access which data you need you will need to be logged in and at the following page
https://historicdata.betfair.com/#/home

For the purposes of this post I will be using the basic plan which costs nothing and has a data frequency of 1 minute. If you need more frequent data logs then you will have to purchase your data by the month but there are free plans available for limited months mainly in 2020.
In this post I will be analysing the data from the North London Derby – Arsenal v Tottenham on the 1st October 2022
The easy way to handle this data is to “purchase” a month at a time so I will “Buy” the Soccer data from OCT 2022
To do this simply select the plan, sport, and month you need in the drop down boxes and click “Add to Purchases” and then the “purchase” as in the screen shot below

You will then be asked to confirm your purchase – Check that you haven’t included the wrong plan by mistake as the fee will be taken straight from your betfair balance. If everything is ok click confirm and you will see the following screen.

As you can see from the screen shot there are over 250000 markets! for our research we only need 3 or 4 of these so we need to find them.
I want to know how the under/over Markets behaved when each goal went in during the match. To do this click on the “My Data” Tab as shown below and you will see your most recent purchases as well as plans you have bought before.

We now need to populate the down load fields with the information that we need so if we look at the match stats we can see that there were 4 goals scored in total.

I want to see the following market odds
O/U 1.5
O/U 2.5
O/U 3.5
O/U 4.5
O/U 5.5
O/U 6.5
and the Match.
To do this we need to populate the download files panel as follows:

In the Plan Box (which is at the top but hidden in this screen shot) enter Basic
In the Sport Box enter Soccer
In the From and Upto Boxes enter 1 Oct 2022
Leave the event ID Blank
In the Event Name box enter Arsenal
In the Market Type box select the markets you need and in this case its Match_Odds
Over_Under_25
Over_Under_35
Over_Under_45
Over_Under_55
Over_Under_65
In the Country Box select GB (There is no UK)
and in the File Type Box select M
Click the Add to Downloads button
You now should have 12 files ready to down load.
Click the Yellow Download button

You will find this file in your downloads folder as a Data “tar” file

Double click the file to un pack it in your unzipping program

Keep double clicking until you get to the actual data files

You should now see your 6 “bz2” files
To make them easy to find Create a new folder on your desktop and name it ARS v TOT

You can now drag and drop the files into this folder from your unpacking software

We now need to convert these files into a readable format and Betfair provide one such program easily available from their website.

You will find this here

https://www.betfairhistoricdata.co.uk/

The first file we want to see is the Match Odds and this will usually be the largest file as most volume would have passed through that market. In this case we are looking at File 1.203213491

These are not very user friendly file names so I am going to rename them. to do this we simply select a file from the list using the betfair Historical Data Processor as below and note the file number and which market it contains. In this case File 1.203213498 is the O/U 6.5 goals Market. We dont want to do anything else yet. We are just identifying the files for our convenience

We can then repeat the process with all the files noting the file numbers to the markets and then rename all the files as below

We are now going to convert these files into meaningful excel ranges where we can look at them in more detail. To do this we again select a file from the folder using the Historical Data Processor and click the download settings button as shown in the screenshot below

This will open the settings dialog box as shown below

We now need to populate our spreadsheet with any relevant information we will need by clicking the drop down box arrow and selecting the fields by ticking the relevant tick boxes (dont worry if you put too much info into the spreadsheet as we can delete it later)

Once you have selected what you need close the drop down box by clicking the “up” arrow and because we are just interested in the in play data slide the “preplay” button to off as shown below and click save

We are now ready to download the file as a CSV file into Excel we do this by simply clicking the “Download CSV” button as shown and let the wonders of better brains than our own do its stuff.

This will put a zipped file into your downloads folder with the original file number

If we double click this file it will unpack and be available as a csv file which we can open with excel.

It may be a good idea to move this file to a new folder on your desktop and rename it as I have done here

If we open this in excel this is what we get.

We can now start to manipulate the data to best suit our needs. We can start by removing some of the columns we dont need. I have removed the following columns to be left with the following spreadsheet.
Market ID
Selection ID

The next task is to make the published time more reader friendly. as you can see this is total jibberish, it means nothing. If you select cell A2, in the address window you will see that the full date and time is shown

So that column A shows the time in hrs and minutes we need to select hh:mm from the custom cell formats as shown below.

When we click ok then cell A2 will show the actual time of the published data for that row

To convert all the row simply select Column A and repeat

When you click ok your spreadsheet should look like this

you will notice that the times are repeated 3 times this is because there are 3 separate outcomes within this betfair market – Arsenal to win The Draw and Tottenham to win.
If we now draw our attention to Column F this is the last traded price column and we could do with tidying up this so that all the figures are shown to 2 decimal places. To do this simply select Column F and using the cell number format dropdown box, select “Number” as shown below.

Your spreadsheet should now look something like this

A bit more tidying up by changing the column headers and this is what you should be looking at.

This is your basic data spreadsheet for the entire match for the Match Odds Market You can now save it into a folder and repeat the process with the other 5 markets

In my next post I will show you how to manipulate the data so that we can see what happened in each market as each goal went in

Please like and subscribe to my blog so that I can get a feel for what content can be most useful to you.

Tennis Trading No 5 Dutching the Set Betting Market

With Wimbledon just around the corner I thought it might be interesting to explore the possibility of dutching the set betting market for the WTA as there is only 4 possible outcomes and using betangel’s dutching tool I can place orders into the market to ensure a 20% or better return on a £10 total stake.
The french Open is currently at the 4th round stage in the WTA competition and there are just 4 matches today (Sunday 4th June 2023)
The risk to reward on this is quite high depending on the odds offered. anything from a 50% risk up to a mighty 80% risk.
In this exercise I will be placing the margin stake onto the favourites 2-0 score
Match 1 Pavlyuchenkova v Mertens
This is an evenly matched match where both players are at around even money to win the match.
The screen shot below shows the bets placed

As you can see I have put the margin stake onto Mertens 2-0 scoreline at odds of 11
This is a massive risk to reward scenario as I am risking nearly 89% of my £10.00 stake for a 25% return. One of the factors that has helped me make this decision is that I have downloaded all the results from the previous 3 WTA French Opens into a spreadsheet and filtered the results into following criteria.
1. Winners price at the start of the match is between 1.90 and 2.10
2. 2-0 set result
3. 4th round matches only
Having filtered these factors the resulting percentage of matches that ended 2-0 are just 3 from a total of 24 4th round matches – just 12.5%
If we drill this down even further to include ALL matches that ended 2-0 where the winners odds were between 1.9 and 2.1 we find that from 381 WTA French Open matches that have been played in the previous 3 years there was just 20 that is just over 5%
What we also have to remember is that we are only interested in the odds selected for movement only need to move so far in order to be matched. In close matches such as this a first set score of 5-5 could be enough to convince the market that the match could go to 3 sets.

As I said there are four 4th round matches today and the next one is between Muchiva and El Avanesyan
Muchova is odds on favourite to win at odds of 1.27

In this dutching trade I am risking 53% of my stake for a 25% return
While the risk to reward is much less than the previous match if we look at the spreadsheet and input the same figures in relation to this match ie where the Winning favourite was between 1.25 and 1.3 there was just 1 (one) match in the fourth round that ended 2-0 and just 21 out of all 381 French Open Matches from the previous 3 years.

The 3rd match of the day is between Svitolina and Kasatkina. Kasatkina is favourite at odds of 1.66 to win the match

The final match today is Stephens v Sabalenka where Sabalenka is 1.25 to win the match

With all dutch trades in place I will post the logs and final tally tomorrow
My Maximum loss for these four trades should they all lose is £27.39 out of £40.00
My Maximum Profit is £10.17
This signifies a 37% reward to risk factor but considering the very basic research I explored I am hopeful for a 75% strike rate

Profit or Loss from Dutching WTA French Open

As a follow on to my third post in this series I thought it would be interesting to see just how much profit or loss I would make by dutching all the WTA singles matches from day 2 of the tournament using just the following criteria.
Favourite starting odds of 1.20 or less
£10.00 total stake
Favourite to be backed at odds that would achieve a 10% profit margin



Player 1OddsPlayer 2Odds Matched OddsProfit
/Loss
Max Risk
Avanesyan7.00Bencic1.141.33£1.15£1.60
Vondrousova1.11Parks10.001.25£1.09£1.11
Ostapenko1.14Martincova6.81.33£1.13£1.64
Kudermetova1.09Karolia8.61.3£1.18£1.40
Total Profit for Day 2 £4.55 from 4 trades

Trading Tennis No 3. Dutching a Tennis Match

Dutching a Tennis match may seem a little bizarre as there are only 2 players but with the volatility of the market during in-play it is possible to trade in this way by backing the underdog at the outset at the same time as placing a back bet order into the market at odds higher than the current odds with the view that it will get matched at some point during the match. Some pre match research is essential when attempting this sort of trade so that you know roughly at what point your order is likely to be matched. This is done primarily with Bet Angels “Tennis Trader” tool. If you have read my previous posts on trading tennis you will know that this can be an invaluable way of predicting a feasible exit point for your trade and giving an insight to your potential risk to reward.
It is a fact that in Tennis the WTA is the most prolific for having breaks of service, even with the most accomplished players and the fact that that players who are vastly overwhelmed by their opponents experience can overcome some of that prowess by playing in “overdrive” in the first set. This can mean that players who start the match at odds in the region of 1.05-1.2 can see their odds of winning the match increase to a point where this strategy can yield a 10% return on your stake.
To illustrate this I have put a screenshot of the log I recorded yesterday of the match between Zidansek and Zheng. Zheng is seeded 19 and Zidansek is a qualifier.

As you can see Zheng started the match at odds of 1.16 but 10 minutes into the fist game her odds had risen to 1.34 before dropping back down to 1.18 and then back up to 1.3 and then back to 1.13. If we look at the actual game scores we can see that Zheng won the first two games breaking Zidansek’s serve in the second, but in the 3rd game Zidansek broke back to win the 3rd game and this is where these odds of 1.3 + would have occurred. This doesn’t mean that Zidansek was on to win the entire match it was just the market reacting to the in-play state of the match. Below is a screenshot of the first few games of the first set and as you can see Zidansek gave a fair account of herself.

So when we look at matches such as these “uncompetitive” matches as far as the starting odds would have it, there are some distinct possibilities that occur during the match and in particular in the first set that we can take advantage of. This is the essence of the trade I am going to outline in this post. If you have read my previous posts on tennis trading we are looking for the most reward against the least risk taken and to that end I am going to show you one match where there are two possible ways of making the same trade. For this I am going to turn to Bet Angel once again because it is the easiest way to place this trade into the market but this can easily be done manually as well by using a simple dutching calculator available for free on the internet. I will show this method later in the post. But first to Bet Angel. The screenshot below shows the Bet Angel dutching screen and the match loaded is between Vondrousova and Parks. Vondrousova is odds on to win with odds available to back at 1.10 Parks, the rank outsider is 10.00. We know that Vondrousova will 90 times out of 100 win this match, the odds tell us this so we would expect Parks odds to drift out to 1000 by the end of the match and we would be able to get any odds between 10.00 and 1000 matched at somepoint in the match so logic tells us that we should back Vondrousova at the start of the match and put an order into the market on Parks that is pretty certain to be matched at some point.

The Bet Angel Dutching tool enables us to select a margin of profit and total stakes If you look at the screen shot above the software is set to back Vondrousova for a stake of £9.99 and place an order into the market for a penny at odds of 1000 this, if it were possible, would net us 97p at the end of the match if Parks lost. The problem we have in this trade is that we would be risking £9.99 for a reward of 97p
If we now switch this around so that we are backing Parks at the onset of the match and placing an order to be matched in play on Vondrousova the risk to reward has been turned upside down

This trade would now put an order into the market on Vondrousova at odds of 1.25 for £8.89 and place a bet that would be matched straight away on Parks for £1.11 at odds of 10.00. We now are risking just £1.11 for a reward of £1.09 – Even Money. So what are the chances of Vondrousovas back bet being matched in play? If we look at Tennis Trader (Screenshot below) We can see that it would only take a break of serve in Parks’ favour and for her to hold her serve until the 6th game for this bet to be matched.

It would not be advisable to blanket dutch all matches that have a favourite starting the match at odds of say 1.20 or less in this way as you would need to research the players to get some sort of feel that is the underdog capable of breaking the serve if he/she goes all out in the 1st set. But for the purposes of this post I will do just that on all of the WTA 1st round matches on day 2 in the French open today that have a favourite that starts at odds of 1.2 or less and post the results tomorrow.


Now I said earlier that you can perform this trade without the aid of Bet Angel by using a simple Dutching Calculator. For this I will use OddsMonkeys very capable dutching calculator which is available to use for free (I will post a link below) In the sceenshot below I have populated the fields with all the relevant information
Stake £10
Parks Odds 10.00
Vondrousovas Odds 1.10
Commision 2% for both bets
I have set the stake to be split over all selections and for the individual stakes to be rounded to a penny.

As you can see we need to adjust the odds for Vondrousova to make the profit show our 10% target for this trade which is about a quid.

1.20 is not enough as it only produces a 66p profit over all

1.3 is too much as it gives a profit of £1.43

Bingo! we have our desired odds at which we will place our order on Vondrousova and what stakes to use AFTER we have placed our bet on Parks. There is just one thing to remember and it is vital. Once you have placed your Vondrousova order into the market you must set the bet to “KEEP” otherwise when the market goes in play your order would be cancelled and you would in effect have a quid on Parks to win only. One more thing to remember is that if you are doing this manually on betfair your minimum stake is £1.00 so you may need to adjust your total stake to bring that to that amount.

Link to OddsMonkey Calculators

If you are interested in using Bet Angel for free for 2 weeks click here for a 2 week free trial

Tennis Trading – Roland Garros – Trading the Fav in the first game only

As a follow on to my first post in this series I thought it would be interesting to see just how much profit or loss I would make by Trading the first game of all the WTA singles matches throughout the tournament using just the following criteria.
Favourite must be priced above 1.60 – 55 seconds before the start of the published start time.
Stakes are to a £10 back bet on the favourite in this timeframe

If you missed this post or any posts in the series click the link below

Trading Tennis



Because I am using Bet Angel Automation for this study the trade will be hedged automatically when the score for game 2 is 0-0 at least 1 minute after the match has gone in-play.
There are 20 ladies matches today (Sunday 28th May 2023)
Five Matches started at around 10:00 am
In the table below I have Nominated Player 1 as the Favourite

Day 1 WTA First Round Matches

Player 1ServingPlayer 2Fav odds matchedHedged oddsProfit/Loss
DiazNoSaunders1.982.22-£1.03
PodoroskaNoPonchet1.751.39£2.59
SabalenkaKostyuk<1.60N/A£0.00
ShymanovichUdvardy<1.60N/A£0.00
FrechZhang<1.60N/A£0.00
RakhimovaYesBejlek1.891.70£1.10
FrenandezNoLinette1.962.02-30p
SakkariNoMuchova1.971.38£4.27
TausonNoSasnovich1.671.5483p
MertensNoHruncakova<1.60N/A£0.00
GiorgiCornet<1.60N/A£0.00
BirrelYesJeanjean1.871.6£1.69
ZhengZidansek<1.6N/A£0.00
PotapovaTownsend<1.6N/A£0.00
BeguBondar<1.6N/A£0.00
PegulaCollins<1.6N/A£0.00
TeichmannErrani<1.6N/A£0.00
KasatkinaNiemeier<1.6N/A£0.00
SamsonovaVolynets<1.6N/A£0.00
SherifBrengal<1.6N/A£0.00
Total P/L Today £9.15

Day 2 WTA First Round Matches

Player 1ServingPlayer 2Fav odds matchedHedged oddsProfit/Loss
SerranoBogdon1.681.45£1.40
PeraKontveit1.831.6886p
PliskovaStephens1.912.14-£1.07
SvitolinaTrevisan1.761.6472p
KvitovaCocciaretto1.841.60-£1.47
MandlikWaltert1.912.18-£1.24
Total P/L Today -80p

I have only listed the matches in day 2 that fit the criteria outlined in the post and as you can see I made a small loss from the 6 matches. So far with this trade I have a profit of £8.35 in this WTA French Open

Day 3 WTA First Round Matches

Player 1ServingPlayer 2Fav odds matchedHedged oddsProfit/Loss
PetersonFerro1.742.04-£1.47
AzarenkaAndreescu1.621.85-£1.24
MarticRogers1.731.86-70p
DodinJanicijevic1.691.88-1.01
NoskovaKovinic1.751.6466p
Todays Loss – £3.76

Day 4 WTA Matches

Player 1Player 2Fav Matched OddsHedged OddsProfit/Loss
AndreescuNavarro1.761.5£1.70
DanilovicPaolini1.771.6384p
VekicPera1.831.53£1.92
TormoMartic1.892.16-£1.25
Todays Profit £3.21

Day 5 WTA Matches

Player 1Player 2Fav Matched OddsHedged OddsProfit/Loss
PotapovaPavlyuchenkova1.671.6418p
Muchova Begu1.721.6168p
Todays Profit 86p

Trading Tennis No.2 Break of serve near the end of set

Yesterday I looked at trading a tennis match on just the first game of the first set in a tennis match. Today I will look at the risk to reward of a trade where, when the conditions are right, we can lay the favourite if he/she is serving for the 9th game and the scores are 4 games each in the first set. As I explained in the first post in this series we get the biggest movement of odds when a break of serve occurs in a set or match. If we look at a more critical stage of a match such as the later stages of the first set where the scores are level after the 8th game then if the favourite is serving the 9th game and his/her opponent can break the serve then they would be serving to win the set in the next game. I will use Bet Angels Tennis Trader feature to demonstrate this a little more clearly than just quoting numbers. In the screenshot below I have manually set the score to 4-4 in the first set of the first round match of the French Open between Nadia Podoroska and Jessika Ponchet. Podoroska is the favourite to win this match and will probably start the match at odds of somewhere around 1.75. If the first set reaches 4 games all then Tennis Trader project her odds to be around 1.78 (the figure ringed in the set matrix)

If Podoroska wins this service game then her odds would move in to 1.66, a movement of 12 ticks. If however Ponchet can break the serve at this critical stage of the set then she would then be serving for the set in game 10 and Podoroskas odds would move significantly the other way to somewhere around 2.88. This is a movement of around 65 ticks. We can now determine a trading strategy based on these two outcomes of the 9th game and place a trade accordingly knowing our potential loss or profit. Because the biggest movement in these two scenarios are upwards in terms of ticks then we would be looking to LAY Podoroska just before the start of the game. As we are putting our trade into the market during in-play we have to take account of the fact that betfair imposes a 3 second delay from when we place the lay bet to when it actually enters the market. While this shouldnt be a problem with high volume markets it could be a problem with markets that have low liquidity so this is one of the factors we should address when we are framing the trade – if there is low liquidity we may not getour lay bet matched. This aside we can work out our risk to reward in the following way.
If we LAY Podoroska at odds of 1.78 for a stake of £10 then our Liability would be £7.80
If Podoroska goes on to win the game then we would have to trade out of the match by backing her at odds of 1.66 for a stake of 10.72 so our loss on this trade if podoroska wins the game would be in the region of 72p
If Ponchet breaks Podoroska’s serve then with the same lay bet in place we would, at the end of the game , be able to place a back bet on Podoroska at odds of 2.88 for a stake of £6.18 giving us a profit of around £3.74 so our risk to reward would be 72p loss or £3.74 profit.
These figures might be a bit bewildering and you might wonder how I came by them. The answer is simple I used a lay bet calculator freely available across the internet in particular I used the free hedging calculator on https://www.goalprofits.com/hedging-calculator/

I looked at 188 matches last week and set betangel to automatically trade a match where this scenario met the conditions above ie
The favourite must be serving for the 9th game
The game scores must be 4-4
I also added another condition that the odds of the favourite at the start of the 9th game must be between 1.5 and 1.9
Of the 188 matches only 5 met the criteria and 2 of these trades saw the favorite’s serve broken.
If you want to learn more about automating trades such as these using bet angel you can download a trial copy by clicking this link

Trading Tennis No 1 The break of service. Analysis of Match highlighted

Yesterday saw the first post of a new series of posts highlighting the risk to reward options of various tennis trades. In this post I outlined 4 possible trades that were available to us on the very first game of the fist set. To visit this post click on this link.

The image below is a screenshot of the flashscore site showing the result of the first game and how it was won.

As you can see Bronzetti won this game breaking Grabhers service after 2 break points. The image below is the set matrix shown in yesterdays post and I have ringed the end of set odds.

There is another feature of Bet Angel that can help us analyse our trades and this is an ability to log each players odds at whatever intervals you wish throughout the match. This enables you to see the way the odds moved as each point is won or lost. I have provided a screenshot of the 1st 6 1/2 minutes of the 1st game below.

The time elemnts of this spreadsheet are actual time ie 12:24:11 pm and if you follow the odds for Bronzetti which in this case are logged every 30 seconds you can see that her odds in the first game after 6 minutes play (12:30:14) they bottomed out at 1.39. In the next screen shot I have added the scores and you can see that when Bronzetti won a point her odds dropped and when Grabher served her 2 points that she won the odds rose slightly

Yesterday I outlined 4 different trades that we could have done on this first game in the match and Trade 2 had the best risk to reward option for us. The odds for Bronzetti to win the match at the time of writing yesterdays post was 1.74 however this was at 7 am – 5 hours before the start of the match. When the match finally started at 12:24 pm her odds had dropped to 1.69. Tennis Trader predicted that if Bronzetti won the game then her odds would be around 1.44 they actually reached 1.39.

If you missed yesterdays post click this link to have a look

In this case our best trade option won out and we profited by it Please subscribe to my blog if this has peaked an interest in trading tennis as I will be sharing lots more opportunities for making educated decisions on trading tennis matches and its more exciting than laying the draw in a football match.

If you are interested in trying Bet Angel you can download a free trial by clicking here to take you to the Bet Angel website I reccommend it and it wont cost you a penny.

Trading a Tennis Match

With the Madrid open starting this weekend I watched a couple of YouTube videos on trading tennis and was astonished to learn that Betfairs’ tennis markets regularly trade in 5 or 6 figure turnovers. One of the contributing factors of this is the fact that because the game can swing dramatically from one player to the other the odds swing with the markets can move considerately. For instance a lay bet of £20.00 on the favourite who’s odds are perhaps 1.35 at the start of the set will only have a liability of £7.00. If the other player then serves first and wins the first game then the odds of the favourite could well swing up to 1.5 and a back bet of £18.00 at those odds would see you making a profit of around £2.00 – a better than 25% return on your investment. If on the other hand the game goes the other way and the favourite wins the first game then the odds might swing down to perhaps 1.25. A back bet of £17.00 at 1.25 would only leave you with a loss of £2.95 if the favourite went on to win but a £2.94 profit if he/she was to go on to lose.
With this in mind I placed a lay bet of £20.00 this morning on Aslan Karatsev at odds of 1.36 giving me a liability of £7.20.

With an hour to go before the first serve I can already trade out for 14p

20 minutes later the odds have reverted back to 1.36 and £20,000 more have been matched. I feel that I have perhaps jumped into this too soon as I dont know who will serve first So will cash out for no loss or profit and wait until they come out on court.

I have to admit to knowing absolutley nothing about tennis and even less about these two players but just some prelimianary research shows that Ugo Humbert is ranked 32nd in the ATP singles rankings and Aslan Karatsev 27th. The void in-between these two players odds, considering their closeness in the rankings suggests that Karatsev is on fire at the present time and a look at his form shows that he won 3 of his last 4 games in Belgrade kncking out Djokovic 2 sets to one.
The match is now underway and Humbert served first winning the first game to 15 giving me a cashout of about 90p