Download MetaTrader 5

How to determine exact moment of market closure for the weekend - page 2

To add comments, please log in or register
Atsushi Yamanaka
5531
Atsushi Yamanaka  

I've also been looking for the solution for same problem and found this thread.

Then I tried;

if(OrderSend(_Symbol,OP_BUYSTOP,0.1,1000000,0,0,0,NULL,0,TimeLocal()+1,clrNONE)<0) //Not really order, but only for get error  132=ERR_MARKET_CLOSED in weekend.

            {

            if(GetLastError()==132) //ERR_MARKET_CLOSED

//......

     }

The price for OP_BUYSTOP, 1000000 is just impossible price for the _Symbol, and the expiration time is after 1 second.

What I was expecting in weekdays was the pending order made and the expiration time coming right after one second, then the order will be deleted. 

But the result was no order made in weekdays!? and got "right error" 132 in weekend.

Maybe it depends on the broker (I only tried couple of them include FxPro Demo) , I don't know why but it works without actual order traffic!

Mohamad Zulhairi Baba
5148
Mohamad Zulhairi Baba  
How about you try to verify (by coding) that say.. "the is incoming tick for the previous 60 seconds (or whatver period you prefer)" using bool function, true/false.
12
To add comments, please log in or register