Average of the volume of the last 50 candles

 
Good day everyone. I just want to ask if it is possible to have a function that will return the average of the volume of the last 50 candlestics in the chart? Because i felt dificult to code it. I just want to try to see the action if the volume of the last candlestics is higher the the average of the volume of last 50 candlesticks in the chart.

Thank you in advance and God Bless you all... 
 
Nieco Pama:
Good day everyone. I just want to ask if it is possible to have a function that will return the average of the volume of the last 50 candlestics in the chart? Because i felt dificult to code it. I just want to try to see the action if the volume of the last candlestics is higher the the average of the volume of last 50 candlesticks in the chart.

Thank you in advance and God Bless you all... 

You can drop in a subwindow the Volumes Indicator that comes with MT5, and drag-and-drop also a Moving Average into that sub-window, changing its value to 50 periods.

Do not forget to set the Apply to PREVIOUS INDICATOR's DATA...

;)

 
Flavio Jarabeck:

You can drop in a subwindow the Volumes Indicator that comes with MT5, and drag-and-drop also a Moving Average into that sub-window, changing its value to 50 periods.

Do not forget to set the Apply to PREVIOUS INDICATOR's DATA...

;)

Thank you sir for the idea, but I just want to use it in an EA that i am making. I hope that theres someone who can help me the code....

 
      long average=0;
      for(int x=0; x<50; x=x+1)
        {
         average=average+Volume[x];
        }
      Print("Volume average: ",average/x);
 

This could also work (just an idea, not tested):

double macurrent=iMAOnArray(Volume,0,50,0,MODE_SMA,0); 
Reason: