getEx() every time null

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • General Api
    Junior Member
    • May 2014
    • 9

    #1

    getEx() every time null

    Every time I try to get exchange price, from a Java code, as well as from virtualizer, the response is null.
    For example see this simple screenshot of virtualizer.
    Attached Files
  • betdynamics
    Junior Member
    • Sep 2010
    • 534

    #2
    Click on the little information icon (on the right hand side).

    Then, when the dialog box pops up, select one of the selections and the prices should be displayed.
    Last edited by betdynamics; 29-05-2014, 02:01 PM.

    Comment

    • General Api
      Junior Member
      • May 2014
      • 9

      #3
      It shows this... (see attached). notice, empty prices.
      Attached Files

      Comment

      • General Api
        Junior Member
        • May 2014
        • 9

        #4
        Thank you. I didn't click on each selection.

        Comment

        • General Api
          Junior Member
          • May 2014
          • 9

          #5
          However I can't figure out the problem in Java code. I get a list of MarketBooks

          List<MarketBook> marketBookReturn = jsonOperations.listMarketBook(marketIds, priceProjection,orderProjection, matchProjection, currencyCode,applicationKey, sessionToken);

          Then get a specific market book from list

          MarketBook mb = marketBookReturn.get(0);

          which in turn gives me runners of that marketbook

          List<Runner> runners = mb.getRunners();

          But the problem comes then.

          for (Runner runner : runners) {
          System.out.println(runner.getSelectionId()) ; //gives correct answer
          System.out.println("Last price traded: " + runner.getLastPriceTraded()) ; // this is also ok
          System.out.println("Exchange price: " + runner.getEx()) ; //but this one returns null
          }

          Comment

          • betdynamics
            Junior Member
            • Sep 2010
            • 534

            #6
            What have you got set for priceProjection, matchProjection and currencyCode in your listMarketBook call?

            What is the code for the listMarketBook function?

            What is the code for the getEx function?

            Comment

            • gus
              Senior Member
              • Jan 2009
              • 134

              #7
              here's my ( REST ) query to listMarketBook, which gets, amongst other things, the best Back Price and Best Lay Price:

              Code:
              https://api.betfair.com/exchange/betting/rest/v1.0/listMarketBook/ {"priceProjection":{"exBestOffersOverrides":{"bestPri
              cesDepth":1},"priceData":["EX_BEST_OFFERS"],"virtualise":false},"matchProjection":"ROLLED_UP_BY_AVG_PRICE","orderProject
              ion":"ALL","marketIds":["1.114267385"]}

              Comment

              • General Api
                Junior Member
                • May 2014
                • 9

                #8
                I used codes from
                https://github.com/betfair/API-NG-sa...ee/master/java.

                which is referenced from
                https://api.developer.betfair.com/se...mq5qye0ni/Java

                -------- Projections --------------------------
                OrderProjection orderProjection = null;
                MatchProjection matchProjection = null;
                String currencyCode = null;

                PriceProjection priceProjection = new PriceProjection();
                Set<PriceData> priceData = new HashSet<PriceData>();
                priceData.add(PriceData.EX_BEST_OFFERS);
                priceProjection.setPriceData(priceData);
                priceProjection.setVirtualise(true);

                ExBestOfferOverRides exbest = new ExBestOfferOverRides() ;
                exbest.setBestPricesDepth(1) ;
                exbest.setRollupModel(RollupModel.STAKE);
                priceProjection.setExBestOfferOverRides(exbest);

                ------------ listMarketBook ---------------------
                public List<MarketBook> listMarketBook(List<String> marketIds, PriceProjection priceProjection, OrderProjection orderProjection, MatchProjection matchProjection, String currencyCode, String appKey, String ssoId) throws APINGException {
                Map<String, Object> params = new HashMap<String, Object>();
                params.put(LOCALE, locale);
                params.put(MARKET_IDS, marketIds);
                String result = getInstance().makeRequest(ApiNgOperation.LISTMARKE TBOOK.getOperationName(), params, appKey, ssoId);
                if(ApiNGDemo.isDebug())
                System.out.println("\nResponse: "+result);
                ListMarketBooksContainer container = JsonConverter.convertFromJson(result,ListMarketBoo ksContainer.class);
                if(container.getError() != null)
                throw container.getError().getData().getAPINGException() ;

                return container.getResult();
                -------------------------------------------------------------
                getEx(), is a method of Runner.java which returns object of type ExchangePrices.

                Comment

                Working...
                X