Skip to content

Instantly share code, notes, and snippets.

@rterp
Created Mar 4, 2016
Embed
What would you like to do?
public void placeCurrencyOrder() {
InteractiveBrokersClientInterface ibClient = InteractiveBrokersClient.getInstance("localhost", 7999, 1);
ibClient.connect();
CurrencyTicker eurTicker = new CurrencyTicker();
eurTicker.setSymbol("EUR");
eurTicker.setCurrency("USD");
eurTicker.setExchange(Exchange.IDEALPRO);
String orderId = ibClient.getNextOrderId();
int amount = 50000;
TradeOrder order = new TradeOrder(orderId, eurTicker, amount, TradeDirection.BUY);
ibClient.placeOrder(order);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment