com.xeiam.xchange.dto.marketdata.OrderBook.getAsks()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(3.0k)|赞(0)|评价(0)|浏览(101)

本文整理了Java中com.xeiam.xchange.dto.marketdata.OrderBook.getAsks()方法的一些代码示例,展示了OrderBook.getAsks()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。OrderBook.getAsks()方法的具体详情如下:
包路径:com.xeiam.xchange.dto.marketdata.OrderBook
类名称:OrderBook
方法名:getAsks

OrderBook.getAsks介绍

暂无

代码示例

代码示例来源:origin: com.xeiam.xchange/xchange-coinfloor

List<LimitOrder> askList = (cachedOrderBook == null ? new ArrayList<LimitOrder>() : cachedOrderBook.getAsks());
if (rawRetObj.getBaseQty().doubleValue() > 0) {
 for (int i = 0; i < bidList.size(); i++) {

代码示例来源:origin: com.xeiam.xchange/xchange-coinfloor

public Map<String, Object> adaptOrderOpened(String data) {
 Map<String, Object> resultMap = new HashMap<String, Object>();
 CoinfloorOrder rawRetObj;
 try {
  rawRetObj = streamObjectMapper.readValue(data, CoinfloorOrder.class);
 } catch (IOException e) {
  throw new ExchangeException("JSON parse error", e);
 }
 synchronized (cachedDataSynchronizationObject) {
  List<LimitOrder> bidList = (cachedOrderBook == null ? new ArrayList<LimitOrder>() : cachedOrderBook.getBids());
  List<LimitOrder> askList = (cachedOrderBook == null ? new ArrayList<LimitOrder>() : cachedOrderBook.getAsks());
  if (rawRetObj.getBaseQty().doubleValue() > 0) {
   bidList.add(adaptOrder(rawRetObj));
  } else {
   askList.add(adaptOrder(rawRetObj));
  }
  cachedOrderBook = new OrderBook(null, askList, bidList);
 }
 resultMap.put("generic", adaptOrder(rawRetObj));
 resultMap.put("raw", rawRetObj);
 return resultMap;
}

代码示例来源:origin: com.xeiam.xchange/xchange-coinfloor

public Map<String, Object> adaptOrders(String data) throws ExchangeException {
 Map<String, Object> resultMap = new HashMap<String, Object>();
 CoinfloorOrderbook rawRetObj;
 try {
  rawRetObj = streamObjectMapper.readValue(data, CoinfloorOrderbook.class);
 } catch (IOException e) {
  throw new ExchangeException("JSON parse error", e);
 }
 resultMap.put("raw", rawRetObj);
 OrderBook orderbook;
 synchronized (cachedDataSynchronizationObject) {
  List<LimitOrder> bidList = (cachedOrderBook == null ? new ArrayList<LimitOrder>() : cachedOrderBook.getBids());
  List<LimitOrder> askList = (cachedOrderBook == null ? new ArrayList<LimitOrder>() : cachedOrderBook.getAsks());
  List<CoinfloorOrder> orders = rawRetObj.getOrders();
  if (orders != null) {
   for (CoinfloorOrder order : orders) {
    if (order.getBaseQty().doubleValue() > 0) {
     bidList.add(adaptOrder(order));
    } else {
     askList.add(adaptOrder(order));
    }
   }
  }
  orderbook = new OrderBook(null, askList, bidList);
  cachedOrderBook = orderbook;
 }
 resultMap.put("generic", orderbook);
 return resultMap;
}

代码示例来源:origin: sutra/huobi-client

if (depth.getAsks().size() >= 2) {
  BigDecimal ask0 = depth.getAsks().get(0).getLimitPrice();
  BigDecimal ask1 = depth.getAsks().get(1).getLimitPrice();
  if (ask0.compareTo(ask1) >= 0) {
    throw new RuntimeException("asks in depth should be ordered from lowest to highest.");

代码示例来源:origin: com.xeiam.xchange/xchange-coinfloor

List<LimitOrder> askList = (cachedOrderBook == null ? new ArrayList<LimitOrder>() : cachedOrderBook.getAsks());
if (rawRetObj.getBidId() != 0) {
 for (int i = 0; i < bidList.size(); i++) {

相关文章