use of org.knowm.xchange.hitbtc.v2.dto.HitbtcTicker in project XChange by knowm.
the class HitbtcMarketDataDemo method raw.
private static void raw(HitbtcMarketDataServiceRaw marketDataService) throws IOException {
HitbtcTicker ticker = marketDataService.getHitbtcTicker(CurrencyPair.BTC_USD);
System.out.println("BTC/USD Ticker: " + ticker.toString());
Map<String, HitbtcTicker> tickers = marketDataService.getHitbtcTickers();
System.out.println("All Tickers: " + tickers.toString());
// Get the latest order book data for BTC/USD
HitbtcOrderBook orderBook = marketDataService.getHitbtcOrderBook(CurrencyPair.BTC_USD);
System.out.println("Current Order Book size for BTC/USD: " + (orderBook.getAsks().length + orderBook.getBids().length));
System.out.println(orderBook);
}
use of org.knowm.xchange.hitbtc.v2.dto.HitbtcTicker in project XChange by knowm.
the class HitbtcAdapters method adaptTicker.
public static Ticker adaptTicker(HitbtcTicker hitbtcTicker, CurrencyPair currencyPair) {
BigDecimal bid = hitbtcTicker.getBid();
BigDecimal ask = hitbtcTicker.getAsk();
BigDecimal high = hitbtcTicker.getHigh();
BigDecimal low = hitbtcTicker.getLow();
BigDecimal last = hitbtcTicker.getLast();
BigDecimal volume = hitbtcTicker.getVolume();
Date timestamp = hitbtcTicker.getTimestamp();
return new Ticker.Builder().currencyPair(currencyPair).last(last).bid(bid).ask(ask).high(high).low(low).volume(volume).timestamp(timestamp).build();
}
Aggregations