Update predefined variables inside "while"
Hi.
Code repeat several times. Why predefined variables not update inside "while"?
Thanks.
You probably have to use RefreshRates()
I've used it and does not work
if ((Open[1]>Close[1]) && (RefreshRates()) && (hour ==TimeHour(TimeLocal())-1))
By including it in the condition its value is true, but not update Open[] and Close[]
With the new mql4, if the condition Open[1]>Close[1] is false, the RefreshRates will never be executed. Don't include RefreshRates() in an if condition.
See this topic MetaTrader 4 Build 600 with Updated MQL4 Language and Market of Applications Released :
Shortened conditions check is now used in logical operations, unlike the old MQL4 version where all expressions have been calculated and the check has been performed afterwards. Suppose there is a check of two conditions with the use of logical AND
if(condition1 && condition2) { // some block of operations }If condition1 expression is false, calculation of condition2 expression is not performed, as false && true result is still equal to false.
Hi.
Code repeat several times. Why predefined variables not update inside "while"?
Thanks.