In the standard Moving Average that comes with MT4
Want stand alone. Looking for code. So I can bring values into EA.
Thanks!
Read the editor's reference for iMA
In the MovingAverages.mqh header file.
//+------------------------------------------------------------------+ //| Linear Weighted Moving Average | //+------------------------------------------------------------------+ double LinearWeightedMA(const int position,const int period,const double &price[]) { //--- double result=0.0,sum=0.0; int i,wsum=0; //--- calculate value if(position>=period-1 && period>0) { for(i=period;i>0;i--) { wsum+=i; sum+=price[position-i+1]*(period-i+1); } result=sum/wsum; } //--- return(result); }

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Thanks!