Simulate MOO (Market on Open) / OPG Market Order

Questions about MultiCharts and user contributed studies.
Platinum
Posts: 8
Joined: 14 May 2020

Simulate MOO (Market on Open) / OPG Market Order

Postby Platinum » 14 May 2020

Hello everyone,

My automated trading strategy (IB is my broker) needs to place orders at market opening so that the order fills when the main trading session starts.
At Interactive Brokers it is called market OPG order.

I know that this type of order is not supported (really useful feature BTW) but may be there is a possibility to release such order type using PowerLanguage/EasyLanguage?
May be somebody tried to code it already?
The main advantage of such an order type is that you get your order filled at the price which is exact trading session start price... Which is great for trading strategies on Daily charts.

Thank you!

wilkinsw
Posts: 662
Joined: 21 Apr 2013
Has thanked: 154 times
Been thanked: 104 times

Re: Simulate MOO (Market on Open) / OPG Market Order

Postby wilkinsw » 14 May 2020

Complicated.

If assuming you have to have orders submitted pre-open (the only way to achieve a fill at the opening price as you describe) and assuming that simply having a GTC order working from a previous session is not what you want, then:

You will need intrabarordergeneration enabled and use AllowSendOrdersAlways. Also use recalclastbarafter.

That then opens up the possibility to finely define exactly when to send orders. You can then use computer time to trigger script calc and send maximally aggressive limit orders 10 mins before the scheduled open.

That is a lot of work if you're not experienced.

I would opt to instead detect the session last bar using sessionlastbar keyword to trigger script calc the moment the first tick of the new session arrives.

Code: Select all

if sessionlastbar=true then buy next bar at market;
It certainly won't guarantee a fill at the open, but is easier.

If you're using daily bars then you don't even need to do that. Simply:

Code: Select all

if buy_condition=true buy next bar at market;

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Simulate MOO (Market on Open) / OPG Market Order

Postby TJ » 14 May 2020

A workaround:

Set the session time one bar early.

wilkinsw
Posts: 662
Joined: 21 Apr 2013
Has thanked: 154 times
Been thanked: 104 times

Re: Simulate MOO (Market on Open) / OPG Market Order

Postby wilkinsw » 14 May 2020

Can you expand on that TJ? Sounds fascinating but can’t picture it.

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Simulate MOO (Market on Open) / OPG Market Order

Postby TJ » 14 May 2020

eg.

if you are using a 5 min chart, and the instrument opens at 9:30 am
You can set the session time to start at 9:25 am,
then your strategy can buy/sell market at next bar.

Platinum
Posts: 8
Joined: 14 May 2020

Re: Simulate MOO (Market on Open) / OPG Market Order

Postby Platinum » 15 May 2020

Thank you TJ. I think it is the most simplest way to simulate such type of orders.
I will definitely try it.

However I doubt that the price I'll get in real market will exactly match "the first printed price". It may work on high-liquidity instruments with no guarantee of course.
Just for information: the exchanges gather such types of orders (MOO orders) and at 9:28 a.m. - 09:30 a.m. market-making sellers gauge how many orders are waiting for execution at the open, and what the nature of those orders might be (large or small, buy or sell, Limit, Stop or Market). They adjust their bids and offers based on this information and the first trade of the session will establish the opening price.

Dear TJ!
Is there any chance to include such type of order into To-Do list for the next software builds at least for automated trading?
I see that it could be easily released using TWS API: http://interactivebrokers.github.io/tws ... rders.html - Market On Open
I'm sure it is also available at other brokers' APIs as it is one of the popular order types for trading on Daily charts.

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Simulate MOO (Market on Open) / OPG Market Order

Postby TJ » 15 May 2020

. . .

Dear TJ!
Is there any chance to include such type of order into To-Do list for the next software builds at least for automated trading?
I see that it could be easily released using TWS API: http://interactivebrokers.github.io/tws ... rders.html - Market On Open
I'm sure it is also available at other brokers' APIs as it is one of the popular order types for trading on Daily charts.
I am not MultiCharts. I do not call the shots.

You can make a feature request here:
https://www.multicharts.com/pm/public/multicharts

Platinum
Posts: 8
Joined: 14 May 2020

Re: Simulate MOO (Market on Open) / OPG Market Order

Postby Platinum » 15 May 2020

Anyway thank you, TJ, for your help.

I found an old feature request for this type of order. It is really must-have feature for those who trade using Daily charts.

Here you can vote for it: https://www.multicharts.com/pm/public/m ... es/MC-1754


Return to “MultiCharts”