Linear Weighted Moving Average?

 
Does anyone know where I can find a Linear Weighted Moving Average?

Thanks!
 
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);
  }
Reason: