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
No, it is not. What is written in the function help about the return value?
Returned value
Value of bar close price (specified by shift parameter) of the corresponding chart or 0 in case of error. Call GetLastError() to get more information about the error.
And if you change the timeframe to a different one than the current one, the data will not update in time even with RefreshRates(). So the fundamental functions of iClose etc. in MT4 produce irrelevant bullshit. I'm sure that 80% of the infos do not take into account these unique features of MT4. How to live?)))
The change off will not give anything. The current value of iClose equals the Bid value regardless of the chart period.
I have made an EA and run it on M5 for a day. At the hour change it draws horizontal lines for each of the values: iClose(symbol,PERIOD_H1,1),iClose(symbol, PERIOD_ M5,1), iClose(symbol, PERIOD_ M1,1 ),Close[1],Bid
Question to the developers. Why do we need theiClose function in MQL4, if it doesn't give the correct information and there is no way to update its data?
I have made an EA and run it on M5 for a day. At the hour change it draws horizontal lines for each of the values: iClose(symbol,PERIOD_H1,1),iClose(symbol, PERIOD_ M5,1), iClose(symbol, PERIOD_ M1,1 ),Close[1],Bid
Question to the developers. Why do MQL4 neediClose functions, if they don't give reliable information and there is no way to update their data?
This is nonsense. The RefreshRates() call is necessary only if the execution was delayed for any reason. Such cases as long cycle or just updating prices at the moment of sending an order to open an order. There should not be any problems in your variant. Better post an example of code that gets price values so wrong.
I'm running the following code now
In fact, the minute closure should coincide with any high period on the chart. I will check later to see if there is anything written in the log.And if you change the timeframe to a different one from the current one, the data will stop updating in time, even with RefreshRates().
Is there any test code to confirm this statement? I haven't noticed it myself. When switching TF, we simply wait for history to be swapped and then work.
So, iClose and other fundamental functions in MT4 produce irrelevant nonsense.
This is too loud an assertion. Sometimes it's possible, but that's what error codes are for. If you don't check them you will never know if you can use the result you get.
I'm sure that 80% of infoproducts do not take into account these unique features of MT4. How to live?)))
I will say more: almost all programs do not take these features into account. That is why their new versions are released. As soon as a product is no longer supported, it is rendered unusable.
This is nonsense. It is only necessary to call RefreshRates() if there has been a delay in execution for whatever reason. Cases like a long cycle or just updating prices at the time of sending an order to open an order. There should not be any problems in your variant. Better post an example of code that gets price values so wrong.
I am running such code now
In essence the minute close should coincide with any high period on the chart. Later I will see if there is anything written in the log.My code is similar to this one. There is an error in OnTick.
It should be
If we have the current timeframe M5 we should compare M5 with H1 and M1
The current timeframe M5 is displayed correctly. The problem was with H1 and M1.
I checked it on Alpari real EURCHF M5, but instead of Print I drew horizontal bars at each of the levels.
Is there any test code to support this statement? I haven't noticed this with myself. When switching TFs, we just wait for the history to swap and then work.
This is too loud a statement. In some cases this is possible, but that's what the error codes are for. If you don't check them, you will never know if you can use the result you get.
Let me say more: almost all programs don't take something into account. That's why their new versions are released. As soon as a product is no longer supported, it is incapable of being used.
Here's the code, put it in and check it out. I don't have a match on every candle. Alpari real EURCHF M5.
iClose: zero - error. The function does not report an error. Outputs a value which is currently obsolete.
If you suspect errors in the iXXXXXXX functions, use the SymbolInfoXXXXXX functions