Hi all ... I have recently discovered that you can download historical data from Betfair which records when prices were first and last matched, (as well as the number of bets made and the volume traded for a particular price). They are HUGE .csv files that contain over 1 million records of data ... literally every market (win, place, without fav, forecast etc) and every race at every course offered in a month recorded on a second by second basis.
It occured to me that knowing what prices the horses were at a particular moment in time, one ought to be able to "re-run" the race so to speak ie to simulate the race as it happened (as prices changed.)
Using Excel, I've managed to do a database query to bring in a days racing records onto one sheet ... then a pivot table to summarize the price changes second by second onto another sheet....
I've written formulas to put the names of the horses (from the pivot table) into where BA puts them and the time, e.g. 14:10:00, into the cell where BA puts the race time and lookup formulas to get each horses price at that time i.e. the price the horse was matched at 14:10:00 into where BA puts the Best Back Odds.
At the moment I'm manually inputting a new time e.g. 14:10:01, 14:10:02,14:10:03, etc to cause the lookup formulas to lookup the prices matched at those times. Very tiring for a 4 minute race ... over 240 entries! and if you include the price changes before the "Off" this easily gets to over 600 records for even a 5f race!!
I reckon a vb routine could do this for me but I don't know how ...I'm OK putting together spreadsheets using formulas but not programming.
Do any of you guys know how to write such a routine? ... Also, if the lookup formula returns 0, because no matched bet was made at that particular second, I need to have the program "remember" the last matched price and offer that as the current price instead of zero. Also, as a new price is matched, it would be great to copy the current Best Back odds price into the position for the 2nd best back odds price and put the new best back odds into the Best Back odds position. In this way, as the routine added 1 second to the time, all the price would update thereby simulating the race.
Once we had a means of simulating a past race, using actual price changes as they happened, we can use it to test our systems of betting, triggered betting in particular. We could use it to review races to hopefully spot useful trends.
Any thoughts on the idea? Any help available? ... I can post a typical pivot table if that would help.