# Market On Open Orders

**URL:** <https://forums.collective2.com/t/market-on-open-orders/5337>\
**Category:** C2\
**Created:** [July 23, 2012, 6:51pm UTC](https://forums.collective2.com/t/market-on-open-orders/5337 "2012-07-23T18:51:04Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![HuckWilliams2](https://yyz2.discourse-cdn.com/flex028/user_avatar/forums.collective2.com/huckwilliams2/32/238_2.png) [@HuckWilliams2](https://forums.collective2.com/u/HuckWilliams2)\
**Post date:** [July 23, 2012, 6:51pm UTC](https://forums.collective2.com/t/market-on-open-orders/5337/1 "2012-07-23T18:51:04Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![ETFCAPITALBUILDER](https://yyz2.discourse-cdn.com/flex028/user_avatar/forums.collective2.com/etfcapitalbuilder/32/238_2.png) [@ETFCAPITALBUILDER](https://forums.collective2.com/u/ETFCAPITALBUILDER)\
**Post date:** [July 23, 2012, 8:24pm UTC](https://forums.collective2.com/t/market-on-open-orders/5337/2 "2012-07-23T20:24:33Z")

</div>

Huck,  
  
  
  
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.  
  
  
  
Jim

---

<div class="post-metadata">

**Author:** ![HuckWilliams2](https://yyz2.discourse-cdn.com/flex028/user_avatar/forums.collective2.com/huckwilliams2/32/238_2.png) [@HuckWilliams2](https://forums.collective2.com/u/HuckWilliams2)\
**Post date:** [July 23, 2012, 9:29pm UTC](https://forums.collective2.com/t/market-on-open-orders/5337/3 "2012-07-23T21:29:10Z")

</div>

Jim,  
  
  
  
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

---

<div class="post-metadata">

**Author:** ![MatthewKlein](https://yyz2.discourse-cdn.com/flex028/user_avatar/forums.collective2.com/matthewklein/32/21382_2.png) [@MatthewKlein](https://forums.collective2.com/u/MatthewKlein)\
**Post date:** [July 24, 2012, 9:29am UTC](https://forums.collective2.com/t/market-on-open-orders/5337/4 "2012-07-24T09:29:14Z")

</div>

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.)

---

<div class="post-metadata">

**Author:** ![DuanKovaevi](https://yyz2.discourse-cdn.com/flex028/user_avatar/forums.collective2.com/duankovaevi/32/238_2.png) [@DuanKovaevi](https://forums.collective2.com/u/DuanKovaevi)\
**Post date:** [July 24, 2012, 4:00pm UTC](https://forums.collective2.com/t/market-on-open-orders/5337/5 "2012-07-24T16:00:56Z")

</div>

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.  
  
  
  
[LINKSYSTEM\_61470460]

---

<div class="post-metadata">

**Author:** ![ValZ](https://yyz2.discourse-cdn.com/flex028/user_avatar/forums.collective2.com/valz/32/1487_2.png) [@ValZ](https://forums.collective2.com/u/ValZ)\
**Post date:** [July 25, 2012, 12:08am UTC](https://forums.collective2.com/t/market-on-open-orders/5337/6 "2012-07-25T00:08:44Z")

</div>

Matthew,  
  
  
  
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 [http://www.elitetrader.com/vb/showthread.php?threadid=65114](http://www.elitetrader.com/vb/showthread.php?threadid=65114), [http://www.interactivebrokers.com/en/trading/orders/moo.php](http://www.interactivebrokers.com/en/trading/orders/moo.php))  
  
  
  
Could you add TIF=OPG to equity orders that are submitted prior to 9:28 and go out to IB?  
  
  
  
Thanks,  
  
Val

---

<div class="post-metadata">

**Author:** ![ValZ](https://yyz2.discourse-cdn.com/flex028/user_avatar/forums.collective2.com/valz/32/1487_2.png) [@ValZ](https://forums.collective2.com/u/ValZ)\
**Post date:** [July 25, 2012, 12:11am UTC](https://forums.collective2.com/t/market-on-open-orders/5337/7 "2012-07-25T00:11:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![DuanKovaevi](https://yyz2.discourse-cdn.com/flex028/user_avatar/forums.collective2.com/duankovaevi/32/238_2.png) [@DuanKovaevi](https://forums.collective2.com/u/DuanKovaevi)\
**Post date:** [July 25, 2012, 1:35am UTC](https://forums.collective2.com/t/market-on-open-orders/5337/8 "2012-07-25T01:35:57Z")

</div>

I send parked orders at 15:59 much before 15:45 so that user can setup MOC order.  
  
  
  
[LINKSYSTEM\_61470460]

---

<div class="post-metadata">

**Author:** ![INTJCapitalLLC](https://yyz2.discourse-cdn.com/flex028/user_avatar/forums.collective2.com/intjcapitalllc/32/51_2.png) [@INTJCapitalLLC](https://forums.collective2.com/u/INTJCapitalLLC)\
**Post date:** [July 25, 2012, 11:42am UTC](https://forums.collective2.com/t/market-on-open-orders/5337/9 "2012-07-25T11:42:52Z")

</div>

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)  
  
  
  
Thanks.

---

<div class="post-metadata">

**Author:** ![MatthewKlein](https://yyz2.discourse-cdn.com/flex028/user_avatar/forums.collective2.com/matthewklein/32/21382_2.png) [@MatthewKlein](https://forums.collective2.com/u/MatthewKlein)\
**Post date:** [July 25, 2012, 12:09pm UTC](https://forums.collective2.com/t/market-on-open-orders/5337/10 "2012-07-25T12:09:16Z")

</div>

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.  
  
  
  
Matthew

---

<div class="post-metadata">

**Author:** ![ValZ](https://yyz2.discourse-cdn.com/flex028/user_avatar/forums.collective2.com/valz/32/1487_2.png) [@ValZ](https://forums.collective2.com/u/ValZ)\
**Post date:** [July 25, 2012, 12:24pm UTC](https://forums.collective2.com/t/market-on-open-orders/5337/11 "2012-07-25T12:24:52Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![MatthewKlein](https://yyz2.discourse-cdn.com/flex028/user_avatar/forums.collective2.com/matthewklein/32/21382_2.png) [@MatthewKlein](https://forums.collective2.com/u/MatthewKlein)\
**Post date:** [July 25, 2012, 12:28pm UTC](https://forums.collective2.com/t/market-on-open-orders/5337/12 "2012-07-25T12:28:56Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![INTJCapitalLLC](https://yyz2.discourse-cdn.com/flex028/user_avatar/forums.collective2.com/intjcapitalllc/32/51_2.png) [@INTJCapitalLLC](https://forums.collective2.com/u/INTJCapitalLLC)\
**Post date:** [July 25, 2012, 12:31pm UTC](https://forums.collective2.com/t/market-on-open-orders/5337/13 "2012-07-25T12:31:42Z")

</div>

_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_  
   
_([info@collective2.com](mailto:info@collective2.com))_  
  
  
  
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?

---

<div class="post-metadata">

**Author:** ![ValZ](https://yyz2.discourse-cdn.com/flex028/user_avatar/forums.collective2.com/valz/32/1487_2.png) [@ValZ](https://forums.collective2.com/u/ValZ)\
**Post date:** [July 25, 2012, 12:38pm UTC](https://forums.collective2.com/t/market-on-open-orders/5337/14 "2012-07-25T12:38:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![HuckWilliams2](https://yyz2.discourse-cdn.com/flex028/user_avatar/forums.collective2.com/huckwilliams2/32/238_2.png) [@HuckWilliams2](https://forums.collective2.com/u/HuckWilliams2)\
**Post date:** [August 9, 2012, 8:11pm UTC](https://forums.collective2.com/t/market-on-open-orders/5337/15 "2012-08-09T20:11:02Z")

</div>

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