iClose() Is this correct way to get price for specific bars? What is the equivalent of this iClose() function in MQL5?
How about if I use this iClose() in multi-timeframe/currency then I need to use looping statement? Please give me sample code for better understanding.
Is there any better idea to get price for specific bar in Multi-TimeFrame/Currency Indicators?
18. Timeseries Access ("Migrating from MQL4 to MQL5")
You will also find more information and answers in the following:
MQL4 MQL5 Description double iClose(string symbol, int timeframe, int shift) double iCloseMQL4(string symbol,int tf,int index){ if(index < 0) return(-1); double Arr[]; ENUM_TIMEFRAMES timeframe=TFMigrate(tf); if(CopyClose(symbol,timeframe, index, 1, Arr)>0) return(Arr[0]); else return(-1); }Close
Returns Close value for the bar of indicated symbol with timeframe and shift. If local history is empty (not loaded), function returns 0.
CopyRates, MqlRates

- docs.mql4.com
18. Timeseries Access ("Migrating from MQL4 to MQL5")
You will also find more information and answers in the following:
MQL4 MQL5 Description Close
Returns Close value for the bar of indicated symbol with timeframe and shift. If local history is empty (not loaded), function returns 0.
CopyRates, MqlRates
It means I need to create iClose() function to use it in MQL5. OMG! MQL5 is became low level language. Why MQL Devs keep bringing back C++ programmer Nightmare! LoL
No, you don't have to create the iClose() function in MQL5. It is just that in MQL5 the entire approach is different, and you have to apply a different logic.
It is just that those users that have already become accustomed to the MQL4 logic, feel more comfortable thinking in the same manner and so create "emulator" functions because they prefer using equivalent functionality.
However, in MQL5, you should in fact throw away your MQL4 thinking and learn the completely new way of doing things in the MQL5 logic.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
iClose() Is this correct way to get price for specific bars? What is the equivalent of this iClose() function in MQL5?
How about if I use this iClose() in multi-timeframe/currency then I need to use looping statement? Please give me sample code for better understanding.
Is there any better idea to get price for specific bar in Multi-TimeFrame/Currency Indicators?