Jusyer:
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
Jusyer:
I've used it and does not work
What does that mean ? Show your code, and some logs to demonstrate your issue.
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[]
Jusyer:
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.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Hi.
Code repeat several times. Why predefined variables not update inside "while"?
Thanks.