problems with java demo

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mark Smeets
    Junior Member
    • Aug 2013
    • 4

    #1

    problems with java demo

    Hi,

    I can succesfully run the java ApiNGDemo, however if I modify it to show prices, more market information etc, the results are null.

    If I add stuff to MarketProjections, it doesn't seem to make a difference, eg:

    Code:
    marketFilter = new MarketFilter();
                marketFilter.setEventTypeIds(eventTypeIds);
                marketFilter.setMarketStartTime(time);
                marketFilter.setMarketCountries(countries);
                marketFilter.setMarketTypeCodes(typesCode);
    
                Set<MarketProjection> marketProjection = new HashSet<MarketProjection>();
                marketProjection.add(MarketProjection.RUNNER_DESCRIPTION);
                marketProjection.add(MarketProjection.COMPETITION);
                marketProjection.add(MarketProjection.EVENT);
                marketProjection.add(MarketProjection.EVENT_TYPE);
                marketProjection.add(MarketProjection.MARKET_DESCRIPTION);
    
                String maxResults = "1";
    
                List<MarketCatalogue> marketCatalogueResult = rescriptOperations.listMarketCatalogue(marketFilter, marketProjection, MarketSort.FIRST_TO_START, maxResults,
                        applicationKey, sessionToken);
    
                System.out.println("5. Print static marketId, name and runners....\n");
                printMarketCatalogue(marketCatalogueResult.get(0));
    
    ....
    private void printMarketCatalogue(MarketCatalogue mk){
            System.out.println("Market Name: "+mk.getMarketName() + "; Id: "+mk.getMarketId()+ " " + mk.getEvent() + " " + mk.getCompetition() + " " + mk.getEventType() + "\n");
            List<RunnerCatalog> runners = mk.getRunners();
            if(runners!=null){
                for(RunnerCatalog rCat : runners){
                    System.out.println("Runner Name: "+rCat.getRunnerName()+"; Selection Id: "+rCat.getSelectionId()+"\n");
                }
            }
        }
    this gives me:
    Code:
    5. Print static marketId, name and runners....
    
    Market Name: 6f Mdn Stks; Id: 1.110371412 null null null
    Also, when listing the Runner information I get this:

    Code:
    {selectionId=7291482,handicap=0.0,status=ACTIVE,adjustmentFactor=42.0,lastPriceTraded=1.9,totalMatched=3754.66,removalDate=null,sp=null,ex=null,orders=null,matches=null,}
                   {selectionId=7445717,handicap=0.0,status=ACTIVE,adjustmentFactor=24.7,lastPriceTraded=5.4,totalMatched=484.38,removalDate=null,sp=null,ex=null,orders=null,matches=null,}
                   {selectionId=7552880,handicap=0.0,status=ACTIVE,adjustmentFactor=12.0,lastPriceTraded=12.0,totalMatched=118.15,removalDate=null,sp=null,ex=null,orders=null,matches=null,}
                   {selectionId=7437576,handicap=0.0,status=ACTIVE,adjustmentFactor=10.6,lastPriceTraded=6.6,totalMatched=673.66,removalDate=null,sp=null,ex=null,orders=null,matches=null,}
                   {selectionId=7552879,handicap=0.0,status=ACTIVE,adjustmentFactor=7.1,lastPriceTraded=23.0,totalMatched=46.52,removalDate=null,sp=null,ex=null,orders=null,matches=null,}
                   {selectionId=7396134,handicap=0.0,status=ACTIVE,adjustmentFactor=3.6,lastPriceTraded=23.0,totalMatched=28.35,removalDate=null,sp=null,ex=null,orders=null,matches=null,}
    Why is ex null?

    I've also tried this in the visualizer; same result: I don't get market prices.

    Hope somebody can help me with this.

    Mark.
    Last edited by Mark Smeets; 06-08-2013, 10:42 AM.
  • Mark Smeets
    Junior Member
    • Aug 2013
    • 4

    #2
    Fixed, the code at github is not complete; it lacks adding the parameter priceprojection.

    Comment

    • idasbiste
      Junior Member
      • Aug 2013
      • 1

      #3
      Mark,

      How did you do it?

      Thank you,

      Eduardo

      Comment

      Working...
      X