I just don't have the patience to answer such questions.
RefreshRates
Осуществляет обновление данных в предопределенных переменных и массивах-таймсериях.
And what are predefined variables and time series arrays can be found in the documentation.
- docs.mql4.com
I just don't have the patience to answer such questions.
And you can read about predefined variables and time series arrays in the documentation.
I.e. the data of the iClose() function are not affected by RefreshRates() in any way. Then how can we make theiClose() function output updated information?
Zero. An arbitrary timeframe.
Honestly, I'm surprised... and that's putting it mildly. I thought iClose() gets values from broker's server, but no... RefreshRates(); updates values obtained by iClose()
/********************Script program start function*******************/ void OnStart() { for(int i = 0; i < 10; i++) { Print(Bid, " *** ", iClose(_Symbol, PERIOD_CURRENT, 0)); Sleep(1000); RefreshRates();// Без RefreshRates(); значения iClose(_Symbol, PERIOD_CURRENT, 0) не меняются… // То, что без RefreshRates(); не меняются значения Bid, это понятно и нормально… } }/******************************************************************/
Here is the result of the script execution
2021.02.15 11:39:35.559 00 EURUSD,M5: 1.21375 *** 1.21375 2021.02.15 11:39:34.559 00 EURUSD,M5: 1.21375 *** 1.21375 2021.02.15 11:39:33.559 00 EURUSD,M5: 1.21375 *** 1.21375 2021.02.15 11:39:32.559 00 EURUSD,M5: 1.21375 *** 1.21375 2021.02.15 11:39:31.559 00 EURUSD,M5: 1.2138 *** 1.2138 2021.02.15 11:39:30.559 00 EURUSD,M5: 1.21378 *** 1.21378 2021.02.15 11:39:29.559 00 EURUSD,M5: 1.21379 *** 1.21379 2021.02.15 11:39:28.559 00 EURUSD,M5: 1.21378 *** 1.21378 2021.02.15 11:39:27.559 00 EURUSD,M5: 1.21379 *** 1.21379 2021.02.15 11:39:26.559 00 EURUSD,M5: 1.21379 *** 1.21379
Well, ok... I'll just keep in mind this feature and insert RefreshRates() if necessary;
ps; And iClose(_Symbol, PERIOD_CURRENT, 0) changes in MT5.
Frankly speaking, I'm surprised... and that's putting it mildly. I thought iClose() gets values from broker's server, but no... RefreshRates(); updates values received by iClose()
Here is the result of the script execution
Well, OK... Personally I will just keep in mind this feature and insert RefreshRates() when necessary;
If I change timeframe to another one than the current one, the data will stop being refreshed in time even with RefreshRates(). So, iClose and other fundamental functions in MT4 produce an irrelevant nonsense. I'm sure that 80% of the infos do not take into account these unique features of MT4. How to live?)))
Frankly speaking, I'm surprised... and that's putting it mildly. I thought iClose() gets values from broker's server, but no... RefreshRates(); updates values received by iClose()
Here is the result of the script execution
Well, ok... I'll just keep in mind this feature and insert RefreshRates() if necessary;
ps; And iClose(_Symbol, PERIOD_CURRENT, 0) changes in MT5.
What's the solution? More crutches? Like, keep a tick history and recalculate all the timeframes in EAs on their own. This is beyond good and evil))).
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use