Open soccer markets with Vba

Please post any questions regarding the program here.

Moderator: 2020vision

Postby osknows » Fri Feb 10, 2012 1:29 am

Yes but it means you currently have to manually load the resulting QPL into BA by right clicking the QPL list and select 'Restore quick pick list' and select the file created.

The above link specifically searches for Under/Over markets using
Code: Select all
If InStr(1, tBAEvents.key, "Over/Under", vbTextCompare) > 0 Then


but essentially it's possible to search for any terms and construct your own QPL file for import across any market.

I knew it was possible to search markets but Tradyann has come up with an excellent way to get them all into BA
User avatar
osknows
 
Posts: 946
Joined: Wed Jul 29, 2009 12:01 am

Postby faibo » Fri Feb 10, 2012 5:14 am

Thanks osknows.

I'm looking for full automation, so I'll stay with my actual code.
But loading the QPL file to BA using COM would be great and it would improve my code. Hope it is possible.
User avatar
faibo
 
Posts: 23
Joined: Sun Sep 18, 2011 9:02 pm

Postby Tradyann » Fri Feb 10, 2012 12:53 pm

Hi,

I've tried with other sports.
e.g. Basketball :

It's a 4 tree structure and "Fixtures 10Feb" is in treeL2.
I think it's ok after changing "today.. tomorrow in treeL2"...
and deleting "over/under" in
Code: Select all
If InStr(1, tBAEvents.key, "", vbTextCompare) > 0 Then


but it seems to be a problem with events with slash "/" in the line :
Code: Select all
BAEvents.Add tBAEvents, tBAEvents.key


"Basketball\Italian A1 2011/12..." (so between 2011 and 12)

Idem with tennis :
".. PTTPattaya Open 2012\H Chan/Y..."

:?:
User avatar
Tradyann
 
Posts: 139
Joined: Thu Dec 15, 2011 7:13 pm

Postby faibo » Fri Feb 10, 2012 10:37 pm

I figured out a simple way to automate this.

In preferences you have an option to retain your QPL. It will create a list in a txt file so BA can load it.

All you have to do is to export your QPL to that folder with the right name. Then using the excel special trigger "-3", BA loads the file you exported to the QPL.

The file is in "\Application Data\Gruss Software" folder.
It also have an option to load diferent QPL to diferent tabs.
User avatar
faibo
 
Posts: 23
Joined: Sun Sep 18, 2011 9:02 pm

Postby osknows » Fri Feb 10, 2012 11:54 pm

Another good find! So now there is a way to fully automate QPL selections and refresh each day.
User avatar
osknows
 
Posts: 946
Joined: Wed Jul 29, 2009 12:01 am

Postby Tradyann » Sat Feb 11, 2012 12:01 am

Yes very good!

The file is : BA_QuickPickList_Default_0.txt
in
AppData\Roaming\Gruss Software

It works very well... QPL appears immediatly (sorted) after -3 in Q2

8)
User avatar
Tradyann
 
Posts: 139
Joined: Thu Dec 15, 2011 7:13 pm

Postby Tradyann » Sat Feb 11, 2012 11:51 am

For fetching basketball, it's now ok too for me with this code :

Code: Select all
Public Sub LoadMarketCollection()
Dim sports As Variant, sport As Variant
Dim TreeL1 As Variant, Tree1 As Variant
Dim TreeL2 As Variant, Tree2 As Variant
Dim TreeL3 As Variant, Tree3 As Variant
Dim TreeL4 As Variant, Tree4 As Variant
Dim TreeL5 As Variant, Tree5 As Variant
Dim S1 As String, T1 As String, T2 As String, T3 As String, T4 As String, T5 As String
Dim id1 As String, id2 As Integer, id3 As Date, id4 As Boolean, id5 As Integer
Dim tBAEvents As clsEventCol, eventcount As Long, today As String, tomorrow As String

    Set BAEvents = New Collection

    If ba Is Nothing Then
        Set ba = New BettingAssistantCom.ComClass
    End If
   
    sports = ba.getSports()
    For Each sport In sports
        If sport.sport = "Basketball" Then
       
            TreeL1 = ba.getEvents(sport.sportId)
            For Each Tree1 In TreeL1
           
                TreeL2 = ba.getEvents(Tree1.eventId)
                today = "Fixtures " & UKMonth(Now)
                tomorrow = "Fixtures " & UKMonth(Now + 1)
                For Each Tree2 In TreeL2
                If Left(Tree2.eventName, 15) = today Or Left(Tree2.eventName, 15) = tomorrow Then

                    TreeL3 = ba.getEvents(Tree2.eventId)
                    For Each Tree3 In TreeL3
                   
                        TreeL4 = ba.getEvents(Tree3.eventId)
                        For Each Tree4 In TreeL4
                       
'                            TreeL5 = ba.getEvents(Tree4.eventId)
'                            For Each Tree5 In TreeL5
                       
                            'some markets have full 5 tree structure, some only 4
                            Set tBAEvents = New clsEventCol
                            tBAEvents.sport = sport.sport
                            tBAEvents.Tree1 = Tree1.eventName
                            tBAEvents.Tree2 = Tree2.eventName
                            tBAEvents.Tree3 = Tree3.eventName
                            tBAEvents.Tree4 = Tree4.eventName
'                            If Tree5.eventId = 0 Then
                             
                                tBAEvents.eventName = Tree4.eventName
                                tBAEvents.eventId = Tree4.eventId
                                tBAEvents.startTime = Tree4.startTime
                                tBAEvents.isMarket = Tree4.isMarket
                                tBAEvents.exchangeId = Tree4.exchangeId
                                tBAEvents.key = sport.sport & "\" & Tree1.eventName & "\" & Tree2.eventName & "\" & Tree3.eventName & "\" & Tree4.eventName
'
'                            Else
'
'                                tBAEvents.eventName = Tree5.eventName
'                                tBAEvents.eventId = Tree5.eventId
'                                tBAEvents.startTime = Tree5.startTime
'                                tBAEvents.isMarket = Tree5.isMarket
'                                tBAEvents.exchangeId = Tree5.exchangeId
'                                tBAEvents.key = sport.sport & "\" & Tree1.eventName & "\" & Tree2.eventName & "\" & Tree3.eventName & "\" & Tree4.eventName & "\" & Tree5.eventName
'
'                            End If
                           
                            If InStr(1, tBAEvents.key, "", vbTextCompare) > 0 Then
                                    BAEvents.Add tBAEvents, tBAEvents.key
                                    eventcount = eventcount + 1
                                    Application.StatusBar = eventcount & " " & tBAEvents.key
                                    DoEvents
                            End If
                           
'                            Next Tree5
                   
                        Next Tree4
                   
                    Next Tree3
                    End If
               
                Next Tree2
'                End If
       
            Next Tree1
       
        End If
    Next sport
eventsLoaded = True
Application.StatusBar = False
End Sub


Just change "basketball" by "Ice Hockey", "Soccer", "Rugby Union", "Volleyball"... all sports with the same structure Tree.
User avatar
Tradyann
 
Posts: 139
Joined: Thu Dec 15, 2011 7:13 pm

Postby Tradyann » Sat Feb 11, 2012 1:19 pm

(Correction : for "soccer", it's in Tree3)

For Tennis, it's different some are in Tree4, some in Tree5 and Tree6 too (e.g. Davis Cup)

It's possible to fetch Tree4 .. 5 and 6 and save it in 3 QPL files... and copy/paste it to join all in a single QPL.

But I think it's possible to add a macro which allow to add markets fetched... and not overwrite existing selection ?
User avatar
Tradyann
 
Posts: 139
Joined: Thu Dec 15, 2011 7:13 pm

Postby Tradyann » Sun Feb 12, 2012 12:51 am

Code: Select all
Open MyFile For Output As fnum


changed by :

Code: Select all
Open MyFile For Append As fnum

for adding to existing selection
:wink:
User avatar
Tradyann
 
Posts: 139
Joined: Thu Dec 15, 2011 7:13 pm

Postby Tradyann » Tue Feb 14, 2012 9:43 pm

Just a comment :

I have an error 457 to fetch O/U markets for tomorrow (15 feb). It seems to load twice the same key... !?

I have add this line : "On Error Resume Next" and it's ok

Code: Select all
BAEvents.Add tBAEvents, tBAEvents.key
On Error Resume Next
User avatar
Tradyann
 
Posts: 139
Joined: Thu Dec 15, 2011 7:13 pm

Postby faibo » Sun Feb 19, 2012 5:19 pm

How can I get the league/championship of a under/over market without opening it?
User avatar
faibo
 
Posts: 23
Joined: Sun Sep 18, 2011 9:02 pm

Postby Tradyann » Sun Feb 19, 2012 7:40 pm

You mean : e.g. over/under markets of Barclays Premier League ?

In this case, it's necessary to fetch markets with the tree "Soccer" and not "Soccer - Fictures"

Sport : "Soccer"
Tree 1 : "English Soccer"
Tree 2 : "Barclays..."
Tree 3 : today or tomorrow
Tree4 : over/under
User avatar
Tradyann
 
Posts: 139
Joined: Thu Dec 15, 2011 7:13 pm

Postby faibo » Sun Feb 19, 2012 8:06 pm

I want to exclude some market from my QPL that is build with the soccer-fixtures U/O of the day. The markets I want to exclude are select by country and league. When a market is opened it shows the "full market path" with the information I want. So, I was hoping to archieve the same without opening the market.
User avatar
faibo
 
Posts: 23
Joined: Sun Sep 18, 2011 9:02 pm

Postby flogger » Sun Feb 19, 2012 10:03 pm

Same here. This is giving me a huge deal of headache today. I would really consider it a miracle if someone could show us a fix on this.
Two For The Money Image
flogger
 
Posts: 41
Joined: Wed Sep 28, 2011 9:28 pm

Postby Tradyann » Mon Feb 20, 2012 11:27 am

With "Soccer - Fixtures", the tBAEvents.key doesn't contained elements that you would exclude (country e.g.)

If you open a market with "Soccer" you will see for example :

Bologna v Fiorentina - 18:30 Over/Under 0.5 Goals.. Soccer\Italian Soccer\Serie A\Fixtures 21 February

but with "Soccer - Fixtures" :

Bologna v Fiorentina - 18:30 Over/Under 0.5 Goals.. Soccer - Fixtures\Fixtures 21 February

So it's not possible to exclude italian markets when the fetching is done with "Soccer - Fixtures".

But probably possible with "Soccer" tree
User avatar
Tradyann
 
Posts: 139
Joined: Thu Dec 15, 2011 7:13 pm

PreviousNext

Return to Help

Who is online

Users browsing this forum: Google [Bot] and 69 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.