Hi i`m curious how the MT4 handles the shifting of the arrays after each tick.And here i`m mostly interested in the Volume Array.
My question is that what algoritm shifts back the entire array by 1 element after each new data (in our case tick and/or time for a bar to close relative to timeframe).
I wish to know that algoritm if anyone can describe it to me, the shortest method to achieve this.
Here i will illustrate it in a picture
So basically every new unit of the array is shifted back 1 place to its previous one's place, and if the array has reached its maximum size, then the last ones will be discarded from the array.
In case of the Volume array, the close volume of the timeframe is our period when new data comes and shifts the old one's place.
You can't really know how it's managed unless by doing an analysis of the memory usage, which it's not worth the effort.
Why are you asking ?
I`m asking it because i would like to build an indicator which logs volumes, but not by timeframe but by count.It would be like the renko bars, but instead of logging the price, i would log the volume, and for this i need to build my own array of volumes in this manner, since the Volume array segmented by timeframe not by count.
And of course i would need it in reverse order, since the Start() is capable of logging in the other direction only.So i guess i need to use the ArrayCopy() aswell.
To add comments, please log in or register