本文整理了Java中org.knowm.xchange.dto.marketdata.OrderBook.getTimeStamp()
方法的一些代码示例,展示了OrderBook.getTimeStamp()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。OrderBook.getTimeStamp()
方法的具体详情如下:
包路径:org.knowm.xchange.dto.marketdata.OrderBook
类名称:OrderBook
方法名:getTimeStamp
暂无
代码示例来源:origin: knowm/XChange
public static void main(String[] args) throws IOException {
// Use the factory to get Cex.IO exchange API using default settings
Exchange exchange = ExchangeFactory.INSTANCE.createExchange(AbucoinsExchange.class.getName());
// Interested in the public market data feed (no authentication)
MarketDataService marketDataService = exchange.getMarketDataService();
// Get the latest order book data for GHs/BTC
OrderBook orderBook = marketDataService.getOrderBook(CurrencyPair.BTC_USD);
System.out.println(
"Current Order Book size for BTC/USD: "
+ (orderBook.getAsks().size() + orderBook.getBids().size()));
System.out.println("First Ask: " + orderBook.getAsks().get(0).toString());
System.out.println("First Bid: " + orderBook.getBids().get(0).toString());
System.out.println("Timestamp: " + orderBook.getTimeStamp().toString());
// System.out.println(orderBook.toString());
}
}
代码示例来源:origin: knowm/XChange
public static void main(String[] args) throws IOException {
// Use the factory to get Cex.IO exchange API using default settings
Exchange exchange = ExchangeFactory.INSTANCE.createExchange(CexIOExchange.class.getName());
// Interested in the public market data feed (no authentication)
MarketDataService marketDataService = exchange.getMarketDataService();
// Get the latest order book data for GHs/BTC
OrderBook orderBook =
marketDataService.getOrderBook(new CurrencyPair(Currency.GHs, Currency.BTC));
System.out.println(
"Current Order Book size for GHS/BTC: "
+ (orderBook.getAsks().size() + orderBook.getBids().size()));
System.out.println("First Ask: " + orderBook.getAsks().get(0).toString());
System.out.println("First Bid: " + orderBook.getBids().get(0).toString());
System.out.println("Timestamp: " + orderBook.getTimeStamp().toString());
// System.out.println(orderBook.toString());
}
}
代码示例来源:origin: sutra/okcoin-client
@Override
public void onOrderBook(OrderBook orderBook, SessionID sessionId) {
long now = System.currentTimeMillis();
log.info("order book time: {}, lagging: {} ms. bids size: {}, asks size: {}. best bid: {}@{}, best ask: {}@{}.",
orderBook.getTimeStamp().toInstant(),
mFmt.format(now - orderBook.getTimeStamp().getTime()),
StringUtils.leftPad(String.valueOf(orderBook.getBids().size()), 3),
StringUtils.leftPad(String.valueOf(orderBook.getAsks().size()), 3),
StringUtils.leftPad(qFmt.format(orderBook.getBids().get(0).getTradableAmount()), 7),
pFmt.format(orderBook.getBids().get(0).getLimitPrice()),
StringUtils.leftPad(qFmt.format(orderBook.getAsks().get(0).getTradableAmount()), 7),
pFmt.format(orderBook.getAsks().get(0).getLimitPrice())
);
}
代码示例来源:origin: timolson/cointrader
XchangeUtil.getHelperForExchange(coinTraderExchange).handleOrderBook(orderBook);
log.trace("Attempting create book from: " + orderBook);
Book book = bookFactory.create(new Instant(orderBook.getTimeStamp()), market);
LimitOrder limitOrder;
内容来源于网络,如有侵权,请联系作者删除!