use of org.knowm.xchange.currency.CurrencyPair in project XChange by knowm.
the class DepthDemo method generic.
private static void generic(MarketDataService marketDataService) throws IOException {
// Get the latest order book data for LTC/BRL
OrderBook orderBook = marketDataService.getOrderBook(new CurrencyPair(Currency.LTC, Currency.BRL));
System.out.println("Current Order Book size for LTC / BRL: " + (orderBook.getAsks().size() + orderBook.getBids().size()));
System.out.println("First Ask: " + orderBook.getAsks().get(0).toString());
System.out.println("Last Ask: " + orderBook.getAsks().get(orderBook.getAsks().size() - 1).toString());
System.out.println("First Bid: " + orderBook.getBids().get(0).toString());
System.out.println("Last Bid: " + orderBook.getBids().get(orderBook.getBids().size() - 1).toString());
System.out.println(orderBook.toString());
}
use of org.knowm.xchange.currency.CurrencyPair in project XChange by knowm.
the class TickerDemo method generic.
private static void generic(MarketDataService marketDataService) throws IOException {
Ticker ticker = marketDataService.getTicker(new CurrencyPair(Currency.LTC, Currency.BRL));
System.out.println(ticker.toString());
}
use of org.knowm.xchange.currency.CurrencyPair in project XChange by knowm.
the class TradesDemo method generic.
private static void generic(Long now, MarketDataService marketDataService) throws IOException {
// Get the latest trade data for LTC/BRL
Trades trades = marketDataService.getTrades(new CurrencyPair(Currency.LTC, Currency.BRL));
System.out.println("Trades, default. Size= " + trades.getTrades().size());
trades = marketDataService.getTrades(new CurrencyPair(Currency.LTC, Currency.BRL), now - (24L * 60L * 60L * 1000L));
System.out.println("Trades, last 24h= " + trades.getTrades().size());
trades = marketDataService.getTrades(new CurrencyPair(Currency.LTC, Currency.BRL), 1406851200000L, 1409529600000L);
System.out.println("Trades, since Aug 2014 to Sep 2014= " + trades.getTrades().size());
System.out.println(trades.toString());
}
use of org.knowm.xchange.currency.CurrencyPair in project XChange by knowm.
the class ItBitTradesDemo method generic.
private static void generic(MarketDataService marketDataService) throws IOException {
Trades trades = marketDataService.getTrades(CurrencyPair.BTC_USD, 22233);
System.out.println(trades.toString());
Trades tradesAsXBT = marketDataService.getTrades(new CurrencyPair(Currency.XBT, Currency.USD), 22233);
System.out.println(tradesAsXBT.toString());
}
use of org.knowm.xchange.currency.CurrencyPair in project XChange by knowm.
the class LatokenAdapters method adaptTrades.
public static Trades adaptTrades(Exchange exchange, LatokenTrades latokenTrades) {
CurrencyPair pair = adaptCurrencyPair(exchange, latokenTrades.getSymbol());
List<Trade> trades = latokenTrades.getTrades().stream().map(latokenTrade -> adaptTrade(latokenTrade, pair)).collect(Collectors.toList());
return new Trades(trades, TradeSortType.SortByTimestamp);
}
Aggregations