Hi all,
I've seen this problem posted a number of times but with no answer. I simply want my code to return the same view as the website for the home team, for a specific market of available to back prices and sizes but my request is rolling up the data until a £10 size limit is reached even though I have set rollupLimit to 1 (I just want to see them all individually.) I've been battling against this for days. Please help if you can!
I am using the "delayed application key" if that's significant. I have also tried rollupModel = "NONE" and "PAYOUT".
Here's an example:
image.png
The above is from the website but my code at the end of the function for "backPrice.price & "," & backPrice.size" returns
2.82, 14.33, 1.05, 1657.07, 1.04, 2476.27
but I want it to return ....
3.15, 2, 2.82, 12.33, 1.64, 1.29
Also the value for home_odds (allbooks(0).result(0).runners(0).ex.availableToBa ck(0).price) is 2.82 but I (naturally) want it to be 3.15.
Public Function get_odds(ByVal usemarketID As String) As String
Dim jsonRequest As String
Dim requestlist2 As New List(Of MarketBookRequest)
Dim request2 As New MarketBookRequest
Dim params As New MarketBookParams
Dim m As Single
Dim home_odds, away_odds, draw_odds, home_lay_odds As Double
Dim marketIds As New List(Of String)
Dim marketPrice As New List(Of String)
Dim returnstring As String = ""
marketIds.Add(usemarketID)
params.marketIds = marketIds
marketPrice.Add("EX_ALL_OFFERS")
marketPrice.Add("EX_TRADED") '
params.priceProjection.priceData = marketPrice
Dim bestOffersOverrides As New exBestOffersOverrides
bestOffersOverrides.bestPricesDepth = 3
bestOffersOverrides.rollupModel = "STAKE"
bestOffersOverrides.rollupLimit = 1
params.priceProjection.exBestOffersOverrides = bestOffersOverrides
request2.params = params
requestlist2.Add(request2)
jsonRequest = SerializeMarketBookRequest(requestlist2)
Dim allbooks() As MarketBookResponse
allbooks = DeserializeMarketBookResponse(jsonRequest)
m = allbooks(0).result(0).numberOfRunners
home_odds = 0 : draw_odds = 0 : away_odds = 0 : home_lay_odds = 0
Try
home_odds = allbooks(0).result(0).runners(0).ex.availableToBac k(0).price
away_odds = allbooks(0).result(0).runners(1).ex.availableToBac k(0).price
draw_odds = allbooks(0).result(0).runners(2).ex.availableToBac k(0).price
returnstring = home_odds & "," & draw_odds & "," & away_odds & ","
Catch ex As ArgumentOutOfRangeException
returnstring = "0,0,0,"
End Try
Dim homeRunner As sportsAPI.MarketBookRunnerClass = allbooks(0).result(0).runners(0)
If Not homeRunner.ex Is Nothing AndAlso Not homeRunner.ex.availableToBack Is Nothing Then
For Each backPrice In homeRunner.ex.availableToBack
returnstring = returnstring & "," & backPrice.price & "," & backPrice.size
Next
End If
Return returnstring
End Function
I've seen this problem posted a number of times but with no answer. I simply want my code to return the same view as the website for the home team, for a specific market of available to back prices and sizes but my request is rolling up the data until a £10 size limit is reached even though I have set rollupLimit to 1 (I just want to see them all individually.) I've been battling against this for days. Please help if you can!
I am using the "delayed application key" if that's significant. I have also tried rollupModel = "NONE" and "PAYOUT".
Here's an example:
image.png
The above is from the website but my code at the end of the function for "backPrice.price & "," & backPrice.size" returns
2.82, 14.33, 1.05, 1657.07, 1.04, 2476.27
but I want it to return ....
3.15, 2, 2.82, 12.33, 1.64, 1.29
Also the value for home_odds (allbooks(0).result(0).runners(0).ex.availableToBa ck(0).price) is 2.82 but I (naturally) want it to be 3.15.
Public Function get_odds(ByVal usemarketID As String) As String
Dim jsonRequest As String
Dim requestlist2 As New List(Of MarketBookRequest)
Dim request2 As New MarketBookRequest
Dim params As New MarketBookParams
Dim m As Single
Dim home_odds, away_odds, draw_odds, home_lay_odds As Double
Dim marketIds As New List(Of String)
Dim marketPrice As New List(Of String)
Dim returnstring As String = ""
marketIds.Add(usemarketID)
params.marketIds = marketIds
marketPrice.Add("EX_ALL_OFFERS")
marketPrice.Add("EX_TRADED") '
params.priceProjection.priceData = marketPrice
Dim bestOffersOverrides As New exBestOffersOverrides
bestOffersOverrides.bestPricesDepth = 3
bestOffersOverrides.rollupModel = "STAKE"
bestOffersOverrides.rollupLimit = 1
params.priceProjection.exBestOffersOverrides = bestOffersOverrides
request2.params = params
requestlist2.Add(request2)
jsonRequest = SerializeMarketBookRequest(requestlist2)
Dim allbooks() As MarketBookResponse
allbooks = DeserializeMarketBookResponse(jsonRequest)
m = allbooks(0).result(0).numberOfRunners
home_odds = 0 : draw_odds = 0 : away_odds = 0 : home_lay_odds = 0
Try
home_odds = allbooks(0).result(0).runners(0).ex.availableToBac k(0).price
away_odds = allbooks(0).result(0).runners(1).ex.availableToBac k(0).price
draw_odds = allbooks(0).result(0).runners(2).ex.availableToBac k(0).price
returnstring = home_odds & "," & draw_odds & "," & away_odds & ","
Catch ex As ArgumentOutOfRangeException
returnstring = "0,0,0,"
End Try
Dim homeRunner As sportsAPI.MarketBookRunnerClass = allbooks(0).result(0).runners(0)
If Not homeRunner.ex Is Nothing AndAlso Not homeRunner.ex.availableToBack Is Nothing Then
For Each backPrice In homeRunner.ex.availableToBack
returnstring = returnstring & "," & backPrice.price & "," & backPrice.size
Next
End If
Return returnstring
End Function


Comment