Send order at specific time when market is not open

 
Hi,

Need help to code with time. I want to place orders before market opens. Since there are no ticks I don not get the EA to trigger on time.
The specific case is to make the EA  send stop entry order at server time 06:30:00.000

I tried to search the forum but maybe I am not using the right keywords to find it.
Thank you in advance.
 
FX-Krilon:
Hi,

Need help to code with time. I want to place orders before market opens. Since there are no ticks I don not get the EA to trigger on time.
The specific case is to make the EA  send stop entry order at server time 06:30:00.000

I tried to search the forum but maybe I am not using the right keywords to find it.
Thank you in advance.
You can not do that
 
Mladen Rakic:
You can not do that
Aha,

So I have to wait for the first tick when the markets open to send the order.

What will be the implications for example if the order is a buy-stop and the first tick is opened higher, will it still be executed?
 

A buy-stop order is an order to buy a security which is entered at a price above the current offering price, and it is triggered when the market price touches or goes through the buy-stop price.

What do you think ?

Also you can send orders but you will simple get an error (Market Closed)

For example MQL5

10018

TRADE_RETCODE_MARKET_CLOSED

Market is closed


And MQL4

132

ERR_MARKET_CLOSED

Market is closed

 
FX-Krilon: What will be the implications for example if the order is a buy-stop and the first tick is opened higher, will it still be executed?
Only if the price is above the Ask by at least MODE_STOPLEVEL points. Requirements and Limitations in Making Trades - Appendixes - MQL4 Tutorial
 
FX-Krilon:
Aha,

So I have to wait for the first tick when the markets open to send the order.

...
Or you can place a pending order(s) before the market closes. But somehow I am guessing that it is not what you had in mind ...
 
No not the pending order before market close, but thank you for the suggestion.

I will try to figure a way around it.

Thx
Reason: