com.xeiam.xchange.examples.kraken.trade.KrakenTradeHistoryDemo 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.kraken.trade;
import java.io.IOException;
import java.util.Map;
import com.xeiam.xchange.Exchange;
import com.xeiam.xchange.dto.marketdata.Trades;
import com.xeiam.xchange.examples.kraken.KrakenExampleUtils;
import com.xeiam.xchange.kraken.dto.trade.KrakenTrade;
import com.xeiam.xchange.kraken.service.polling.KrakenTradeServiceRaw;
import com.xeiam.xchange.service.polling.trade.PollingTradeService;
public class KrakenTradeHistoryDemo {
public static void main(String[] args) throws IOException {
Exchange krakenExchange = KrakenExampleUtils.createTestExchange();
generic(krakenExchange);
raw(krakenExchange);
}
private static void generic(Exchange krakenExchange) throws IOException {
// Interested in the private trading functionality (authentication)
PollingTradeService tradeService = krakenExchange.getPollingTradeService();
// Get the trade history
Trades trades = tradeService.getTradeHistory();
System.out.println(trades.toString());
}
private static void raw(Exchange krakenExchange) throws IOException {
// Interested in the private trading functionality (authentication)
KrakenTradeServiceRaw tradeService = (KrakenTradeServiceRaw) krakenExchange.getPollingTradeService();
// Get the trade history
Map trades = tradeService.getKrakenTradeHistory();
System.out.println(trades);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy