Package com.xeiam.xchange.dto.marketdata

Examples of com.xeiam.xchange.dto.marketdata.OrderBook


    for (CryptsyPublicOrderbook cryptsyOrderBook : cryptsyOrderBooks.values()) {
      CurrencyPair currencyPair = adaptCurrencyPair(cryptsyOrderBook.getLabel());
      List<LimitOrder> asks = adaptPublicOrders(cryptsyOrderBook.getSellOrders(), OrderType.ASK, currencyPair);
      List<LimitOrder> bids = adaptPublicOrders(cryptsyOrderBook.getBuyOrders(), OrderType.BID, currencyPair);

      orderBooks.add(new OrderBook(timestamp, asks, bids));
    }

    return orderBooks;
  }
View Full Code Here


    // get all services
    PollingMarketDataService marketDataService = bitfinex.getPollingMarketDataService();
    PollingAccountService accout = bitfinex.getPollingAccountService();
    PollingTradeService trades = bitfinex.getPollingTradeService();

    OrderBook orderBook = marketDataService.getOrderBook(new CurrencyPair("XBT", "USD"));
    System.out.println("BIDS: " + orderBook.getBids());
    System.out.println("ASKS: " + orderBook.getAsks());

    Trades trades2 = marketDataService.getTrades(new CurrencyPair("XBT", "USD"), 22233);
    System.out.println("Current trades:" + trades2);

    AccountInfo accountInfo = accout.getAccountInfo();
View Full Code Here

    System.out.println(currencyPairs);

    Ticker ticker = mintPalGenericMarketDataService.getTicker(CurrencyPair.LTC_BTC);
    System.out.println(ticker);

    OrderBook orderBook = mintPalGenericMarketDataService.getOrderBook(CurrencyPair.LTC_BTC);
    System.out.println(orderBook);

    Trades trades = mintPalGenericMarketDataService.getTrades(CurrencyPair.LTC_BTC);
    System.out.println(trades);
  }
View Full Code Here

    System.out.println("Market data for " + pair + ":");

    Ticker ticker = marketDataService.getTicker(pair);
    System.out.println(ticker);

    OrderBook orderBook = marketDataService.getOrderBook(pair);
    System.out.println(orderBook);

    Trades trades = marketDataService.getTrades(pair);
    System.out.println(trades);
  }
View Full Code Here

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

    OrderBook genericOrderBook = BTCCentralAdapters.adaptMarketDepth(btcCentralMarketDepth, CurrencyPair.BTC_EUR);

    assertEquals(genericOrderBook.getAsks().get(0).getTradableAmount(), new BigDecimal("0.48762"));
    assertEquals(genericOrderBook.getAsks().get(0).getLimitPrice(), new BigDecimal("24.48996"));
    assertEquals(genericOrderBook.getBids().get(0).getTradableAmount(), new BigDecimal("0.40491093"));
    assertEquals(genericOrderBook.getBids().get(0).getLimitPrice(), new BigDecimal("24.001"));

  }
View Full Code Here

    ItBitDepth depth = getItBitDepth(currencyPair, args);

    List<LimitOrder> asks = ItBitAdapters.adaptOrders(depth.getAsks(), currencyPair, OrderType.ASK);
    List<LimitOrder> bids = ItBitAdapters.adaptOrders(depth.getBids(), currencyPair, OrderType.BID);

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

    final boolean firstIsBids = mintPalOrderBook.get(0).getType().equalsIgnoreCase("buy");
    final List<LimitOrder> bids = firstIsBids ? adaptOrders(currencyPair, OrderType.BID, mintPalOrderBook.get(0)) : adaptOrders(currencyPair, OrderType.BID, mintPalOrderBook.get(1));
    final List<LimitOrder> asks = firstIsBids ? adaptOrders(currencyPair, OrderType.ASK, mintPalOrderBook.get(1)) : adaptOrders(currencyPair, OrderType.ASK, mintPalOrderBook.get(0));

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

    System.out.println(currencyPairs);

    Ticker ticker = marketDataService.getTicker(CurrencyPair.BTC_USD);
    System.out.println(ticker);

    OrderBook orderBook = marketDataService.getOrderBook(CurrencyPair.BTC_USD);
    System.out.println(orderBook);

    Trades publicTradeHistory = marketDataService.getTrades(CurrencyPair.BTC_USD, 1405805427);
    System.out.println(publicTradeHistory);
  }
View Full Code Here

  private static void generic(PollingMarketDataService marketDataService) throws IOException {

    Ticker ticker = marketDataService.getTicker(CurrencyPair.PPC_BTC);
    System.out.println(ticker);

    OrderBook oderBook = marketDataService.getOrderBook(CurrencyPair.BTC_CNY);
    System.out.println(oderBook);

    Trades tradeHistory = marketDataService.getTrades(CurrencyPair.BTC_CNY);
    System.out.println(tradeHistory);
View Full Code Here

    System.out.println("Bid: " + ticker.getBid());
    System.out.println("Ask: " + ticker.getAsk());
    System.out.println("Volume: " + ticker.getVolume());

    // Get the latest order book data for BTC/USD
    OrderBook orderBook = bitcoiniumGenericMarketDataService.getOrderBook(new CurrencyPair("BTC", "BITSTAMP_USD"), "TEN_PERCENT");

    System.out.println("Order book: " + orderBook);
  }
View Full Code Here

TOP

Related Classes of com.xeiam.xchange.dto.marketdata.OrderBook

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.