did you try :
MqlDateTime m; TimeLocal(m); if (m.day_of_week>=2 && m.day_of_week<=4 && m.hour>=6 && m.hour<=11) { //...codes... }
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello,
I am new to MQL5 programming. Please advice me to program a EA to trade in a specific time period .
If i want run following code from Tuesday to thursday only from 6.00 am to 11.00 am please advice me to follow up.
void OnTick()
{
if (PositionsTotal()<1))
printf("Working properly");
}