Package com.xeiam.xchange.service.polling

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


    raw(mintPalExchange);
  }

  private static void generic(Exchange mintPal) throws IOException {

    PollingMarketDataService mintPalGenericMarketDataService = mintPal.getPollingMarketDataService();

    Collection<CurrencyPair> currencyPairs = mintPalGenericMarketDataService.getExchangeSymbols();
    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


    // Use the factory to get BitcoinCharts exchange API using default settings
    Exchange bitcoinChartsExchange = ExchangeFactory.INSTANCE.createExchange(BitcoinChartsExchange.class.getName());

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

    // Get the latest ticker data showing BTC/bitstampUSD
    CurrencyPair currencyPair = new CurrencyPair(Currencies.BTC, "bitstampUSD");
    Ticker ticker = marketDataService.getTicker(currencyPair);

    double value = ticker.getLast().doubleValue();

    String currency = ticker.getCurrencyPair().counterSymbol.toString();
    System.out.println("bitstampUSD Last: " + currency + "-" + value);
View Full Code Here

public class BittrexMarketDataDemo {

  public static void main(String[] args) throws ExchangeException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException, IOException {

    Exchange exchange = ExchangeFactory.INSTANCE.createExchange(BittrexExchange.class.getName());
    PollingMarketDataService marketDataService = exchange.getPollingMarketDataService();

    generic(marketDataService);
    raw((BittrexMarketDataServiceRaw) marketDataService);

  }
View Full Code Here

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

    CertHelper.trustAllCerts();

    Exchange coinbaseExchange = ExchangeFactory.INSTANCE.createExchange(CryptoTradeExchange.class.getName());
    PollingMarketDataService marketDataService = coinbaseExchange.getPollingMarketDataService();

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

public class BTERMarketDataDemo {

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

    Exchange exchange = ExchangeFactory.INSTANCE.createExchange(BTERExchange.class.getName());
    PollingMarketDataService marketDataService = exchange.getPollingMarketDataService();

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

    raw(coinsetter);
  }

  private static void generic(Exchange exchange) throws ExchangeException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException, IOException {

    PollingMarketDataService marketDataService = exchange.getPollingMarketDataService();

    Ticker ticker = marketDataService.getTicker(CurrencyPair.BTC_USD);
    log.info("Ticker: {}", ticker);

    OrderBook orderBook = marketDataService.getOrderBook(CurrencyPair.BTC_USD);
    log.info("OrderBook: {}", orderBook);

    orderBook = marketDataService.getOrderBook(CurrencyPair.BTC_AUD, "COINSETTER");
    log.info("OrderBook(COINSETTER): {}", orderBook);

    orderBook = marketDataService.getOrderBook(CurrencyPair.BTC_AUD, "COINSETTER", 5);
    log.info("OrderBook(COINSETTER, 5): {}", orderBook);

    orderBook = marketDataService.getOrderBook(CurrencyPair.BTC_AUD, null, 5);
    log.info("OrderBook(null, 5): {}", orderBook);

    orderBook = marketDataService.getOrderBook(CurrencyPair.BTC_AUD, null, null);
    log.info("OrderBook(null, null): {}", orderBook);
  }
View Full Code Here

  }

  private static void generic(Exchange exchange) throws IOException {

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

    // Get the latest ticker data showing BTC to USD
    Ticker ticker = bitcoiniumGenericMarketDataService.getTicker(new CurrencyPair("BTC", "BITSTAMP_USD"));

    System.out.println("Last: " + ticker.getLast());
    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

  }

  private static void generic(Exchange campBXExchange) throws IOException {

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

    // Get the latest ticker data showing BTC to USD
    Ticker ticker = campBXGenericMarketDataService.getTicker(CurrencyPair.BTC_USD);

    System.out.println("Last: " + ticker.getLast());
    System.out.println("Bid: " + ticker.getBid());
    System.out.println("Ask: " + ticker.getAsk());

    // Get the latest order book data for BTC/USD
    OrderBook orderBook = campBXGenericMarketDataService.getOrderBook(CurrencyPair.BTC_USD);

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

  }

  private static void generic(Exchange exchange) throws IOException {

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

    // Get the latest trade data for BTC/EUR
    Trades trades = marketDataService.getTrades(CurrencyPair.BTC_EUR);

    System.out.println(trades.toString());
  }
View Full Code Here

  }

  private static void requestData(Exchange bitcurex, CurrencyPair pair) throws IOException {

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

    generic(marketDataService, pair);
    raw((BitcurexMarketDataServiceRaw) marketDataService, pair.counterSymbol);
  }
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.