I did look at the built-in functions, but I had some difficulties getting it to work with 3 dimensions,
probably a mistake on my part or because of the way in which I work with different time frames.
I don't update the whole array each time, so the dimension for timeframe PERIOD_M15 gets updated only once every 15 minutes etc.
If I shifted the PERIOD_H1 data each time I shifted PERIOD_M15 the data would get skewed.
I am not holding much data or the regular shuffling would be very inefficient.
It would have been simpler to keep the different timeframes in different arrays.
Also one can use a circular index and circular buffer so that the data never needs to be shuffled if the arrays are fixed sized.
If I was able to use objects and pass objects by reference none of this half cocked array management would be required
Speed is a major aspect as I cannot wait an hour per each 12 month back-test.
If the back-test completes in 30 seconds then I am confident that the real-time response is adequate.
The built in functions will definitely be faster for large amounts of data.