Market On Open Orders

Why do you confine systems to either MKT or LMT orders? It would be nice for a system designer to be capable of placing MOO orders. Has this ever been given any consideration?


A system developer can place a market on open order by just placing a market order prior to the market open.

However, C2 still doesn’t allow market on close orders, stop limit orders, or trailing stop orders.



Thanks for the reply, but I have not found this to be necessarily true. In the past, several systems that I have followed have placed market orders approximately 5 minutes before the open and were accepted by Interactive Brokers. However, In many instances, I did not receive the opening price.

I would appreciate any information on how to obtain the opening price. I am unable to be near a computer during this time frame so must rely on autotrade to open and close positions. I use TradeBullet along with IB’s TWS to place these trades. Any suggestions?


Huck -

I’m not sure what instrument class you are talking about. But if you are talking about stocks, then a system developer can simply enter a market order BEFORE the market opens, and (for subscribers that are autotrading) the order will be submitted to the broker a few minutes before the market opens, and your order will be put in the hopper as one of the orders used by the exchange to calculate the opening cross price.

I’m not an expert about the intricacies of how the “opening cross” is calculated at the exchanges, so any C2 Members who have more accurate knowledge about this should certainly chime in.

As far as other instrument classes, for futures and forex, C2’s follows a similar algorithm: if a system vendor enteres a market order while the market is closed, the order will be submitted via autotrading at a few minutes before the market-open time. (But not too long before, as many brokers/exchanges will reject these orders that are submitted too early.)

And finally, C2 has a feature which allows system developers to pre-schedule a time of day to “release” an order into the marketplace. (In C2 lingo, these are “park-until” orders.) This theoretically allows a very rough approximation of Market-On-Close (MOC) orders. I say “rough approximation” because the park-until stuff is quite granular. There can be queueing and CPU/resource bottlenecks at times, which effectively mean you should expect that your park-until orders are released in the minute that they are scheduled for, but it is possible that they arrive quite deep into the minute, and sometimes later, so caveat emptor. (We’re working on this, though, and hope to make it much faster in the future.)

It’s best to see with system owner which type of orders he uses. If he said that Market-On-Open shoud be used, than it’s best to use a broker that has that type of order. Only with that order type you’ll get opening print.

You can also place normal market order when exchange opens but you’ll get a better or worse fill than the actual opening price.

In my system for example, if I send “Park until” 15:59 order - that means that subscriber should use MOC order if possible.



MKT orders that are entered prior to the auction time (9:28am) would participate in the auction only when routed directly to the exchange, so their actual behavior depends on the broker. For example, IB does not route them by default, one has to specify TIF=OPG to get MOO behavior ( see for example,

Could you add TIF=OPG to equity orders that are submitted prior to 9:28 and go out to IB?



MOC auction orders have to be submitted prior to 15:45. I don’t see how parking can replace/emulate that. MOC prices are sometimes very different from 15:59 prices

I send parked orders at 15:59 much before 15:45 so that user can setup MOC order.


Matthew, can you please make the API command “closeallpositions” available as a MOO order? When I issued it a day ago shortly after midnight, it failed. And while you’re at it, can you please have it return a signal ID so I can use it in conjunction with “conditionalupon”? (i.e. close out all my positions and then sequentially use the cash/buying power that is made available by those closings to open a new position)


Not sure I fully understand your post, Intj. Would not issuing a closeallpositions during the market closed period before the trading day act as the C2 approximation of MOO?

As far as true MOO orders go – that is, issuing orders to autotrading brokers whose API supports a special MOO switch so as to participate in the opening auction – that is something that would need to be handled on the autotrading-interface level, and would need to implemented on a broker-by-broker basis for those brokers that support this. What I envision there is transparently turning orders into MOO orders when they are issued before the market open, in cases where the broker supports it. But this is not necessarily trivial, and so needs to be considered carefully and tested.

Regarding your other request … I’m not sure it’s possible to return one signalID for a closeallpositions command. The closeallpositions instruction effectively issues many signals, one for each open position. Each might fail or succeed independently, so - under this data scheme - I’m not sure how a closeallpositions could map to single ID#, which you could make as the basis for a conditional order.

I think what you are looking for in your second request might be achievable through some high-hassle programming of the C2 API – i.e. just issuing closing signals independently, and extracting signal ids for each order, and then acting if your own criteria are met.

Alternately, it might be possible to request a list of signalIDs generated by the issuing of a closeallpositions command. Then you could poll for status on each of these IDs using the API and could act accordingly.

Does this seem sensible? Overall, I think we need to consider how to best implement what you are requesting. It’s not immediately obvious to me.


Regarding MOO and brokers: it’s relatively easy to implement, at least at IB - just need to set TIF to OPG. Could you implement that quickly? I’m sure a lot of subscribers would benefit from better execution quality at the open.

We do not support stock trading at IB via Gen3 AutoTrade, only via Gen1. So it would be up to the software developers who maintain C2 compatible autotrade software (such as Trader68 and TradeBullet) to program this.

We do support Gen3 AutoTrading at IB for futures. Is there an equivalent OPG tif for that instrument class, Val?

Not sure I fully understand your post, Intj. Would not issuing a closeallpositions during the market closed period before the trading day act as the C2 approximation of MOO?

I thought so too, but when I tried a closeallpositions at 12:49 AM on 7/24/12, I got the following email:

Dear INTJ Capital LLC:

Collective2 has generated the following message concerning the trading system: Cold Fusion Equity

Your request to AutoClose your position in TZA failed. Please check your system and make any manual adjustments that are necessary.


Please note that this is a software-generated piece of email.

Do not hit reply. No human will see your reply. If you have

any questions, please contact Collective2 technical support


I don’t know what it means that the AutoClose failed, as no technical details were provided, so I just assumed that closeallpositions is not allowed when the market is not open. If it is indeed allowed when the market is closed, can you please tell me why the signals kept failing? (I tried multiple times to make sure it wasn’t just a server hiccup)

As far as the rest of your question, your points are reasonable in that signal ids are probably necessary for all resulting signals from closeallpositions. But this is getting overly complicated for my needs: all I really need is “closeallpositions” to work outside of market hours, and then if a small modification to “parkuntil” could be made that would allow me to generically hold the order until the next market open (i.e. 9:30 AM ET, without specifying the date and time in Unix epoch time or whatever it is), that would solve all of my problems. Those two changes would effectively allow me to roll over the entire portfolio at the open fairly seamlessly, assuming that closeallpositions executes first and the parked trade signal executes second.

What do you think, is that feasible?

Futures and FX don’t have open/close auctions, so this is only an issue for equities


What Gen3 auto trading brokerages that you have software control development over have the equivalent OPG tif for stock trading?

Thanks, Huck