Com Server Question

Please post any questions regarding the program here.

Moderator: 2020vision

Com Server Question

Postby dermag » Sat Jan 16, 2016 3:03 pm

Is it possible to use excel & the com server to get a list of todays' soccer games, specifically the "both teams to score" odds.

So I'd have in (say) column A the teams/game and then somewhere (say) columns C & D I'd have the odds.

Could I have it so that it listed one game per row, or maybe every two rows.

I don't want to constantly refresh or monitor, I just want to refresh once in the morning for the days games and see if there's any value.

I'm ok with VBA & BA but need to know if it's doable and somewhere to start as I've never used the com server before.

Thanks,

Ron
dermag
 
Posts: 60
Joined: Sun Feb 18, 2007 3:35 pm

Re: Com Server Question

Postby alrodopial » Sun Jan 17, 2016 6:43 pm

I don't think it can be done for "both teams to score"
alrodopial
 
Posts: 1384
Joined: Wed Dec 06, 2006 9:59 pm

Re: Com Server Question

Postby alrodopial » Sun Jan 17, 2016 6:52 pm

Or maybe using the com objects "bfEvent" and "bfSport" , looping inside their items and using a string comparison?
I never used it but others may have and will comment
alrodopial
 
Posts: 1384
Joined: Wed Dec 06, 2006 9:59 pm

Re: Com Server Question

Postby MarkRussell » Mon Jan 18, 2016 12:58 pm

Hi,

It should be possible using the COM feature.
I will see if I can post an example.
Give me a few days to work on it.

Regards,
Mark
User avatar
MarkRussell
Site Admin
 
Posts: 1793
Joined: Tue Feb 20, 2007 6:38 pm
Location: Birmingham

Re: Com Server Question

Postby dermag » Mon Jan 18, 2016 5:25 pm

Thanks Mark,

Any bit of code to get me started will do and I can probably wing it from there.

If successful I'll post it back for the members to use/abuse.

Ron
dermag
 
Posts: 60
Joined: Sun Feb 18, 2007 3:35 pm

Re: Com Server Question

Postby MarkRussell » Tue Jan 19, 2016 5:17 pm

Hi,

Ok here is a link to an Excel file that uses the COM feature to search for specific soccer markets.

http://www.gruss-software.co.uk/Excel/COM/SoccerMarketsCOMexample.xlsm

Make sure you have enabled COM in Betting Assistant before trying to use this file.

Click on the button in the Worksheet and it will first clear old data, it will then search through today's soccer fixtures looking for "Both teams to Score" markets.
It will loop through opening each market in turn to pull out current odds.
If the market is closed then it will not be listed in the Worksheet.

This is provided as an example of using COM, for you to download and adapt to your own requirements.

Regards,
Mark
User avatar
MarkRussell
Site Admin
 
Posts: 1793
Joined: Tue Feb 20, 2007 6:38 pm
Location: Birmingham

Re: Com Server Question

Postby dermag » Tue Jan 19, 2016 6:47 pm

Hi Mark,

Thanks for that, it really couldn't have been any better.

It produced an error at this line ...

If Trim(prices(0).marketid) = Trim(tree3.eventid) Then Exit Do 'ERROR HERE

However, I suspected it was because some games had closed today so I inserted ...

On Error Resume Next

at the top of the code module and it did indeed simply omit any games that had closed and carried on with the remaining open games today.

I tweaked it to accept the dDate as an input so I could poll tomorrows games etc.

All in all a superb bit of code Mark, thank you hugely.

Ron
dermag
 
Posts: 60
Joined: Sun Feb 18, 2007 3:35 pm

Re: Com Server Question

Postby dermag » Mon Apr 25, 2016 3:40 pm

Hi Mark,

I've been using this excel/com/ba sheet for a while now and quite fancy having a bash at using it to place a bet (if figures dictate).

As it runs pretty rapidly through hundreds of games, I wonder if you tell me what code to use to place a bet?

Here's where the com server code copies the market data to excel, and it's at this point I want to analyse the over/under bet figures and interject a bet.
Code: Select all
 sports = ba.getSports()
    i = 4
    For Each sport In sports

        If sport.sport = "Soccer - Fixtures" Then
            TreeL1 = ba.getevents(sport.SportId) 'TreeL1 is BettingAssistantCom.Application.BfEvent
            For Each tree1 In TreeL1 'check each object in the TreeL1, which is days dates, look for requested day
               
                If Trim(tree1.eventname) = todaystr Then
                    TreeL2 = ba.getevents(tree1.eventid)
                    For Each tree2 In TreeL2
                        match = tree2.eventname
                        TreeL3 = ba.getevents(tree2.eventid)
                       
                        For Each tree3 In TreeL3
                            market = tree3.eventname
                            starttime = Mid(tree3.starttime, 11, 6)
                            Debug.Print tree3.starttime
                            If market = "Over/Under 0.5 Goals" Then '"Both teams to Score?" Then
                                opn = ba.openmarket(tree3.eventid, tree3.exchangeId)
                               
                                DoEvents
                                Do
                                    prices = ba.getprices
                                   
                                    If Trim(prices(0).marketid) = Trim(tree3.eventid) Then Exit Do    'ERROR HERE, but sorted with error handler
                                Loop
                                If prices(0).closed = False Then
                                    Cells(i, 1).Value = starttime
                                    Cells(i, 2).Value = match
                                    Cells(i, 3).Value = prices(0).backodds1 ' 0 is under, 1 is over
                                    Cells(i, 4).Value = prices(1).backodds1 ' 0 is under, 1 is over
                                    Cells(i, 5).Value = prices(0).totalmatched + prices(1).totalmatched
                                   
''WANT TO PLACE BET (NOT LAY) HERE IF ODDS ARE TO MY LIKING

                                    i = i + 1
                                End If
                               
                            End If
                        Next
                       
                    Next
                End If
            Next
        End If
    Next


Any help would again be appreciated.

Ron
dermag
 
Posts: 60
Joined: Sun Feb 18, 2007 3:35 pm


Return to Help

Who is online

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