get next USA race

Discuss anything related to using the program (eg. triggered betting tactics)

Moderator: 2020vision

get next USA race

Postby grimesy » Thu Nov 17, 2011 10:20 pm

Hello all,

I can get my Excel sheet to grab the next UK/Irish race using the below code; I have USA racing selected on my preferences; AND the races appear on my quick-pick list.

However, the Excel sheet will not auto-grab the next USA race [if a US race is the next one].

Suggestions?

Thanks.

=======================================================

Public Sub loadQuickPickList()
triggerQuickPickListReload = True
End Sub

Sub getNextRace()
Dim sports, sport, Events, evnt, diff, result
Sheets("Code").Select
If ba Is Nothing Then
Set ba = New BettingAssistantCom.ComClass
End If
sports = ba.getSports()
For Each sport In sports
If sport.sport = "Horse Racing - Todays Card" Then
Events = ba.getEvents(sport.sportId)
For Each evnt In Events
diff = DateDiff("s", Now(), evnt.startTime)
If diff >= 0 And InStr(evnt.eventName, "(") = 0 Then
result = ba.openMarket(evnt.eventId, evnt.exchangeId)
Exit For
End If
Next
End If
Next
Sheets("Code").Select
End Sub

=========================================================
grimesy
 
Posts: 53
Joined: Tue Sep 30, 2008 3:58 pm

Postby GaryRussell » Fri Nov 18, 2011 8:41 am

Change the line that reads
Code: Select all
If diff >= 0 And InStr(evnt.eventName, "(") = 0 Then

to
Code: Select all
If diff >= 0 And InStr(evnt.eventName, "(US)") <> 0 Then
User avatar
GaryRussell
Site Admin
 
Posts: 9872
Joined: Fri Nov 18, 2005 8:09 pm
Location: Birmingham, UK

Postby grimesy » Fri Nov 18, 2011 4:16 pm

Thank you Gary.

Just one further query if I may:- will that change still allow my Excel sheet to
continue to autograb the next UK/Irish race, in addition, to the US racing?

I'd also like to auto-pull RSA racing - is that a small coding change of similiar syntax, too?
grimesy
 
Posts: 53
Joined: Tue Sep 30, 2008 3:58 pm

Postby grimesy » Fri Nov 18, 2011 4:20 pm

i.e. If diff >= 0 And InStr(evnt.eventName, "(US, RSA)") <> 0 Then
grimesy
 
Posts: 53
Joined: Tue Sep 30, 2008 3:58 pm

Postby GaryRussell » Sat Nov 19, 2011 10:30 am

I'm not sure how that can work. Either you want UK or USA. If the code does both it will conflict unless you are talking about using it on separate tab pages so one tab page is dealing with UK races and another with US races.

You could change it so a parameter is passed to getNextRace so that you can specify which race you want.

eg.
Code: Select all
Sub getNextRace(country As String)
   Dim sports, sport, Events, evnt, diff, result
   Sheets("Code").Select
   If ba Is Nothing Then
      Set ba = New BettingAssistantCom.ComClass
   End If
   sports = ba.getSports()
   For Each sport In sports
      If sport.sport = "Horse Racing - Todays Card" Then
         Events = ba.getEvents(sport.sportId)
         For Each evnt In Events
            diff = DateDiff("s", Now(), evnt.startTime)
            If (diff >= 0 And InStr(evnt.eventName, "(") = 0 And country = "GB") Or _
            (diff >= 0 And InStr(envt.eventName, "(US)") <> 0 And country = "US") Or _
            (diff >= 0 And InStr(envt.eventName, "(RSA)") <> 0 And country = "RSA") Then
               result = ba.openMarket(evnt.eventId, evnt.exchangeId)
               Exit For
            End If
         Next
      End If
   Next
   Sheets("Code").Select
End Sub

You could then use getNextRace("GB") or getNextRace("US") or getNextRace("RSA")
User avatar
GaryRussell
Site Admin
 
Posts: 9872
Joined: Fri Nov 18, 2005 8:09 pm
Location: Birmingham, UK

Postby grimesy » Fri Nov 25, 2011 12:11 am

Thanks for your help Gary.

I'll look to incorporate your comments in two seperate tabs.

PS Customer service par excellence once again!
grimesy
 
Posts: 53
Joined: Tue Sep 30, 2008 3:58 pm

Re: get next USA race

Postby kiint » Mon Nov 28, 2011 8:29 pm

grimesy wrote:Hello all,

I can get my Excel sheet to grab the next UK/Irish race using the below code; I have USA racing selected on my preferences; AND the races appear on my quick-pick list.

However, the Excel sheet will not auto-grab the next USA race [if a US race is the next one].

Suggestions?

Thanks.

=======================================================


I just thought that I'd point out that selecting the next US race in the list won't necessarily mean that you are going to select the next US race to actually go off.
US races tend to go off when they are ready, not when the time says they should and so you could be missing a number of races that have run and finished whilst waiting for the next in the list.
One techinique I used for a bit was to cycle through the US quickpick list checking the amount of money that had been placed and when it reached certain limits, then assume this was the next to go.
However, considering another post where somebody had their account suspended for cycling through only once an hour, this may be a trifle dangerous to do these days.

HTH.
Kiint
kiint
 
Posts: 148
Joined: Tue Feb 23, 2010 12:12 am

Postby mrprobit » Tue Dec 13, 2011 2:43 pm

I Like to do this aswell, How do i implement this ? Is it a case of sticking that code into the VBA editor in excel or is other stuff I need to set up to enable this ?
mrprobit
 
Posts: 42
Joined: Sat Jun 13, 2009 11:34 pm


Return to Discussion

Who is online

Users browsing this forum: No registered users and 40 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.