Examples of ANXTicker


Examples of com.xeiam.xchange.anx.v2.dto.marketdata.ANXTicker

    if (pathCurrencyPair == null) {
      return null;
    }
    try {
      if (i == 2) {
        ANXTicker anxTicker = getANXTicker(pathCurrencyPair);
        Map<String, ANXTicker> ticker = new HashMap<String, ANXTicker>();
        ticker.put(pathCurrencyPair.baseSymbol + pathCurrencyPair.counterSymbol, anxTicker);
        return ticker;
      }
      ANXTickersWrapper anxTickerWrapper = anxV2.getTickers(pathCurrencyPair.baseSymbol, pathCurrencyPair.counterSymbol, extraCurrencyPairs.toString());
View Full Code Here

Examples of com.xeiam.xchange.anx.v2.dto.marketdata.ANXTicker

    InputStream is = ANXAdapterTest.class.getResourceAsStream("/v2/marketdata/example-ticker-data.json");

    // Use Jackson to parse it
    ObjectMapper mapper = new ObjectMapper();
    mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
    ANXTicker anxTicker = mapper.readValue(is, ANXTicker.class);

    Ticker ticker = ANXAdapters.adaptTicker(anxTicker);

    Assert.assertEquals(new BigDecimal("725.38123"), ticker.getLast());
    Assert.assertEquals(new BigDecimal("725.38123"), ticker.getHigh());
View Full Code Here

Examples of com.xeiam.xchange.anx.v2.dto.marketdata.ANXTicker

    // Use Jackson to parse it
    ObjectMapper mapper = new ObjectMapper();
    mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);

    ANXTicker anxTicker = mapper.readValue(is, ANXTicker.class);
    //
    System.out.println(anxTicker.toString());

    // Verify that the example data was unmarshalled correctly
    Assert.assertEquals(new BigDecimal("725.38123"), anxTicker.getHigh().getValue());
    Assert.assertEquals(new BigDecimal("380.00000"), anxTicker.getLow().getValue());
    Assert.assertEquals(new BigDecimal("429.34018"), anxTicker.getAvg().getValue());
    Assert.assertEquals(new BigDecimal("429.34018"), anxTicker.getVwap().getValue());
    Assert.assertEquals(new BigDecimal("7.00000000"), anxTicker.getVol().getValue());
    Assert.assertEquals(new BigDecimal("725.38123"), anxTicker.getLast().getValue());
    Assert.assertEquals(new BigDecimal("38.85148"), anxTicker.getBuy().getValue());
    Assert.assertEquals(new BigDecimal("897.25596"), anxTicker.getSell().getValue());
    Assert.assertEquals(1393388594814000L, anxTicker.getNow());

  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.