COM Question - getTradedVolume & maximum price matched

Please post any questions regarding the program here.

Moderator: 2020vision

COM Question - getTradedVolume & maximum price matched

Postby nanook » Thu Jul 03, 2014 6:27 pm

Is it possible to get the maximum price matched using getTradedVolume?

The GetTradedVolumeExample spreadsheet shows how to get the minimum price matched. Here's the code:


Option Explicit

Dim ba As New BettingAssistantCom.ComClass
Dim currentMarket As String

Private Sub Worksheet_Change(ByVal Target As Range)
Dim r As Integer
Dim tradedVolume() As Variant
If Target.Columns.Count = 16 Then
Application.EnableEvents = False
If currentMarket <> Cells(1, 1).Value Then
Cells(1, 25).Value = "Y"
For r = 5 To 50
Cells(r, 25).Value = 0
Next
End If
If Cells(1, 25).Value = "Y" And Cells(1, 27).Value <= 30 Then
For r = 5 To 50
tradedVolume = ba.getTradedVolume(Cells(r, 1).Value)
Cells(r, 25).Value = tradedVolume(0).odds
Next
Cells(1, 25).Value = "N"
End If
currentMarket = Cells(1, 1).Value
Application.EnableEvents = True
End If
End Sub



tradedVolume(0).odds gives the minimum price matched.
What is the equivalent expression for the maximum price matched? Excuse my ignorance if it's obvious. I have been fiddling around with it but can't get it.
nanook
 
Posts: 45
Joined: Sat Jan 14, 2006 5:48 am

Postby Captain Sensible » Thu Jul 03, 2014 10:42 pm

I haven't got round to using the COM yet but I'm guessing tradedVolume is an array and if (0) is the lowest then I'd guess the upper bound is the highest can you not just UBound to get the upper limit and return that or even just reverse it with Array.Reverse() and after you've got the lowest and again use tradedVolume(0).odds on the reversed array to get the max
User avatar
Captain Sensible
 
Posts: 2923
Joined: Sat Nov 19, 2005 2:29 pm

Postby nanook » Thu Jul 03, 2014 11:56 pm

Sorry Captain - I should have pointed out that my fiddling around involved trying values other than "0" for tradedVolume() but whatever value I try I get a "subscript out of range" error.
nanook
 
Posts: 45
Joined: Sat Jan 14, 2006 5:48 am


Return to Help

Who is online

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