com.xeiam.xchange.examples.therock.TheRockMarketDataDemo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xchange-examples Show documentation
Show all versions of xchange-examples Show documentation
Provides a set of examples that demonstrate how to use XChange in client applications
The newest version!
package com.xeiam.xchange.examples.therock;
import java.io.IOException;
import com.xeiam.xchange.Exchange;
import com.xeiam.xchange.ExchangeFactory;
import com.xeiam.xchange.currency.CurrencyPair;
import com.xeiam.xchange.service.polling.marketdata.PollingMarketDataService;
import com.xeiam.xchange.therock.TheRockExchange;
public class TheRockMarketDataDemo {
public static void main(String[] args) throws IOException {
// Use the factory to get TheRock exchange API using default settings
Exchange theRockExchange = ExchangeFactory.INSTANCE.createExchange(TheRockExchange.class.getName());
generic(theRockExchange);
}
private static void generic(Exchange loyalbitExchange) throws IOException {
// Interested in the public polling market data feed (no authentication)
PollingMarketDataService loyalbitMarketDataService = loyalbitExchange.getPollingMarketDataService();
// Get the ticker
System.out.println("Ticker: " + loyalbitMarketDataService.getTicker(CurrencyPair.BTC_USD));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy