Moving average otherwise

 

Hi guys!


I'd like to use the moving average of the last 20 ticks (for example the last 20 bidprice of a pair) . How can I count it? Can you help me by a little code?


Thank you!

 

create a series array of 20 (or more) elements.

On each tick, shift each array element up by one index... element[i] = element[i-1]

put the price of the current tick in element[0]

take iMAOnArray() and display

 
phy:

create a series array of 20 (or more) elements.

On each tick, shift each array element up by one index... element[i] = element[i-1]

put the price of the current tick in element[0]

take iMAOnArray() and display

Thank you!