com.xeiam.xchange.examples.clevercoin.trade.CleverCoinUserTradeHistoryDemo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xchange-examples Show documentation
Show all versions of xchange-examples Show documentation
Provides a set of examples that demonstrate how to use XChange in client applications
The newest version!
package com.xeiam.xchange.examples.clevercoin.trade;
import java.io.IOException;
import com.xeiam.xchange.Exchange;
import com.xeiam.xchange.clevercoin.dto.trade.CleverCoinUserTransaction;
import com.xeiam.xchange.clevercoin.service.polling.CleverCoinTradeServiceRaw;
import com.xeiam.xchange.dto.marketdata.Trades;
import com.xeiam.xchange.examples.clevercoin.CleverCoinDemoUtils;
import com.xeiam.xchange.service.polling.trade.PollingTradeService;
/**
*
* Example showing the following:
*
*
* - Connect to CleverCoin exchange with authentication
* - get user trade history
*
*/
public class CleverCoinUserTradeHistoryDemo {
public static void main(String[] args) throws IOException {
Exchange cleverCoin = CleverCoinDemoUtils.createExchange();
PollingTradeService tradeService = cleverCoin.getPollingTradeService();
generic(tradeService);
raw((CleverCoinTradeServiceRaw) tradeService);
}
private static void generic(PollingTradeService tradeService) throws IOException {
Trades trades = tradeService.getTradeHistory(150);
System.out.println(trades);
// Warning: using a limit here can be misleading. The underlying call
// retrieves trades, withdrawals, and deposits. So the example here will
// limit the result to 17 of those types and from those 17 only trades are
// returned. It is recommended to use the raw service demonstrated below
// if you want to use this feature.
//Trades tradesLimitedTo17 = tradeService.getTradeHistory();
//System.out.println(tradesLimitedTo17);
}
private static void raw(CleverCoinTradeServiceRaw tradeService) throws IOException {
CleverCoinUserTransaction[] trades = tradeService.getCleverCoinUserTransactions(200);
for (CleverCoinUserTransaction trade : trades) {
System.out.println(trade);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy