marwood
February 14, 2018, 1:36am
1
Apologies if this has been covered but couldn't find the answer anywhere.
Is it possible to send MOO OPG orders via IB controller? As explained here:
https://www.interactivebrokers.com/en/index.php?f=598
I tried below with no luck:
orderID = ibc.PlaceOrder( symbol, "Sell", pos, "MKT", 0, 0, "OPG", True );
Basically, I want to get the opening print. With manual trading I always use OPG as time in force.
If not possible, maybe MKT or LMT is better, any advice?
Thanks
mrobot
November 2, 2019, 5:38pm
2
Did you make any progress with this? I'm looking to do the same thing...
Thanks!
Ector
November 5, 2019, 8:41am
3
I can say that OPG and MOC orders definitely worked a few years ago through IBController. As for now it’s better to ask someone who is currently using it in 2019
mrobot
November 5, 2019, 10:27am
4
Thank you! I'll try using OPG/MOC
Ector
November 5, 2019, 7:39pm
5
@mrobot I have found the code and this constructions worked for me in the past. Maybe this would be useful for your IB trading implementation.
Must admit that I am total newbie in AFL, so this code is better be checked by more experienced users
Market-On-Open orders structure:
orderID = ibc.PlaceOrder( "AAPL", "SELL", 100, "MKT", 0, 0, "OPG", True );
Market-On-Close orders structure:
orderID = ibc.PlaceOrder( "AAPL", "BUY", 100, "MOC", 0, 0, "DAY", True );