Back/Lay odds for ladder

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • PROGRAMMING
    Junior Member
    • Aug 2017
    • 6

    #1

    Back/Lay odds for ladder

    Hello,

    How can I retrieve the back/lay odds of a particular event in order to create the ladder that trade software have?


    Many thanks
    Al
  • jabe
    Senior Member
    • Dec 2014
    • 705

    #2
    They're available via listMarketBook.

    Comment

    • PROGRAMMING
      Junior Member
      • Aug 2017
      • 6

      #3
      Originally posted by jabe View Post
      They're available via listMarketBook.
      Hello again,

      I tried listMarketBook and the following is the enquiry I send to the server:
      Code:
      {
      	"filter": {
      		"eventIds": ["28328368"]
      	},
      	"maxResults": 100,
      	"marketProjection": ["COMPETITION", "EVENT", "EVENT_TYPE", "RUNNER_DESCRIPTION", "RUNNER_METADATA", "MARKET_START_TIME"],
      	"sort": "MINIMUM_TRADED",
      	"marketIds": ["1.132972749"],
      	"priceProjection": {
      		"priceData": ["EX_BEST_OFFERS", "EX_TRADED"],
      		"virtualise": true
      	}
      }
      and I have the following answer:
      Code:
      {
      	"jsonrpc": "2.0",
      	"result": [{
      		"marketId": "1.132972749",
      		"isMarketDataDelayed": true,
      		"status": "OPEN",
      		"betDelay": 0,
      		"bspReconciled": false,
      		"complete": true,
      		"inplay": false,
      		"numberOfWinners": 1,
      		"numberOfRunners": 2,
      		"numberOfActiveRunners": 2,
      		"totalMatched": 0.0,
      		"totalAvailable": 2869.63,
      		"crossMatching": true,
      		"runnersVoidable": false,
      		"version": 1715405509,
      		"runners": [{
      			"selectionId": 2407528,
      			"handicap": 0.0,
      			"status": "ACTIVE",
      			"totalMatched": 0.0,
      			"ex": {
      				"availableToBack": [],
      				"availableToLay": [{
      					"price": 1.01,
      					"size": 2679.05
      				}, {
      					"price": 7.0,
      					"size": 17.07
      				}],
      				"tradedVolume": []
      			}
      		}, {
      			"selectionId": 2407529,
      			"handicap": 0.0,
      			"status": "ACTIVE",
      			"totalMatched": 0.0,
      			"ex": {
      				"availableToBack": [{
      					"price": 430.0,
      					"size": 14.38
      				}, {
      					"price": 100.0,
      					"size": 27.06
      				}, {
      					"price": 1.8,
      					"size": 21.58
      				}],
      				"availableToLay": [],
      				"tradedVolume": []
      			}
      		}]
      	}],
      	"id": "1"
      }
      There are just two pricing on the back and three on the lay but I was expecting more than that

      Where am I doing wrong?

      Many thanks
      Al

      Comment

      • LiamP
        Junior Member
        • Oct 2015
        • 284

        #4
        You requested 'EX_BEST_OFFERS' which defaults to top 3 prices, for more use ExBestOffersOverrides or to get all offers use 'EX_ALL_OFFERS'.


        http://docs.developer.betfair.com/do...riceProjection

        Comment

        • PROGRAMMING
          Junior Member
          • Aug 2017
          • 6

          #5
          Originally posted by LiamP View Post
          You requested 'EX_BEST_OFFERS' which defaults to top 3 prices, for more use ExBestOffersOverrides or to get all offers use 'EX_ALL_OFFERS'.


          http://docs.developer.betfair.com/do...riceProjection

          I ran again the request with EX_ALL_OFFERS
          Code:
          {
          	"filter": {
          		"eventIds": ["28328368"]
          	},
          	"maxResults": 100,
          	"marketProjection": ["COMPETITION", "EVENT", "EVENT_TYPE", "RUNNER_DESCRIPTION", "RUNNER_METADATA", "MARKET_START_TIME"],
          	"sort": "MINIMUM_TRADED",
          	"marketIds": ["1.132972749"],
          	"priceProjection": {
          		"priceData": ["EX_ALL_OFFERS", "EX_TRADED"],
          		"virtualise": true
          	}
          }
          and the following is the result:
          Code:
          {
          	"jsonrpc": "2.0",
          	"result": [{
          		"marketId": "1.132972749",
          		"isMarketDataDelayed": true,
          		"status": "OPEN",
          		"betDelay": 0,
          		"bspReconciled": false,
          		"complete": true,
          		"inplay": false,
          		"numberOfWinners": 1,
          		"numberOfRunners": 2,
          		"numberOfActiveRunners": 2,
          		"totalMatched": 0.0,
          		"totalAvailable": 2869.63,
          		"crossMatching": true,
          		"runnersVoidable": false,
          		"version": 1715405509,
          		"runners": [{
          			"selectionId": 2407528,
          			"handicap": 0.0,
          			"status": "ACTIVE",
          			"totalMatched": 0.0,
          			"ex": {
          				"availableToBack": [],
          				"availableToLay": [{
          					"price": 1.01,
          					"size": 2679.05
          				}, {
          					"price": 7.0,
          					"size": 17.07
          				}],
          				"tradedVolume": []
          			}
          		}, {
          			"selectionId": 2407529,
          			"handicap": 0.0,
          			"status": "ACTIVE",
          			"totalMatched": 0.0,
          			"ex": {
          				"availableToBack": [{
          					"price": 430.0,
          					"size": 14.38
          				}, {
          					"price": 100.0,
          					"size": 27.06
          				}, {
          					"price": 1.8,
          					"size": 21.58
          				}],
          				"availableToLay": [],
          				"tradedVolume": []
          			}
          		}]
          	}],
          	"id": "1"
          }
          there are still only five prices available in total with a bet and none of them is matched. Is that correct ?

          Comment

          • LiamP
            Junior Member
            • Oct 2015
            • 284

            #6
            Looking at the website, no, unless things have changed since you made that request. Do you get the same response if you remove 'virtualise'?

            Comment

            Working...
            X