ListMarketBook - "Available to back"?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • v-cut
    Junior Member
    • Aug 2014
    • 3

    #1

    ListMarketBook - "Available to back"?

    Hi,

    Can someone please tell me how to get the data for "Available to back" (price/size) with the ListMarketBook?

    I only manage to get the "LastPriceTraded" which isnt enough, and it seems to me that I've tested all combinations of price/order/match projections but nothing solves my problem.

    All tips highly appriciated!
  • Merlin
    Junior Member
    • Jan 2009
    • 56

    #2
    re: ListMarketBook - "Available to back"?

    Hi v-cut,

    you need to set priceProjection to have a priceData value which includes 'EX_BEST_OFFERS' or 'EX_ALL_OFFERS' (or both), You don't say which language you are using, so I can't be specific on HOW you do that, but you need to end up sending JSON which looks like this:

    Code:
    '{"priceProjection":{"priceData":["EX_BEST_OFFERS"]},"marketIds":["1.115592757"]}'
    An array of PriceSize data will then be returned with each runner under the 'ex' key (for ExchangePrices), and then the 'availableToBack' key. I can't easily get a dump of the JSON response ('cause it's gzipped), but in perl a returned 'runner' record looks like this:

    Code:
    {
     'adjustmentFactor' => '0.3',
     'totalMatched' => '0.69',
     'status' => 'ACTIVE',
     'ex' => {
              'availableToBack' => [
                                    {
                                     'size' => '2.79',
                                     'price' => '170'
                                    },
                                    {
                                     'price' => '100',
                                     'size' => '10.81'
                                    },
                                    {
                                     'price' => '48',
                                     'size' => '2.46'
                                    }
                                   ],
              'availableToLay' => [
                                   {
                                    'price' => '880',
                                    'size' => '2.18'
                                   },
                                   {
                                    'size' => '2',
                                    'price' => '990'
                                   }
                                  ],
              'tradedVolume' => []
             },
     'selectionId' => 8345277,
     'lastPriceTraded' => '200',
     'handicap' => '0'
    }
    HTH

    Merlin

    Comment

    • v-cut
      Junior Member
      • Aug 2014
      • 3

      #3
      Hi Merlin,

      Thanks for your help, thought I tried everything but probably missed something in the Json, now it returns the data I need.

      Comment

      Working...
      X