com.xeiam.xchange.examples.anx.v2.trade.CancelOrderDemo 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.anx.v2.trade;
import java.io.IOException;
import com.xeiam.xchange.Exchange;
import com.xeiam.xchange.dto.trade.LimitOrder;
import com.xeiam.xchange.dto.trade.OpenOrders;
import com.xeiam.xchange.examples.anx.v2.ANXExamplesUtils;
import com.xeiam.xchange.service.polling.trade.PollingTradeService;
/**
* Test placing a limit order at ANX
*/
public class CancelOrderDemo {
public static void main(String[] args) throws IOException {
Exchange anx = ANXExamplesUtils.createExchange();
// Interested in the private trading functionality (authentication)
PollingTradeService tradeService = anx.getPollingTradeService();
boolean success = tradeService.cancelOrder("5aaef0f5-8c90-4a93-a097-0bad2dd475c5");
System.out.println("success= " + success);
// get open orders
OpenOrders openOrders = tradeService.getOpenOrders();
for (LimitOrder openOrder : openOrders.getOpenOrders()) {
System.out.println(openOrder.toString());
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy