COM interface - starting prices

Please post any questions regarding the program here.

Moderator: 2020vision

COM interface - starting prices

Postby Marshy » Sat Jan 03, 2015 2:07 pm

I have recently moved to using the COM interface and all is going well apart from getting the starting prices. I am using getMarketDepth which returns the MarketDepthSelection and this seems to be working. Before the start I can get the farSPPrice and nearSPPrice which work fine, and actualSPPrice returns zero as I would expect before the race stars. However once the race starts the actualSPPrice continues to be zero but I believe it should contain the actual starting price.

Anybody else trying to do this and got any ideas why it is n't working?

Thanks
Marshy
Marshy
 
Posts: 10
Joined: Sat Oct 11, 2008 2:43 pm

Re: COM interface - starting prices

Postby Captain Sensible » Sun Jan 04, 2015 3:35 pm

Guess that's one for Gary to answer, the new API works slightly differently than API6 as you can now request all or as little data as you need. I think values now have their own fields rather than doubling up on SP reconciliation like the old API used to switch the projected price to Actual BSP once reconciled and inplay
User avatar
Captain Sensible
 
Posts: 2883
Joined: Sat Nov 19, 2005 2:29 pm

Re: COM interface - starting prices

Postby rourkem » Thu Jan 08, 2015 6:16 pm

Thanks. I'm still checking out API6 at this point, so far, I can't find any issues with it. But for sure, I'll let you know once I stumble into something.
Windows 8 | Framework 2.0 Image
User avatar
rourkem
 
Posts: 166
Joined: Tue Oct 28, 2014 3:20 pm

Re: COM interface - starting prices

Postby GaryRussell » Thu Jan 15, 2015 3:07 pm

This issue is fixed in the next release due shortly.
User avatar
GaryRussell
Site Admin
 
Posts: 9695
Joined: Fri Nov 18, 2005 8:09 pm
Location: Birmingham, UK

Re: COM interface - starting prices

Postby Temujin » Thu Jan 23, 2020 4:13 pm

Hi,
I am looking for help to get totalBSPBackAmountAvailable and totalBSPLayAmountAvailable into my working sheet. Ultimately I want to try and predict the SP price, so perhaps the nearSP and farSP also for comparison.

All this is completely beyond me. Very limited VBA, but can generally work my way logically through the code and adapt to my needs.

I have been through the GetMarketDepthExample and the Async example spreadsheets and tried to adapt them but to no avail. I simply seem to be able to get them to stop working at all.

From the best of my ability, it seems that all this data is bought in with the getMarketDepth call from either of these sheets. From there, I would assume it would be an easy call to simply add another line of code in to display these figures.

Ultimately, the Async example would be best as I like the idea of the 10 best back/lay prices also, but for a start, can anybody advise on how exactly I get the back stake and the lay liability for SP into an Excel spreadsheet?
Temujin
 
Posts: 4
Joined: Sat Aug 25, 2018 8:32 am

Re: COM interface - starting prices

Postby Temujin » Thu Jan 23, 2020 5:09 pm

Think I cracked it. As soon as I can work out why I can no longer link to my sheet, I will be able to test it. :( :(


Option Explicit

Dim ba As New BettingAssistantCom.ComClass

Private Sub Worksheet_Change(ByVal Target As Range)
Dim marketDepth As Variant, prices As Variant
If Target.Columns.Count = 16 Then
Application.EnableEvents = False
If ba Is Nothing Then
Set ba = New BettingAssistantCom.ComClass
End If
marketDepth = ba.getMarketDepth
If Not IsEmpty(marketDepth) Then
Dim i As Integer, r As Integer, selecName As String, j As Integer
Dim bestBackPrice As Double, bestLayPrice As Double, backAmount As Double, layAmount As Double
r = 5
Do
selecName = Cells(r, 1).Value
If selecName <> "" Then
For i = 0 To UBound(marketDepth)
If marketDepth(i).Selection = selecName Then
bestBackPrice = 1000
bestLayPrice = 1.01
backAmount = 0
layAmount = 0
prices = marketDepth(i).prices
For j = 0 To UBound(prices)

If prices(j).odds = bestBackPrice Then

backAmount = prices(j).totalBSPBackAmountAvailable
End If


If prices(j).odds = bestLayPrice Then

layAmount = prices(j).totalBSPLayAmountAvailable
End If
End If
Next
Cells(r, 43).Value = backAmount
Cells(r, 44).Value = layAmount

Exit For
End If
Next
End If
r = r + 1
Loop Until selecName = ""
End If
Application.EnableEvents = True
End If
End Sub
Temujin
 
Posts: 4
Joined: Sat Aug 25, 2018 8:32 am

Re: COM interface - starting prices

Postby Temujin » Thu Jan 23, 2020 5:42 pm

Ok.
So it seems that there is an issue with this code on my main sheet.

This was copied directly from where I tested it on the GetMarketDepthExample sheet, where it connected fine and read in the data.

I copied this directly into my main sheet and it is throwing up user-defined type not defined. I referenced the newest Active X.

Works fine on one sheet, but not my main sheet.

Possibly the reason I can't connect it to Gruss. Can recognise the file, but no worksheet able to be selected.

Any takers?
Temujin
 
Posts: 4
Joined: Sat Aug 25, 2018 8:32 am


Return to Help

Who is online

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

cron