Race distance

Please post any questions regarding the program here.

Moderator: 2020vision

Race distance

Postby barakg » Tue Apr 09, 2013 11:45 am

Hi,
In a horce race, if you use login to excel, you can see the distance of the race in cell A1 (or the upper left cell in which the login begins). The problem: it's "complicated" to extract the exact legnth from that cell, so you can use it in some of your excel formulas (it can be 7f, 2.4m...).

Is there any other way i can get it through BA?

Thanks
barakg
 
Posts: 64
Joined: Wed Jan 28, 2009 12:21 pm

Postby mak » Tue Apr 09, 2013 12:06 pm

place this in cell BT1
=IF(MID(A1;FIND(":";A1)+6;1)=" ";MID(A1;FIND(":";A1)+4;2);MID(A1;FIND(":";A1)+4;4))

place this in cell BT2
=IF(TYPE(FIND("m";BT1))=16;LEFT(BT1;LEN(BT1)-FIND("f";BT1)+1)*1;IF(TYPE(FIND("f";BT1))=16;LEFT(BT1;LEN(BT1)-FIND("m";BT1)+1)*8;LEFT(BT1;FIND("m";BT1)-1)*8+MID(BT1;FIND("m";BT1)+1;FIND("f";BT1)-FIND("m";BT1)*1-1)))

in BT2 you will have distance in furlongs

* I think it is Gary's formula...
mak
 
Posts: 1086
Joined: Tue Jun 30, 2009 8:17 am

Postby barakg » Tue Apr 09, 2013 12:27 pm

Thanks!

You need to change all the ";" into ","
barakg
 
Posts: 64
Joined: Wed Jan 28, 2009 12:21 pm

Postby MiniBlueDragon » Tue Sep 24, 2013 10:41 am

Have I missed something here? The Betting Assistant for BetDaq (ver 1.0.9.0) only shows the following in cell A1:

14:00 Lingfield Win Market

There's nothing to be parsed to get the race distance. :/
MiniBlueDragon
 
Posts: 130
Joined: Tue Jul 05, 2011 1:14 pm
Location: London

Postby mak » Tue Sep 24, 2013 11:27 am

if i remember correct BetDaq api only shows this info in cell A1 anyway
mak
 
Posts: 1086
Joined: Tue Jun 30, 2009 8:17 am

Postby MiniBlueDragon » Tue Sep 24, 2013 11:29 am

Ah right, no worries. I'll add it to my screen scrape then and pull it off Sporting Life.

Thanks for the reply. :)
MiniBlueDragon
 
Posts: 130
Joined: Tue Jul 05, 2011 1:14 pm
Location: London

Postby osknows » Tue Sep 24, 2013 11:48 am

Here is a solution which scrapes the RP data and then matches the course names. I haven't checked if all course names in the sheet LOOKUPS align with Betdaq output in cell A1 so some may need amended.

http://www.mediafire.com/?yulwvnq13uw72ym
User avatar
osknows
 
Posts: 946
Joined: Wed Jul 29, 2009 12:01 am

Postby MiniBlueDragon » Tue Sep 24, 2013 11:59 am

Cheers osknows. I think I've pretty much scraped what I need now via the existing vba. Just finished parsing the distance from the output:

At The Races Nursery 5f
(2yo, 5f, Class 5, 9 runners)
Winner £2,727 2nd £805 3rd £403
Going: Standard
Surface: Polytrack

The code (if anyone else can benefit) I'm using is:

Code: Select all
' Find first comma
openingParen = InStr(oDocRaceTitle(0).innerText, ",")
' Find first bracket
closingParen = InStr(oDocRaceTitle(0).innerText, ")")
' Grab data between the comma and bracket
enclosedValue = Mid(oDocRaceTitle(0).innerText, openingParen + 1, closingParen - openingParen - 1)
Find the first comma within the new string
j = InStr(enclosedValue, ",")
' If a comma is found trim everything including that comma to leave the race distance
If j > 0 Then enclosedValue = Trim(Left(enclosedValue, j - 1))


Tying the above into my existing race distances table I can now cancel bets depending on race time rather than at 40 seconds no matter the race distance.

Fingers crossed that means more value! :)
MiniBlueDragon
 
Posts: 130
Joined: Tue Jul 05, 2011 1:14 pm
Location: London

Postby MiniBlueDragon » Tue Sep 24, 2013 12:13 pm

In addition to the above I found I need this:

Code: Select all
j = InStr(oDocRaceDistance, " ")
If j > 0 Then oDocRaceDistance = Trim(Left(oDocRaceDistance, j - 1))


That drops any "meters" distances from the string to enable an easy match to my table via Index and Match.

(I realise it means that if a race is 1m short of the next rounded distance it means cancelling slightly earlier than ideal but it's good enough for me.)

:)
MiniBlueDragon
 
Posts: 130
Joined: Tue Jul 05, 2011 1:14 pm
Location: London


Return to Help

Who is online

Users browsing this forum: Bing [Bot] and 68 guests

Sports betting software from Gruss Software


The strength of Gruss Software is that it’s been designed by one of you, a frustrated sports punter, and then developed by listening to dozens of like-minded enthusiasts.

Gruss is owned and run by brothers Gary and Mark Russell. Gary discovered Betfair in 2004 and soon realised that using bespoke software to place bets was much more efficient than merely placing them through the website.

Gary built his own software and then enhanced its features after trialling it through other Betfair users and reacting to their improvement ideas, something that still happens today.

He started making a small monthly charge so he could work on it full-time and then recruited Mark to help develop the products and Gruss Software was born.

We think it’s the best of its kind and so do a lot of our customers. But you can never stand still in this game and we’ll continue to improve the software if any more great ideas emerge.