Examples of CryptonitTicker


Examples of com.xeiam.xchange.cryptonit.v2.dto.marketdata.CryptonitTicker

    System.out.println(trades);
  }

  private static void raw(CryptonitMarketDataServiceRaw marketDataService) throws IOException {

    CryptonitTicker ticker = marketDataService.getCryptonitTicker(CurrencyPair.BTC_USD);
    System.out.println(ticker);

    CryptonitOrders marketDepth = marketDataService.getCryptonitAsks(CurrencyPair.BTC_USD, 10);
    System.out.println(marketDepth);
View Full Code Here

Examples of com.xeiam.xchange.cryptonit.v2.dto.marketdata.CryptonitTicker

  }

  public CryptonitTicker getCryptonitTicker(CurrencyPair currencyPair) throws IOException {

    // Request data
    CryptonitTicker cryptonitTicker = cryptonit.getTicker(currencyPair.counterSymbol, currencyPair.baseSymbol);

    // Adapt to XChange DTOs
    return cryptonitTicker;
  }
View Full Code Here

Examples of com.xeiam.xchange.cryptonit.v2.dto.marketdata.CryptonitTicker

    // Read in the JSON from the example resources
    InputStream is = CryptonitAdapterTest.class.getResourceAsStream("/marketdata/example-ticker-data.json");

    // Use Jackson to parse it
    ObjectMapper mapper = new ObjectMapper();
    CryptonitTicker cryptonitTicker = mapper.readValue(is, CryptonitTicker.class);

    Ticker ticker = CryptonitAdapters.adaptTicker(cryptonitTicker, CurrencyPair.BTC_USD);

    assertThat(ticker.getLast().toString()).isEqualTo("605.997");
    assertThat(ticker.getLow().toString()).isEqualTo("572.73768613");
View Full Code Here

Examples of com.xeiam.xchange.cryptonit.v2.dto.marketdata.CryptonitTicker

    // Read in the JSON from the example resources
    InputStream is = CryptonitTickerJSONTest.class.getResourceAsStream("/marketdata/example-ticker-data.json");

    // Use Jackson to parse it
    ObjectMapper mapper = new ObjectMapper();
    CryptonitTicker cryptonitTicker = mapper.readValue(is, CryptonitTicker.class);
    CryptonitRate cryptonitTickerRate = cryptonitTicker.getRate();

    // Verify that the example data was unmarshalled correctly
    assertThat(cryptonitTickerRate.getLast()).isEqualTo(new BigDecimal("605.997"));
    assertThat(cryptonitTickerRate.getHigh()).isEqualTo(new BigDecimal("610.00000000"));
    assertThat(cryptonitTickerRate.getLow()).isEqualTo(new BigDecimal("572.73768613"));
    assertThat(cryptonitTicker.getVolume().getVolume("BTC")).isEqualTo(new BigDecimal("8.28600851"));
    assertThat(cryptonitTickerRate.getAsk()).isEqualTo(new BigDecimal("604.44900000"));
    assertThat(cryptonitTickerRate.getBid()).isEqualTo(new BigDecimal("584.79532163"));

  }
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.