Create an array containing a Moving Average for the last 100 bars

 

I use CopyClose() to create an array containing the Close price of the last 100 bars. How can I create an array containing a Moving Average for the last 100 bars?

 
  1. Can't be done. You need 100 values to compute the SMA(100). You can only compute the last SMA(100) with 100 bars of data.
  2. Why do you need to compute it? Just get it from the indicator. iMA - Technical Indicators - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5