}
private static void raw(Exchange okcoinExchange) throws IOException {
// Interested in the public polling market data feed (no authentication)
OkCoinMarketDataServiceRaw okCoinMarketDataServiceRaw = (OkCoinMarketDataServiceRaw) okcoinExchange.getPollingMarketDataService();
// Get the latest trade data for BTC_USD
OkCoinTrade[] trades = okCoinMarketDataServiceRaw.getTrades(CurrencyPair.BTC_CNY);
System.out.println("Trades size: " + trades.length);
System.out.println("newest trade: " + trades[trades.length - 1].toString());
// Poll for any new trades since last id
trades = okCoinMarketDataServiceRaw.getTrades(CurrencyPair.BTC_CNY, trades[trades.length - 1].getTid() - 10);
for (int i = 0; i < trades.length; i++) {
OkCoinTrade okCoinTrade = trades[i];
System.out.println(okCoinTrade.toString());
}
System.out.println("Trades size: " + trades.length);