Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1594
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
How would you briefly characterise the word handle?
Number)
I see. ) But seriously? Here is taken from the documentation:
Alexei, based on your definition of handle, it appears that iMA returns the number of the moving average indicator? )) Abracadabra, that's all.... )
Regards, Vladimir.
Vladimir, roughly speaking, you can consider the handle as a line number of the list, which contains addresses of memory cells, starting from which executable codes of calculation of all necessary indicators are stored. Since there are many different indicators, there is no sense to always add all of them to this list. It is filled according to the requests of the author of a particular Expert Advisor. If you need some indicator, you should add it to this list and place its code somewhere in memory.
Calling functions like iMA just adds a new item to this list. That is, if you need to get the calculations of this indicator in the programme, you need to refer to the memory address, which is under the next number. This new number in the list is returned by those functions, which are written about that they return the handle.
Well, what is a number in the list if not a number?
Well, what is a number in the list if not a number?
Yuri, you are right as well as Alexey. Now I put the first handles of iMA, iTEMA and iDEMA indicators one after another in a test EA, and then I ran them step by step from the stop point set on iMA. I got the return of values from iMA - 10, from iTEMA - 11 and iDEMA - 12. Then, no matter how I rearranged the handles of these indicators, they still consistently gave values 10, 11 and 12.
Your explanation, Yuri, has become more or less clear to me. Thank you! Now I just need to understand the smallest thing - why the numbering of handles starts not from zero but from 10? )
Regards, Vladimir.
Vladimir, do you really need to understand it so much?
In the programming world, and in the world in general, we use a lot of things without thorough understanding of all the internal nuances of their work. We trust the developers of these things, believing that the decisions they made to implement something in this way and not in another way had some grounds.
I didn't have to participate in the work on the MQL5 compiler and language, so I can't say exactly why the numbering of handles starts with 10. I can guess why it is so, but it doesn't make much sense. After all, in the code we will not use handles as numbers to perform any arithmetic operations. Therefore, only two things are important for us, as MQL5 users:
why does the handle numbering start with 10 instead of zero?
Yes, Yuri, that's exactly the point. If I try to understand something, I try to do it to the best of my ability. )
Vladimir, just in case I ask: do you understand the difference between the terms "MQL5 programming language developer" and "developer using the MQL5 programming language"? I was talking about the former, and you probably meant the latter. But I could be wrong, of course.
Vladimir, just in case I ask: do you understand the difference between the terms "MQL5 programming language developer" and "developer using the MQL5 programming language"? I was talking about the former, and you probably meant the latter. But I could be wrong, of course.