Then why this approach is not practiced? For some reason the vast majority of those who write indicators even reverse the indexing of arrays as in mql4.
Alexey Viktorov: Then why isn't this approach practiced? For some reason the vast majority of those who write indicators even reverse the indexing of arrays as in mql4.
Because they never wrote complex but fast indicators, otherwise left-to-right indexing would have been a very important task.
Alexey Viktorov: Then why isn't this approach practiced? For some reason the vast majority of those who write indicators even reverse the indexing of arrays as in mql4.
Because they never wrote complex but fast indicators, otherwise left-to-right indexing would have been a very important task.
Because they never wrote complex but fast indicators, otherwise left-to-right indexing would have been the solution to a very important problem.
There is no difference in the speed of accessing the element. In one case it is void* first+sizeof(T)*index and in the other it is last-sizeof(T)*index. The front and back methods in containers have a constant complexity. I hope that the fact that arrays in mql are essentially containers isn't questioned.
What is the disadvantage of indexing to the right, from the newest?
If the indicator is calculated from the left to the right, then if some event has occurred, for example, a fractal has formed, you must store the index of the bar with this event (to use it later for some purpose). If the indexing is from the right to the left, we should calculate n=Bars-i and store n and then do the reverse: i=Bars-n. But if you do index from left to right, you should just save the index and use it, it won't change. Since in more or less complicated indicators this is always needed, left-to-right indexing is a big help for indicator developers.
Vladimir Simakov: There is no difference in the element access speed. In one case it is void* first+sizeof(T)*index and in the other case last-sizeof(T)*index. The front and back methods in containers have a constant complexity. I hope that the fact that arrays in mql are essentially containers isn't questioned.
What does this have to do with the speed at which the element is accessed?
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Can I have an example?
Wait a bit, I'll post it here in the Code Base. Otherwise the link to my site will be deleted anyway.
Then why isn't this approach practiced? For some reason the vast majority of those who write indicators even reverse the indexing of arrays as in mql4.
Because they never wrote complex but fast indicators, otherwise left-to-right indexing would have been a very important task.
Then why isn't this approach practiced? For some reason the vast majority of those who write indicators even reverse the indexing of arrays as in mql4.
Because they never wrote complex but fast indicators, otherwise left-to-right indexing would have been a very important task.
Because they never wrote complex but fast indicators, otherwise left-to-right indexing would be the solution to a very important problem.
What's the downside of indexing to the right, from the newest one?
Because they never wrote complex but fast indicators, otherwise left-to-right indexing would have been the solution to a very important problem.
What is the disadvantage of indexing to the right, from the newest?
If the indicator is calculated from the left to the right, then if some event has occurred, for example, a fractal has formed, you must store the index of the bar with this event (to use it later for some purpose). If the indexing is from the right to the left, we should calculate n=Bars-i and store n and then do the reverse: i=Bars-n. But if you do index from left to right, you should just save the index and use it, it won't change. Since in more or less complicated indicators this is always needed, left-to-right indexing is a big help for indicator developers.
There is no difference in the element access speed. In one case it is void* first+sizeof(T)*index and in the other case last-sizeof(T)*index. The front and back methods in containers have a constant complexity. I hope that the fact that arrays in mql are essentially containers isn't questioned.
What does this have to do with the speed at which the element is accessed?
Can I give you an example?
Here's an example.
Can I give you an example?
https://www.mql5.com/ru/code/25807