Recording Betfair Horse Racing data

Post Reply
trifletastic
Posts: 13
Joined: Sat May 26, 2018 4:41 am

Hi folks. I've been using BA for a couple of months now, and am starting to get the hang of things. Really love the Excel integration which led me to build this data capture file which I thought I might as well share if anyone is interested.

It captures every change on the spreadsheet and at the end of the race saves the data into an Excel file in a location you specify with the name and time of the race as the file name. (It won't work on US racing as it is, because the markets don't go in-play, so the trigger to finish the race isn't received - at the moment the trigger is a price differential between max LTP and min LTP of >800ish while the race is both suspended and in-play, which you won't see before off, of course)

It will create 5 worksheets in the data file, with the following columns:

Header: Event ID, Event Description, Number of Runners, Event Start

Selections: Event ID, Selection ID, Selection Name, Saddle Cloth Number, Stall Number, Jockey, Trainer, Starting Price, Reduction Factor

Timeline: Snapshot ID, Event ID, Snapshot Time, Event Status

Volume: Snapshot ID, Event ID, Volume Movement

PriceData: Snapshot ID, Event ID, Selection ID, Last Traded Price, Volume, Trade

MarketMoney: Volume Snapshot ID, Price Snapshot ID, Selection ID, Back Price, Lay Price, Back Available, Lay Available

AuditLog: This is a log of all of the runs of the data capture cycle. Useful for debugging if something goes wrong, but no use at all for trading, so you can ignore this.

If you're used to working with large amounts of data then this should be no problem to navigate, there are all the relevant primary and foreign keys in the data to make linking everything together easy.

When you start using it you'll need to change the file location in the grey box at the top to the place that you want to store the files it spits out (don't forget to have a "\" as the final character in the address though, otherwise it won't work).

There's an on/off switch at the top (in-cell dropdown) which you can use to stop it creating the data.

If you want to track a full day's racing I'd recommend saving 3 versions of this 7_1, 7_2 and 7_3 (also change the last number on the sheet name to 1, 2 or 3) and launch multiple instances of BA. Set Guardian up in each so that each instance tracks a different set of races. You could even do one per meeting, if you found that easier to manage/set up.

There's a bit more detail about the fields below, but if you've got any questions just shout. If there's enough interest I could put something together that uses these files to recreate the betfair charts, allowing you to go back and look at any selection from any race you've tracked, both pre-off and in-play.

Cheers
Ric


Some field descriptions:
Event ID = the betfair event ID, which will match back to the files they publish
Event Description = the event description provided in BA's Excel file
Selection ID = the ID given to each horse by betfair
Snapshot ID = the count of the snapshots the data capture file takes
Volume movement = total market volume movement
Volume = the volume movement on this selection at this snapshot
Trade = the estimation of the direction of the trade related to the volume movement i.e. Back/Lay/Between - as it isn't possible to work out exactly which way every trade goes as the market moves faster than Excel (should get the big moves right though)
Back Price = Best Price available to back at this snapshot
Lay Price = Best Price available to lay at this snapshot
back available = back money waiting to be matched at the back price
lay available = lay money waiting to be matched the lay price

p.s. I'm also working on a database to store all of this data and hopefully combine it with the BSP data that Betfair release to build a more comprehensive picture. But that's a more long term goal at the moment.
You do not have the required permissions to view the files attached to this post.
trifletastic
Posts: 13
Joined: Sat May 26, 2018 4:41 am

Here's an example data file from an AUS race on the 11th.
You do not have the required permissions to view the files attached to this post.
User avatar
C769330
Posts: 13
Joined: Wed May 17, 2017 12:04 pm

Great spreadsheet Ric - is Volume ID and Snapshot ID able to line up? - I notice that Volume ID always has two less numbers than snapshot ID (I know Volume ID starts at 0 and snapshot ID starts at 1) - this would help me re-create the recorded activity

cheers

Michael
Post Reply

Return to “Betfair Data”