Why are prices and sizes rolling up?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gambletron
    Junior Member
    • May 2010
    • 12

    #1

    Why are prices and sizes rolling up?

    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​
    Attached Files
  • WTPooh
    Member
    • May 2012
    • 88

    #2
    {"method":"SportsAPING/v1.0/listMarketBook","params":{"marketIds":["1.xxxxxxxxx"],"priceProjection":{"priceData":["EX_ALL_OFFERS"]}}

    Comment

    • Sansa
      Member
      • Jan 2019
      • 35

      #3
      I don't believe the Delay Key will return you what you want. For example it only returns 3 prices levels. See:

      https://betfair-developer-docs.atlas...nd%20snapshots.

      Comment

      • Sansa
        Member
        • Jan 2019
        • 35

        #4
        You are specifying EX_ALL_OFFERS & EX_TRADED which I don't think will return you that data using the Delay key, and I think exBestOffersOverrides only applies to EX_BEST_OFFERS:
        exBestOffersOverrides OffersOverrides Options to alter the default representation of best offer prices Applicable to EX_BEST_OFFERS priceData selection

        Comment

        • gambletron
          Junior Member
          • May 2010
          • 12

          #5
          Thanks for the replies. I worked on the suggestions. Hope I interpreted them correctly.

          Sansa - correct - I saw it in the link that the Delayed App Key does not return EX_ALL_OFFERS so that won't work.

          I've tried it using EX_BEST_OFFERS with the overrides as suggested, see below, but it still add up the prices/sizes

          I still can't get it to bring back the best 3 prices/sizes without it rolling them up. I know that my free "delayed application key" only gives me the best 3 so I don't expect them all but I do expect to be able to get the best 3 without them being rolled up so as they appear as on the web site. Also tried using combinations of "STAKE" and "NONE" for the rollup models to no avail.

          There must be some other "£10" limit being set or my it just doesn't work for the free key?​

          ' ✅ Only use EX_BEST_OFFERS
          marketPrice.Add("EX_BEST_OFFERS")
          params.priceProjection.priceData = marketPrice

          ' ✅ Declare and adjust rollup settings (only applies to EX_BEST_OFFERS)
          Dim bestOffersOverrides As New exBestOffersOverrides
          bestOffersOverrides.bestPricesDepth = 3
          bestOffersOverrides.rollupModel = "STAKE" ' ✅ Use STAKE
          bestOffersOverrides.rollupLimit = 1 ' ✅ Request small stakes so any above £1

          ' ✅ Assign to params.priceProjection (only works with EX_BEST_OFFERS)
          params.priceProjection.exBestOffersOverrides = bestOffersOverrides

          Any other guidance really appreciated!

          Comment

          • Sansa
            Member
            • Jan 2019
            • 35

            #6
            I have just tested it switching between the Delay & Live keys and it is the Delay key that it does not work for.

            Comment

            • gambletron
              Junior Member
              • May 2010
              • 12

              #7
              Thanks Sansa. I guess that clears it up then. No idea why Betfair can't be clearer in their documentation or give a sensible error message rather than just ignoring the request

              Comment

              Working...
              X