how to multi time iMAOnArray?

 
I want the value of S1Buffer, which is calculated in the 15-minute time frame, to show the same value for lower time frames, such as the OpenBuffer, CloseBuffer, and COBuffer buffers, which work the same way.
Can anyone help?
Files:
loop.txt  3 kb
m15.txt  3 kb
 
    datetime currentTime = time[bufferIndex];

In MT4, buffers and MT4 predefined arrays are all ordered AsSeries. There is a difference between the arrays passed to OnCalculate (e.g. low[]) and the MT4 predefined variables (e.g. Low[].) The passed arrays have no default direction, just like MT5.

To determine the indexing direction of time[], open[], high[], low[], close[], tick_volume[], volume[] and spread[], call ArrayGetAsSeries(). In order not to depend on default values, you should unconditionally call the ArraySetAsSeries() function for those arrays, which are expected to work with.
          Event Handling Functions - Functions - Language Basics - MQL4 Reference

 
William Roeder #:

In MT4, buffers and MT4 predefined arrays are all ordered AsSeries. There is a difference between the arrays passed to OnCalculate (e.g. low[]) and the MT4 predefined variables (e.g. Low[].) The passed arrays have no default direction, just like MT5.

I am an amateur in mql 4 coding, can you give me more guidance on which part of the code to modify, thanks
Dynamic Array Object - Data Types - Language Basics - MQL4 Reference
Dynamic Array Object - Data Types - Language Basics - MQL4 Reference
  • docs.mql4.com
Dynamic Array Object - Data Types - Language Basics - MQL4 Reference
 
Alireza Sajjadi #: I am an amateur in mql 4 coding, can you give me more guidance on which part of the code to modify, thanks

I did. I quoted the documentation which explicitly told you what to do.

 
William Roeder #:

I did. I quoted the documentation which explicitly told you what to do.

I use ArraySetAsSeries for "time [bufferIndex]" but still anything calculated in lower frame like rest of buffers