Examples of BTCTradeTicker


Examples of com.xeiam.xchange.btctrade.dto.marketdata.BTCTradeTicker

    // Interested in the public polling market data feed (no authentication).
    BTCTradeMarketDataServiceRaw marketDataService = (BTCTradeMarketDataServiceRaw) exchange.getPollingMarketDataService();

    // Get the latest ticker data showing BTC to CNY.
    BTCTradeTicker ticker = marketDataService.getBTCTradeTicker();
    System.out.println("High: " + ticker.getHigh());
    System.out.println("Low:  " + ticker.getLow());
    System.out.println("Buy:  " + ticker.getBuy());
    System.out.println("Sell: " + ticker.getSell());
    System.out.println("Last: " + ticker.getLast());
    System.out.println("Vol:  " + ticker.getVol());
  }
View Full Code Here

Examples of com.xeiam.xchange.btctrade.dto.marketdata.BTCTradeTicker

  private final ObjectMapper mapper = new ObjectMapper();

  @Test
  public void testAdaptTicker() throws IOException {

    BTCTradeTicker btcTradeTicker = mapper.readValue(getClass().getResource("dto/marketdata/ticker.json"), BTCTradeTicker.class);
    Ticker ticker = BTCTradeAdapters.adaptTicker(btcTradeTicker, CurrencyPair.BTC_CNY);
    assertEquals(new BigDecimal("3760"), ticker.getHigh());
    assertEquals(new BigDecimal("3658"), ticker.getLow());
    assertEquals(new BigDecimal("3752"), ticker.getBid());
    assertEquals(new BigDecimal("3758"), ticker.getAsk());
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.