Examples of ANXDepthWrapper


Examples of com.xeiam.xchange.anx.v2.dto.marketdata.ANXDepthWrapper

  }

  public ANXDepthWrapper getANXFullOrderBook(CurrencyPair currencyPair) throws IOException {

    try {
      ANXDepthWrapper anxDepthWrapper = anxV2.getFullDepth(currencyPair.baseSymbol, currencyPair.counterSymbol);
      return anxDepthWrapper;
    } catch (ANXException e) {
      throw new ExchangeException("Error calling getANXFullOrderBook(): " + e.getError(), e);
    }
  }
View Full Code Here

Examples of com.xeiam.xchange.anx.v2.dto.marketdata.ANXDepthWrapper

    if (pathCurrencyPair == null) {
      return null;
    }
    try {
      if (i == 2) {
        ANXDepthWrapper anxDepthWrapper = getANXFullOrderBook(pathCurrencyPair);
        Map<String, ANXDepth> book = new HashMap<String, ANXDepth>();
        book.put(pathCurrencyPair.baseSymbol + pathCurrencyPair.counterSymbol, anxDepthWrapper.getAnxDepth());
        return book;
      }
      ANXDepthsWrapper anxDepthWrapper = anxV2.getFullDepths(pathCurrencyPair.baseSymbol, pathCurrencyPair.counterSymbol, extraCurrencyPairs.toString());
      return anxDepthWrapper.getAnxDepths();
    } catch (ANXException e) {
      throw new ExchangeException("Error calling getANXFullOrderBook(): " + e.getError(), e);
    }
  }
View Full Code Here

Examples of com.xeiam.xchange.anx.v2.dto.marketdata.ANXDepthWrapper

  }

  public ANXDepthWrapper getANXPartialOrderBook(CurrencyPair currencyPair) throws IOException {

    try {
      ANXDepthWrapper anxDepthWrapper = anxV2.getPartialDepth(currencyPair.baseSymbol, currencyPair.counterSymbol);
      return anxDepthWrapper;
    } catch (ANXException e) {
      throw new ExchangeException("Error calling getANXPartialOrderBook(): " + e.getError(), e);
    }
  }
View Full Code Here

Examples of com.xeiam.xchange.anx.v2.dto.marketdata.ANXDepthWrapper

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

    // Request data
    ANXDepthWrapper anxDepthWrapper = null;
    if (args.length > 0) {
      if (args[0] instanceof String) {
        if ("full" == args[0]) {
          anxDepthWrapper = getANXFullOrderBook(currencyPair);
        }
        else {
          anxDepthWrapper = getANXPartialOrderBook(currencyPair);
        }
      }
      else {
        throw new ExchangeException("Orderbook type argument must be a String!");
      }
    }
    else { // default to full orderbook
      anxDepthWrapper = getANXFullOrderBook(currencyPair);
    }

    // Adapt to XChange DTOs
    List<LimitOrder> asks = ANXAdapters.adaptOrders(anxDepthWrapper.getAnxDepth().getAsks(), currencyPair.baseSymbol, currencyPair.counterSymbol, "ask", "");
    List<LimitOrder> bids = ANXAdapters.adaptOrders(anxDepthWrapper.getAnxDepth().getBids(), currencyPair.baseSymbol, currencyPair.counterSymbol, "bid", "");
    Date date = new Date(anxDepthWrapper.getAnxDepth().getMicroTime() / 1000);
    return new OrderBook(date, asks, bids);
  }
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.