//+------------------------------------------------------------------+ //| MovingAverage.mq5 | //| Copyright © 2020 MhFx7, All Rights Reserved | //| https://www.mql5.com/en/users/mhfx7 | //+------------------------------------------------------------------+ #property copyright "Copyright © 2020 MhFx7, All Rights Reserved" #property link "https://www.mql5.com/en/users/mhfx7" #property version "1.00" #property script_show_inputs input int period=10; //+------------------------------------------------------------------+ //| Script program start function | //+------------------------------------------------------------------+ void OnStart() { Print(MovingAverage(period)); } //+------------------------------------------------------------------+ double MovingAverage(int shift) { double close_cum=0; for(int i=0; i