How to record horse race data in intervals of 100 milliseconds?
I think you just need to have Guardian running on the appropriate refresh rate (restrict refresh for unnecessary markets) to try to get each market refreshed every 100ms.
To record the prices you can either have a rules file that stores the prices in SVs and run the export rule on each refresh or connect an Excel spreadsheet and use VBA to write the prices to a separate worksheet.
Not tried either myself but those methods seem straightforward.
It would probably kill most PCs after a short period of time trying to have so much data written directly to a connected spreadsheet hence most of those avaliable in the Betfair data section will only capture it as fast as every second.
The better method is to use stored vakues as mentioned by Derek above and then have them exported after ewxh market
but if you are wamting data from multiple markets at tbe same rime you wont be able to get it at exactly 100ms intetvals
for example if you had 5 markets in guardian then you could set it to 20ms and that would update each every 100ms but anymore than 5 markets youll need to open additional instances of Bet Angel if you want to try and maintain every100ms
Just seen your PM as well but think I covered all that above alreadyDallas wrote: ↑Sat Mar 11, 2023 12:33 amIt would probably kill most PCs after a short period of time trying to have so much data written directly to a connected spreadsheet hence most of those avaliable in the Betfair data section will only capture it as fast as every second.
The better method is to use stored vakues as mentioned by Derek above and then have them exported after ewxh market
but if you are wamting data from multiple markets at tbe same rime you wont be able to get it at exactly 100ms intetvals
for example if you had 5 markets in guardian then you could set it to 20ms and that would update each every 100ms but anymore than 5 markets youll need to open additional instances of Bet Angel if you want to try and maintain every100ms
- ShaunWhite
- Posts: 9731
- Joined: Sat Sep 03, 2016 3:42 am
It's usual to only record data changes, otherwise you end up with 1000s of identical records and a big processing load. You might be able to use what Derek suggested but then only run the export rule when any change (ie <>prevValue). I'm assuming you're only interested in a few data items.
But BA isn't really designed for this, if complete, high definition data is how you want to go then the only option would be to record the api stream but there's no commercial product available to do this and you'd need to invest some time developing something yourself. Betfair provide info about doing that in Excel/VBA if you wanted to keep it relatively familiar ...https://docs.developer.betfair.com/page ... Id=3834079
But BA isn't really designed for this, if complete, high definition data is how you want to go then the only option would be to record the api stream but there's no commercial product available to do this and you'd need to invest some time developing something yourself. Betfair provide info about doing that in Excel/VBA if you wanted to keep it relatively familiar ...https://docs.developer.betfair.com/page ... Id=3834079
Thanks Derek. Are there any available files on here that record less than 1 second? Cheers.Derek27 wrote: ↑Fri Mar 10, 2023 11:41 pmI think you just need to have Guardian running on the appropriate refresh rate (restrict refresh for unnecessary markets) to try to get each market refreshed every 100ms.
To record the prices you can either have a rules file that stores the prices in SVs and run the export rule on each refresh or connect an Excel spreadsheet and use VBA to write the prices to a separate worksheet.
Not tried either myself but those methods seem straightforward.
Thanks Dallas. Are there amy files on here that do that already? I have this file:Dallas wrote: ↑Sat Mar 11, 2023 12:33 amIt would probably kill most PCs after a short period of time trying to have so much data written directly to a connected spreadsheet hence most of those avaliable in the Betfair data section will only capture it as fast as every second.
The better method is to use stored vakues as mentioned by Derek above and then have them exported after ewxh market
but if you are wamting data from multiple markets at tbe same rime you wont be able to get it at exactly 100ms intetvals
for example if you had 5 markets in guardian then you could set it to 20ms and that would update each every 100ms but anymore than 5 markets youll need to open additional instances of Bet Angel if you want to try and maintain every100ms
BetAngel_Record_datav2.xls , from the forum, but as you know, it only records every second using the in play timer. Is there a line of code I can put in that code to record every 500ms or maybe 200ms? I think I would probably only need to add one line of code probably to the existing file. Thanks.
I haven't seen the file but it may require changing more than one line of code.Starbar wrote: ↑Sun Mar 19, 2023 12:19 pmThanks Derek. Are there any available files on here that record less than 1 second? Cheers.Derek27 wrote: ↑Fri Mar 10, 2023 11:41 pmI think you just need to have Guardian running on the appropriate refresh rate (restrict refresh for unnecessary markets) to try to get each market refreshed every 100ms.
To record the prices you can either have a rules file that stores the prices in SVs and run the export rule on each refresh or connect an Excel spreadsheet and use VBA to write the prices to a separate worksheet.
Not tried either myself but those methods seem straightforward.
The worksheet gets updated in about 5 places on each refresh and code can run on each update, whether the clock timer changes or not. So I guess the VBA checks if the clock has changed rather than getting updated. If you edit the code to execute some code each time the clock or any other part of the sheet is updated you may be able to get it to run on each refresh.
In VBA you can run perform the following to get milliseconds
Dim strMyVariable as string
strMyVariable = format(now,() "hh:mm:ss") & right(format(timer, "0.000"), 4)
You can't store it to a date/time variable as the date data-type doesn't support milliseconds
In an excel formula you can get to milliseconds by using =now() and changing the formatting to be custom and set it to hh:mm:ss.0
the bit after the dot will be the milliseconds.
Dim strMyVariable as string
strMyVariable = format(now,() "hh:mm:ss") & right(format(timer, "0.000"), 4)
You can't store it to a date/time variable as the date data-type doesn't support milliseconds
In an excel formula you can get to milliseconds by using =now() and changing the formatting to be custom and set it to hh:mm:ss.0
the bit after the dot will be the milliseconds.
OK. Thanks Derek.Derek27 wrote: ↑Sun Mar 19, 2023 6:07 pmI haven't seen the file but it may require changing more than one line of code.Starbar wrote: ↑Sun Mar 19, 2023 12:19 pmThanks Derek. Are there any available files on here that record less than 1 second? Cheers.Derek27 wrote: ↑Fri Mar 10, 2023 11:41 pm
I think you just need to have Guardian running on the appropriate refresh rate (restrict refresh for unnecessary markets) to try to get each market refreshed every 100ms.
To record the prices you can either have a rules file that stores the prices in SVs and run the export rule on each refresh or connect an Excel spreadsheet and use VBA to write the prices to a separate worksheet.
Not tried either myself but those methods seem straightforward.
The worksheet gets updated in about 5 places on each refresh and code can run on each update, whether the clock timer changes or not. So I guess the VBA checks if the clock has changed rather than getting updated. If you edit the code to execute some code each time the clock or any other part of the sheet is updated you may be able to get it to run on each refresh.
Thanks Paul. Very helpful!ODPaul82 wrote: ↑Sun Mar 19, 2023 6:59 pmIn VBA you can run perform the following to get milliseconds
Dim strMyVariable as string
strMyVariable = format(now,() "hh:mm:ss") & right(format(timer, "0.000"), 4)
You can't store it to a date/time variable as the date data-type doesn't support milliseconds
In an excel formula you can get to milliseconds by using =now() and changing the formatting to be custom and set it to hh:mm:ss.0
the bit after the dot will be the milliseconds.