I need someone to develop an order entry module to interface with the Interactive Brokers Trader Workstation software. There is an API available from IB ([url removed, login to view];ib_entity=llc). The module should have a simple GUI with boxes for entering the following parameters:
Enter symbol (following IB symbol list)
Enter buy or sell.
Enter order type (stop limit order type)
Enter stop price
Enter exit price - if this price is hit, send a market order to exit the trade.
Target 1 price: if this price is hit, send a market order to exit trade for half the original quantity.
Target 2 price: If this price is hit, send a market order to exit the remaining portion of the trade.
SUBMIT - to submit all specified orders to the IB application.
The flow is that upon submission, an order for the First trade is sent. If the first trade is executed, orders for the contingent trades should be sent. The exit trade will protect against loss. The Target trades will lock in profits. Orders and Quantities have to be adjusted for executions.
For example, if a First trade buys 100 shares, then an order for an exit trade (sell 100 shares) should be sent (this will be a stop market order with a stop at the specified price) and both target orders should be sent (limit orders at the specified prices). If the first target price is hit, 50 shares would be sold and the Exit trade should be adjusted to only 50 shares and the stop price should be moved to the First Trade price. If the second target is hit, the remaining 50 shares will be sold and the Exit Trade should be canceled.
If after the First Trade, the exit trade is executed first, then both target trades should be canceled.