use of org.knowm.xchange.kraken.dto.marketdata.KrakenTicker in project XChange by knowm.
the class KrakenAdapters method adaptTickers.
public static List<Ticker> adaptTickers(Map<String, KrakenTicker> krakenTickers) {
List<Ticker> tickers = new ArrayList<>();
for (Entry<String, KrakenTicker> ticker : krakenTickers.entrySet()) {
CurrencyPair pair = KrakenUtils.translateKrakenCurrencyPair(ticker.getKey());
tickers.add(adaptTicker(ticker.getValue(), pair));
}
return tickers;
}
use of org.knowm.xchange.kraken.dto.marketdata.KrakenTicker in project XChange by knowm.
the class KrakenTickerDemo method raw.
private static void raw(Exchange krakenExchange) throws IOException {
// Interested in the public market data feed (no authentication)
KrakenMarketDataServiceRaw krakenMarketDataService = (KrakenMarketDataServiceRaw) krakenExchange.getMarketDataService();
// Get the latest ticker data showing BTC to EUR
KrakenTicker ticker = krakenMarketDataService.getKrakenTicker(CurrencyPair.BTC_EUR);
System.out.println("Ticker: " + ticker.toString());
System.out.println("Currency: " + Currency.EUR);
System.out.println("Last: " + ticker.getClose());
System.out.println("Volume: " + ticker.get24HourVolume().toString());
System.out.println("High: " + ticker.get24HourHigh().toString());
System.out.println("Low: " + ticker.get24HourLow().toString());
}
Aggregations