How to record horse race data in intervals of 100 milliseconds?

Discussion regarding the spreadsheet functionality of Bet Angel.
Post Reply
Starbar
Posts: 12
Joined: Tue Dec 14, 2021 8:17 pm

Is this possible? Is there a spreadsheet that already does this? If not, how do I do it please? Thanks.
User avatar
Derek27
Posts: 23477
Joined: Wed Aug 30, 2017 11:44 am
Location: UK

Starbar wrote:
Thu Mar 09, 2023 8:36 pm
Is this possible? Is there a spreadsheet that already does this? If not, how do I do it please? Thanks.
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.
User avatar
Dallas
Posts: 22674
Joined: Sun Aug 09, 2015 10:57 pm
Location: Working From Home

Starbar wrote:
Thu Mar 09, 2023 8:36 pm
Is this possible? Is there a spreadsheet that already does this? If not, how do I do it please? Thanks.
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
User avatar
Derek27
Posts: 23477
Joined: Wed Aug 30, 2017 11:44 am
Location: UK

Did you type that out in a hurry Dallas, or has your keyboard broken? :lol:
User avatar
Dallas
Posts: 22674
Joined: Sun Aug 09, 2015 10:57 pm
Location: Working From Home

Derek27 wrote:
Sat Mar 11, 2023 12:42 am
Did you type that out in a hurry Dallas, or has your keyboard broken? :lol:
Mobile was on a go slow often displaying the words in bursts after typing them
User avatar
Dallas
Posts: 22674
Joined: Sun Aug 09, 2015 10:57 pm
Location: Working From Home

Dallas wrote:
Sat Mar 11, 2023 12:33 am
Starbar wrote:
Thu Mar 09, 2023 8:36 pm
Is this possible? Is there a spreadsheet that already does this? If not, how do I do it please? Thanks.
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 already
User avatar
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
Starbar
Posts: 12
Joined: Tue Dec 14, 2021 8:17 pm

Derek27 wrote:
Fri Mar 10, 2023 11:41 pm
Starbar wrote:
Thu Mar 09, 2023 8:36 pm
Is this possible? Is there a spreadsheet that already does this? If not, how do I do it please? Thanks.
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.
Thanks Derek. Are there any available files on here that record less than 1 second? Cheers.
Starbar
Posts: 12
Joined: Tue Dec 14, 2021 8:17 pm

Dallas wrote:
Sat Mar 11, 2023 12:33 am
Starbar wrote:
Thu Mar 09, 2023 8:36 pm
Is this possible? Is there a spreadsheet that already does this? If not, how do I do it please? Thanks.
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
Thanks Dallas. Are there amy files on here that do that already? I have this file:
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.
User avatar
Derek27
Posts: 23477
Joined: Wed Aug 30, 2017 11:44 am
Location: UK

Starbar wrote:
Sun Mar 19, 2023 12:19 pm
Derek27 wrote:
Fri Mar 10, 2023 11:41 pm
Starbar wrote:
Thu Mar 09, 2023 8:36 pm
Is this possible? Is there a spreadsheet that already does this? If not, how do I do it please? Thanks.
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.
Thanks Derek. Are there any available files on here that record less than 1 second? Cheers.
I haven't seen the file but it may require changing more than one line of code.

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.
User avatar
ODPaul82
Posts: 683
Joined: Sun May 08, 2011 6:32 am
Location: Digswell Herts

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.
Starbar
Posts: 12
Joined: Tue Dec 14, 2021 8:17 pm

Derek27 wrote:
Sun Mar 19, 2023 6:07 pm
Starbar wrote:
Sun Mar 19, 2023 12:19 pm
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.
Thanks Derek. Are there any available files on here that record less than 1 second? Cheers.
I haven't seen the file but it may require changing more than one line of code.

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.
OK. Thanks Derek.
Starbar
Posts: 12
Joined: Tue Dec 14, 2021 8:17 pm

ODPaul82 wrote:
Sun Mar 19, 2023 6:59 pm
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.
Thanks Paul. Very helpful!
Post Reply

Return to “Bet Angel - Spreadsheet / Excel chat”