Examples of BTCChinaGetMarketDepthResponse


Examples of com.xeiam.xchange.btcchina.dto.trade.response.BTCChinaGetMarketDepthResponse

   * @see BTCChina#getMarketDepth(si.mazi.rescu.ParamsDigest, si.mazi.rescu.SynchronizedValueFactory, BTCChinaGetMarketDepthRequest)
   */
  public BTCChinaGetMarketDepthResponse getMarketDepth(Integer limit, String market) throws IOException {

    BTCChinaGetMarketDepthRequest request = new BTCChinaGetMarketDepthRequest(limit, market);
    BTCChinaGetMarketDepthResponse response = btcChina.getMarketDepth(signatureCreator, tonce, request);
    return checkResult(response);
  }
View Full Code Here

Examples of com.xeiam.xchange.btcchina.dto.trade.response.BTCChinaGetMarketDepthResponse

  }

  @Test
  public void testAdaptOrderBook() throws IOException {

    BTCChinaGetMarketDepthResponse response = mapper.readValue(getClass().getResourceAsStream("dto/trade/response/getMarketDepth2.json"), BTCChinaGetMarketDepthResponse.class);
    OrderBook orderBook = BTCChinaAdapters.adaptOrderBook(response.getResult().getMarketDepth(), CurrencyPair.BTC_CNY);
    List<LimitOrder> bids = orderBook.getBids();
    List<LimitOrder> asks = orderBook.getAsks();
    assertEquals(2, bids.size());
    assertEquals(2, asks.size());
View Full Code Here

Examples of com.xeiam.xchange.btcchina.dto.trade.response.BTCChinaGetMarketDepthResponse

  private static void getMarketDepth(Integer limit, String market) throws IOException {

    System.out.println(String.format("limit: %d, market: %s", limit, market));

    BTCChinaGetMarketDepthResponse response = tradeService.getMarketDepth(limit, market);
    System.out.println(response);

    for (BTCChinaMarketDepthOrder o : response.getResult().getMarketDepth().getBids()) {
      System.out.println(String.format("Bid %s,%s", o.getPrice(), o.getAmount()));
    }

    for (BTCChinaMarketDepthOrder o : response.getResult().getMarketDepth().getAsks()) {
      System.out.println(String.format("Ask %s,%s", o.getPrice(), o.getAmount()));
    }
  }
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.