All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.xeiam.xchange.examples.coinbaseex.marketdata.CoinbaseExMarketDataDemo Maven / Gradle / Ivy

Go to download

Provides a set of examples that demonstrate how to use XChange in client applications

The newest version!
package com.xeiam.xchange.examples.coinbaseex.marketdata;

import com.xeiam.xchange.coinbaseex.CoinbaseExExchange;
import com.xeiam.xchange.coinbaseex.service.polling.CoinbaseExMarketDataService;
import com.xeiam.xchange.currency.CurrencyPair;
import com.xeiam.xchange.dto.marketdata.Ticker;

/**
 * Created by Yingzhe on 4/12/2015.
 */
public class CoinbaseExMarketDataDemo {

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

    CoinbaseExExchange exchange = new CoinbaseExExchange();
    exchange.applySpecification(exchange.getDefaultExchangeSpecification());
    CoinbaseExMarketDataService marketDataService = (CoinbaseExMarketDataService) exchange.getPollingMarketDataService();
    Ticker ticker = marketDataService.getTicker(new CurrencyPair("BTC", "USD"));
    System.out.println(ticker.toString());
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy