if (liHour == EndHour + GMToffset && newBar)
more conditions here
then open a buy or sell
Return(0);
}
Does the above IF condition with AND clause work ? It worked on backtesting.. but on live demo it didn't. I wanted the control to go into the loop only once in a day
exactly at 7 AM (USA PST) time and when the new bar is opened.
If I remove " && newBar" clause, the control goes into the loop until time turns to 8 AM. I don't want that..
Any ideas.. does time change and new bar does not happen at the same time ?
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.
static datetime Time0;
int start()
{
bool newBar;
newBar = Time[0] > Time0;
if (newBar) Time0 = Time[0];
if (liHour == EndHour + GMToffset && newBar)
more conditions here
then open a buy or sell
Return(0);
}
Does the above IF condition with AND clause work ? It worked on backtesting.. but on live demo it didn't. I wanted the control to go into the loop only once in a day
exactly at 7 AM (USA PST) time and when the new bar is opened.
If I remove " && newBar" clause, the control goes into the loop until time turns to 8 AM. I don't want that..
Any ideas.. does time change and new bar does not happen at the same time ?