Skip to content

Instantly share code, notes, and snippets.

@rterp
Last active March 4, 2016 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rterp/fece275608833d15d23d to your computer and use it in GitHub Desktop.
Save rterp/fece275608833d15d23d to your computer and use it in GitHub Desktop.
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