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
Well they have a purpose.
They don't have a purpose. These functions were added due to user requests (if I remember correctly).
As for me, these features were asked to be added mainly by 2 user groups:
Forum on trading, automated trading systems and testing trading strategies
New MetaTrader 5 Platform build 1860: MQL5 functions for operations with bars and Strategy Tester improvements
MetaQuotes, 2018.06.14 16:06
Earlier, most of tasks performed through these functions could be implemented using Copy* functions. However, users had to implement their own functions in order to find the High/Low values on the chart and to search for bars based on their time. Now, these tasks can be easily executed using iHighest, iLowest and iBarShift functions.
In the case of the indicator, you don’t even need to copy anything. Just write a small loop and find the bar you need in the ready array.
Why do you need these terrible functions?
Each call to such a function can generate an error. You need to check for error every time you call any of these functions.
If the function generated an error, then on this tick it is better not to use any data related to prices at all. The quotes are most likely loading and you will need to wait for them to load.
Each such function contains a CopyXXX call inside. That is, they can request data from the server.
If you write a simple loop yourself, then you don't need to handle any errors, you don't need to request anything from the server. You simply find the index of the bar you need in the array that the terminal has prepared for you.
Each call to such a function can generate an error. You need to check for error every time you call any of these functions.
If the function generated an error, then on this tick it is better not to use any data related to prices at all. The quotes are most likely loading and you will need to wait for them to load.
Each such function contains a CopyXXX call inside. That is, they can request data from the server.
If you write a simple loop yourself, then you don't need to handle any errors, you don't need to request anything from the server. You simply find the index of the bar you need in the array that the terminal has prepared for you.
Good to know. But I found them handy for a use case anyway. The indicator looks nice, neat, and maintainable as well by using them.