Send MOO OPG orders using IB controller

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:

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?


Did you make any progress with this? I'm looking to do the same thing...


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

Thank you! I'll try using OPG/MOC

@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 );