Examples of BitcurexDepth


Examples of com.xeiam.xchange.bitcurex.dto.marketdata.BitcurexDepth

  @Override
  public OrderBook getOrderBook(CurrencyPair currencyPair, Object... args) throws IOException {

    // get data
    BitcurexDepth bitcurexDepth = getBitcurexOrderBook(currencyPair.counterSymbol);

    // Adapt to XChange DTOs
    List<LimitOrder> asks = BitcurexAdapters.adaptOrders(bitcurexDepth.getAsks(), currencyPair, OrderType.ASK, "");
    List<LimitOrder> bids = BitcurexAdapters.adaptOrders(bitcurexDepth.getBids(), currencyPair, OrderType.BID, "");

    return new OrderBook(null, asks, bids);
  }
View Full Code Here

Examples of com.xeiam.xchange.bitcurex.dto.marketdata.BitcurexDepth

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

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

    // Verify that the example data was unmarshalled correctly
    assertThat(bitcurexDepth.getAsks().get(0)[0]).isEqualTo(new BigDecimal("70.00000000"));
  }
View Full Code Here

Examples of com.xeiam.xchange.bitcurex.dto.marketdata.BitcurexDepth

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

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

    List<LimitOrder> asks = BitcurexAdapters.adaptOrders(BitcurexDepth.getAsks(), CurrencyPair.BTC_EUR, OrderType.ASK, "");

    // Verify all fields filled
    assertThat(asks.get(0).getLimitPrice().doubleValue()).isEqualTo(70.00000000);
    assertThat(asks.get(0).getType()).isEqualTo(OrderType.ASK);
    assertThat(asks.get(0).getTradableAmount().doubleValue()).isEqualTo(0.1021341);
View Full Code Here

Examples of com.xeiam.xchange.bitcurex.dto.marketdata.BitcurexDepth

  }

  private static void raw(BitcurexMarketDataServiceRaw marketDataService, String counterSymbol) throws IOException {

    // Get the latest order book data for BTC/CAD
    BitcurexDepth bitcurexDepth = marketDataService.getBitcurexOrderBook(counterSymbol);

    System.out.println("Current Order Book size for BTC / " + counterSymbol + ": " + (bitcurexDepth.getAsks().size() + bitcurexDepth.getBids().size()));

    System.out.println("First Ask: " + bitcurexDepth.getAsks().get(0)[0].toString());

    System.out.println("First Bid: " + bitcurexDepth.getBids().get(0)[0].toString());

    System.out.println(bitcurexDepth.toString());
  }
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.