Package com.xeiam.xchange.service.polling

Examples of com.xeiam.xchange.service.polling.PollingMarketDataService


  @Test
  public void testApplySpecification() {

    assertNotNull(defaultExchange);
    PollingAccountService accountService = defaultExchange.getPollingAccountService();
    PollingMarketDataService marketDataService = defaultExchange.getPollingMarketDataService();
    PollingTradeService tradeService = defaultExchange.getPollingTradeService();
    assertNull(accountService);
    assertNull(marketDataService);
    assertNull(tradeService);
    defaultExchange.applySpecification(exchangeSpecification);
View Full Code Here


  @Test
  public void testGetPollingMarketDataService() {

    assertNotNull(testExchange);
    PollingMarketDataService marketDataService = testExchange.getPollingMarketDataService();
    assertNotNull(marketDataService);
    marketDataService = testExchange.getPollingMarketDataService();
    assertNotNull(marketDataService);
    LOGGER.info(marketDataService.toString());
  }
View Full Code Here

    // Use the factory to get the VirtEx exchange API using default settings
    Exchange cavirtex = ExchangeFactory.INSTANCE.createExchange(VirtExExchange.class.getName());

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

    generic(marketDataService);
    raw((VirtExMarketDataServiceRaw) marketDataService);

  }
View Full Code Here

  }

  private static void generic(Exchange okcoinExchange) throws IOException {

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

    // Get the latest full order book data for NMC/XRP
    OrderBook orderBook = marketDataService.getOrderBook(CurrencyPair.BTC_CNY);
    System.out.println(orderBook.toString());
    System.out.println("full orderbook size: " + (orderBook.getAsks().size() + orderBook.getBids().size()));

  }
View Full Code Here

    // Use the factory to get the VirtEx exchange API using default settings
    Exchange cavirtex = ExchangeFactory.INSTANCE.createExchange(VirtExExchange.class.getName());

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

    generic(marketDataService);
    raw((VirtExMarketDataServiceRaw) marketDataService);
  }
View Full Code Here

  }

  private static void generic(Exchange krakenExchange) throws IOException {

    // Interested in the public polling market data feed (no authentication)
    PollingMarketDataService krakenMarketDataService = krakenExchange.getPollingMarketDataService();

    for (CurrencyPair currencyPair : krakenMarketDataService.getExchangeSymbols()) {
      System.out.println(currencyPair);
    }
  }
View Full Code Here

  }

  private static void generic(Exchange krakenExchange) throws IOException {

    // Interested in the public polling market data feed (no authentication)
    PollingMarketDataService krakenMarketDataService = krakenExchange.getPollingMarketDataService();

    // Get the latest full order book data for NMC/XRP
    OrderBook orderBook = krakenMarketDataService.getOrderBook(CurrencyPair.BTC_EUR);
    System.out.println(orderBook.toString());
    System.out.println("full orderbook size: " + (orderBook.getAsks().size() + orderBook.getBids().size()));

    // Get the latest partial size order book data for NMC/XRP
    orderBook = krakenMarketDataService.getOrderBook(CurrencyPair.BTC_EUR, 3L);
    System.out.println(orderBook.toString());
    System.out.println("partial orderbook size: " + (orderBook.getAsks().size() + orderBook.getBids().size()));
  }
View Full Code Here

  }

  private static void generic(Exchange krakenExchange) throws IOException {

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

    // Get the latest trade data for BTC_USD
    Trades trades = marketDataService.getTrades(CurrencyPair.BTC_USD);
    System.out.println(trades);
    System.out.println("Trades(0): " + trades.getTrades().get(0).toString());
    System.out.println("Trades size: " + trades.getTrades().size());

    // Get the latest trade data for BTC_USD for the past 12 hours (note: doesn't account for time zone differences, should use UTC instead)
    trades = marketDataService.getTrades(CurrencyPair.BTC_USD, (long) (System.nanoTime() - (12 * 60 * 60 * Math.pow(10, 9))));
    System.out.println(trades);
    System.out.println("Trades size: " + trades.getTrades().size());
  }
View Full Code Here

  }

  private static void generic(Exchange krakenExchange) throws IOException {

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

    // Get the latest ticker data showing BTC to EUR
    Ticker ticker = marketDataService.getTicker(CurrencyPair.BTC_EUR);

    System.out.println("Ticker: " + ticker.toString());
    System.out.println("Currency: " + Currencies.EUR);
    System.out.println("Last: " + ticker.getLast().toString());
    System.out.println("Volume: " + ticker.getVolume().toString());
View Full Code Here

  public static void main(String[] args) throws Exception {

    CertHelper.trustAllCerts();

    Exchange poloniex = ExchangeFactory.INSTANCE.createExchange(PoloniexExchange.class.getName());
    PollingMarketDataService dataService = poloniex.getPollingMarketDataService();
    currencyPair = new CurrencyPair("XMR", Currencies.BTC);

    generic(dataService);
    raw((PoloniexMarketDataServiceRaw) dataService);
  }
View Full Code Here

TOP

Related Classes of com.xeiam.xchange.service.polling.PollingMarketDataService

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.