The check of "TimeHour(OrderOpenTime())<=hour_end)" allows trading until the end of hour_end (e.g. 18:59, not 18:00). Similarly, Roger's suggestion trades up until 06:59 (am, not pm).
Yes, that was my fault, I messed am and pm. But it's really till 6:00 not 6:59.
After some more research I have found a very simple solution to reproduce what I was looking for:
if(OrdersTotal()<=0){if(Hour()>=10&&Hour()<=13){OrderSelect(OrdersHistoryTotal()-1,SELECT_BY_POS,MODE_HISTORY);Print(OrderCloseTime());if(OrderCloseTime()<(TimeCurrent()-10*Period()*30)){
Trade conditions here
}}}
This does effectively make the system trade only once during the interval I have selected, the sleep time being selecting with "10*Period()*30"
Thx and again and regards,
Inquisiteur
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
The check of "TimeHour(OrderOpenTime())<=hour_end)" allows trading until the end of hour_end (e.g. 18:59, not 18:00). Similarly, Roger's suggestion trades up until 06:59 (am, not pm).
Yes, that was my fault, I messed am and pm. But it's really till 6:00 not 6:59.
Just to say thx again, worked out for me.
After some more research I have found a very simple solution to reproduce what I was looking for: