Package com.xeiam.xchange.dto.marketdata

Examples of com.xeiam.xchange.dto.marketdata.Trades


    PollingTradeService tradeService = exchange.getPollingTradeService();

    OpenOrders openOrders = tradeService.getOpenOrders();
    System.out.println("Open orders: " + openOrders);

    Trades trades = tradeService.getTradeHistory();
    System.out.println("Trades: " + trades);
  }
View Full Code Here


    // Interested in the public polling market data feed (no authentication).
    PollingMarketDataService marketDataService = exchange.getPollingMarketDataService();

    // Get the latest 500 trade data for BTC/CNY.
    Trades trades = marketDataService.getTrades(CurrencyPair.BTC_CNY);
    System.out.println(trades);
    System.out.println("Trades count: " + trades.getTrades().size() + ", LastID: " + trades.getlastID());

    // Get 500 trades which tid > 0
    trades = marketDataService.getTrades(CurrencyPair.BTC_CNY, 0);
    System.out.println(trades);
    System.out.println("Trades count: " + trades.getTrades().size() + ", LastID: " + trades.getlastID());
  }
View Full Code Here

  }

  public static void generic() throws IOException {

    // Get the latest trade data for BTC/CNY
    Trades trades = marketDataService.getTrades(CurrencyPair.BTC_CAD);

    System.out.println(trades.toString());
    System.out.println("NumTrades=" + trades.getTrades().size());
    System.out.println("lastID=" + trades.getlastID());

    // Get the latest trade data for BTC/CNY
    trades = marketDataService.getTrades(CurrencyPair.BTC_CAD, 100, 350105);

    System.out.println(trades.toString());
    System.out.println("NumTrades=" + trades.getTrades().size());

  }
View Full Code Here

      long tradeId = trade.getTid();
      if (tradeId > lastTradeId)
        lastTradeId = tradeId;
      tradesList.add(adaptTrade(trade, currencyPair));
    }
    return new Trades(tradesList, lastTradeId, TradeSortType.SortByID);
  }
View Full Code Here

  }

  private static void generic(PollingMarketDataService marketDataService) throws IOException {

    // Get the latest trade data for BTC/USD
    Trades trades = marketDataService.getTrades(CurrencyPair.BTC_USD);
    System.out.println("Trades, Size= " + trades.getTrades().size());
    System.out.println(trades.toString());
  }
View Full Code Here

      long tradeId = bitcurexTrade.getTid();
      if (tradeId > lastTradeId)
        lastTradeId = tradeId;
      tradesList.add(adaptTrade(bitcurexTrade, currencyPair));
    }
    return new Trades(tradesList, lastTradeId, TradeSortType.SortByID);
  }
View Full Code Here

      long tradeId = Long.valueOf(trade.getId());
      if (tradeId > lastTradeId)
        lastTradeId = tradeId;
      tradesList.add(adaptTrade(trade, currencyPair));
    }
    return new Trades(tradesList, lastTradeId, TradeSortType.SortByID);
  }
View Full Code Here

    List<Trade> trades = new ArrayList<Trade>(length);
    for (BTCTradeTrade btcTradeTrade : btcTradeTrades) {
      trades.add(adaptTrade(btcTradeTrade, currencyPair));
    }
    long lastID = length > 0 ? btcTradeTrades[length - 1].getTid() : 0L;
    return new Trades(trades, lastID, TradeSortType.SortByID);
  }
View Full Code Here

      long tradeId = trade.getTradeId();
      if (tradeId > lastTradeId)
        lastTradeId = tradeId;
      tradesList.add(adaptTrade(trade, currencyPair));
    }
    return new Trades(tradesList, lastTradeId, TradeSortType.SortByID);
  }
View Full Code Here

          if (tradeId > lastTradeId)
            lastTradeId = tradeId;
          tradesList.add(adaptTrade(trade, currencyPair));
        }
      }
      trades.put(currencyPair, new Trades(tradesList, lastTradeId, TradeSortType.SortByID));
    }

    return trades;
  }
View Full Code Here

TOP

Related Classes of com.xeiam.xchange.dto.marketdata.Trades

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.