I have been trying to get a midprice order type written. The IB docs (https://interactivebrokers.github.io/tws-api/ibalgos.html) suggest that the limit price is Optional:
Order order = new Order();
order.Action = action;
order.OrderType = "MIDPRICE";
order.TotalQuantity = quantity;
///order.LmtPrice = priceCap; OPTIONAL according to IB doc.
client.placeOrder(nextOrderId++, ContractSamples.USStockAtSmart(), OrderSamples.Midprice("BUY", 1, 150));
However when I submit the order via the TWS connection, the order appears in the pending orders panel but the LMT Price field in the order entry panel shows <ERROR>. Can someone who has used a midprice order type confirm what should be entered in the limit price field to emulate the setting "NONE" ?
Order order = new Order();
order.Action = action;
order.OrderType = "MIDPRICE";
order.TotalQuantity = quantity;
///order.LmtPrice = priceCap; OPTIONAL according to IB doc.
client.placeOrder(nextOrderId++, ContractSamples.USStockAtSmart(), OrderSamples.Midprice("BUY", 1, 150));
However when I submit the order via the TWS connection, the order appears in the pending orders panel but the LMT Price field in the order entry panel shows <ERROR>. Can someone who has used a midprice order type confirm what should be entered in the limit price field to emulate the setting "NONE" ?