Market on Open (MOO) and Market on Close (MOC) orders in MT5 Expert Advisors (EAs)

 

Hi, there!

Anyone knows how I can set up my MT5 EA orders to Market on Open (MOO) and/or Market on Close (MOC)?

My goal is to day-trade stocks in the largest US exchanges, getting their open and close prices.

I haven't seen MOO and MOC options anywhere.

Digging the MT5 documentation, I only found "FOK", "IOC", and "RETURN" as options under TYPE_FILLING.

Or "GTC", "DAY", "SPECIFIED", and "SPECIFIED_DAY" as options under TYPE_TIME.

Any suggestions on how I could make this work? 

Thanks a lot! Stay safe!

Caio

 
caiomattoso :

Hi, there!

Anyone knows how I can set up my MT5 EA orders to Market on Open (MOO) and/or Market on Close (MOC)?

My goal is to day-trade stocks  in the largest US exchanges, getting their open and close prices .

I haven't seen MOO and MOC options anywhere.

Digging the MT5 documentation, I only found "FOK", "IOC", and "RETURN" as options  under TYPE_FILLING.

Or "GTC", "DAY", "SPECIFIED", and "SPECIFIED_DAY" as options under TYPE_TIME.

Any suggestions on how I could make this work? 

Thanks a lot! Stay safe!

Caio

As far as I understand, you should write your own robot, which will open a market position at the beginning of the day and at the last minute of the day.

 
Vladimir Karputov:

As far as I understand, you should write your own robot, which will open a market position at the beginning of the day and at the last minute of the day.

Hey, Vladmir. I only saw your reply now. Thanks, my friend. What you said does make sense. I was just wondering whether there was a preset order filling type that would do the magic automatically. Anyways, it's not going to be a big deal to write the code to set it up manually. Once again, thanks for taking the time to reply. 
Reason: