Skip to content

Instantly share code, notes, and snippets.

@rterp
Last active March 4, 2016 14:15
Embed
What would you like to do?
public void placeEquityOrder() {
InteractiveBrokersClientInterface ibClient = InteractiveBrokersClient.getInstance("localhost", 7999, 1);
ibClient.connect();
StockTicker amazonTicker = new StockTicker("AMZN");
String orderId = ibClient.getNextOrderId();
int shares = 500;
TradeOrder order = new TradeOrder(orderId, amazonTicker, shares, TradeDirection.SELL);
ibClient.placeOrder(order);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment