hi,
does anyone know how to enter trade at specific time? Thanks in advance.
Hi thezen,
I think there's plenty of that in the forum if you willing to search. This code below is just an example
input int Open_Hour=3; input int Open_Minute=7; input bool Use_Broker_Time = false; //+------------------------------------------------------------------+ //| program start function | //+------------------------------------------------------------------+ void OnStart() { datetime open_time; MqlDateTime struc_time; if (Use_Broker_Time == true) open_time = TimeCurrent(); else open_time = TimeLocal(); TimeToStruct(open_time,struc_time); if (struc_time.hour >= Open_Hour && struc_time.min >= Open_Minute) { // open business here } }
Hi thezen,
I think there's plenty of that in the forum if you willing to search. This code below is just an example
of course you can but i think you should also restrict the time from the upside
Hi thezen,
I don't understand your question there ("how could I open a position within the bracket? "), of course you could. However if you meant some open position code, there's a lot example around.
Like this script to open buy and to open sell (click that) and my previous code https://www.mql5.com/en/forum/6666#comment_192901 please read the entire thread starting from there.
And you should set the upper time like onlysolo suggest.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
hi,
does anyone know how to enter trade at specific time? Thanks in advance.