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

org.knowm.xchange.examples.coinegg.CoinEggTickerDemo Maven / Gradle / Ivy

Go to download

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

The newest version!
package org.knowm.xchange.examples.coinegg;

import java.io.IOException;
import org.knowm.xchange.Exchange;
import org.knowm.xchange.ExchangeFactory;
import org.knowm.xchange.coinegg.CoinEggExchange;
import org.knowm.xchange.currency.CurrencyPair;
import org.knowm.xchange.service.marketdata.MarketDataService;

/** Demonstrate requesting Ticker at CoinEgg */
public class CoinEggTickerDemo {

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

    // Create Default BitZ Instance
    Exchange coinEgg = ExchangeFactory.INSTANCE.createExchange(CoinEggExchange.class);

    // Get The Public Market Data Service
    MarketDataService marketDataService = coinEgg.getMarketDataService();

    // Currency Pair To Get Ticker Of
    CurrencyPair pair = CurrencyPair.ETH_BTC;

    // Print The Generic and Raw Ticker
    System.out.println(marketDataService.getTicker(pair));
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy