Is this possible to place order in given time included seconds?

Back to topics list To post a new topic, please log in or register
avatar
273
sheriffonline 2015.05.26 07:53
 

eg:

i want to place order in 10:00:15

i tried coding for given minutes, but how to make order in exact seconds too?

{
    int datetime = TimeCurrent();
    int hour = TimeHour(datetime);
    int minute = TimeMinute(datetime);
    if (DayOfWeek() != Today && hour == 10 && minute == 0)
    {
        Today = DayOfWeek();
            
    }
avatar
65
2cent 2015.05.26 09:56 #
 

You'd need to set up a timer ( OnTimer() ), so that it 'ticks' every second.

Therein you'd use i.e TimeLocal() with MqlDateTime type parameter. The MqlDateTime structure is then filled accordingly and you can read out day, minute, second etc.

 

 

 

avatar
313
JD4 2015.06.25 03:51 #
 
One possible issue I see with this, and I do not see a solution is placing the order on your end is no guarantee that the broker can fill the order right at that time to the second.
Back to topics list  

To add comments, please log in or register