I have been trying to get working what you have suggested in this post and have not been successful.
It looks like the StopPrice is defaulting to 0.01 on REL orders (and I believe for Pegged Market Orders as well), even though a PlaceOrder call is being sent with a value other than 0.01. This becomes extremely important with the SEC TickSize Pilot program and stocks that trade in 5 cent increments as all REL orders are being rejected on these symbols according to IB “rules” (link).
I’m attaching a couple of screenshots from IBController as well as the Amibroker TRACE window. I am getting the OrderID value back from the PlaceOrder call without an error and printing out the value in the TRACE window. However, if you match up the OID in the Trace window with the OID in the IBController, you can see that the values for StopPrice are different.
Below is a code snippet for the logic I am using to send the REL order:
current_time = Now(4);
TimeInForceString = TimeInForce(current_time,0,4,0);
Ask = GetRTData("Ask");
offset = 0.05; // actual offset logic omitted but something other than 0.01 will do for testing
limit_price = Ask + offset;
stop_price = offset;
oid = ibc.PlaceOrder(symbol, "BUY", quantity, "REL", limit_price, stop_price, TimeInForceString, True );
_TRACE("ORDER ID: " + oid + ", Symbol: " + symbol + ", Quantity: " + quantity + ", Limit: " + limit_price + ", Stop: " + stop_price);
Please let me know if you see anything I am doing here which is incorrect.