Package com.xeiam.xchange.btctrade.service.polling

Examples of com.xeiam.xchange.btctrade.service.polling.BTCTradeMarketDataServiceRaw


  }

  private static void raw(Exchange exchange) {

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

    // Get the order book data for BTC/CNY.
    BTCTradeDepth depth = marketDataService.getBTCTradeDepth();
    System.out.println("size: " + (depth.getAsks().length + depth.getBids().length));
  }
View Full Code Here


  }

  private static void raw(Exchange exchange) {

    // 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());
View Full Code Here

  }

  private static void raw(Exchange exchange) {

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

    // Get the latest 500 trade data for BTC/CNY.
    BTCTradeTrade[] trades = marketDataService.getBTCTradeTrades();
    System.out.println("Trades count: " + trades.length);
    for (BTCTradeTrade trade : trades) {
      System.out.println(trade.getTid() + "\t" + new Date(trade.getDate() * 1000) + "\t" + trade.getType() + "\t" + trade.getPrice() + "\t" + trade.getAmount());
    }

    // Get 500 trades which tid > 0
    trades = marketDataService.getBTCTradeTrades(0);
    System.out.println("Trades count: " + trades.length);
    for (BTCTradeTrade trade : trades) {
      System.out.println(trade.getTid() + "\t" + new Date(trade.getDate() * 1000) + "\t" + trade.getType() + "\t" + trade.getPrice() + "\t" + trade.getAmount());
    }
  }
View Full Code Here

TOP

Related Classes of com.xeiam.xchange.btctrade.service.polling.BTCTradeMarketDataServiceRaw

Copyright © 2018 www.massapicom. 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.