BaterloutzSimmetric





//+------------------------------------------------------------------+
//|                          Moving Average Batteruot Simmetric .mq4 |
//|                                                  Code by Neutron |
//+------------------------------------------------------------------+
#property indicator_chart_window
#property indicator_color1 Red
#property indicator_width1 3

#define Pi 3.14159
extern int FLFPeriod=10;
int Start,i,m,K=4;
double Gamma,alfa,b,c,g,MA[2000],Y[2000]; 

int start()
{
Start=2000;
Gamma= MathPow(0.484,1/(2*K))/MathTan(Pi/(FLFPeriod+1));	 
	 for (i=0;i<=Start+2;i++) {Y[i]=(Open[i]+Close[i]+High[i]+Low[i])/4.;MA[i]=Y[i];}

for (m=1;m<=K;m++) 	 {
	 alfa=2*MathSin(Pi/4*(2*m-1)/K);
	 g=1/(Gamma*Gamma+Gamma*alfa+1);
	 b=2*g*(Gamma*Gamma-1);
	 c=g*(Gamma*Gamma-Gamma*alfa+1); 
	 for (i=Start-3;i>=0;i--)MA[i]=g*(Y[i]+2*Y[i+1]+Y[i+2])+b*MA[i+1]-c*MA[i+2];	 
    for (i=2;i<=Start-3;i++)Y[i]=g*(MA[i]+2*MA[i-1]+MA[i-2])+b*Y[i-1]-c*Y[i-2];
                       }
}

int init()
{
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,Y);
   return(0);
}






Sample





Analysis



Market Information Used:

Series array that contains close prices for each bar
Series array that contains the highest prices of each bar
Series array that contains the lowest prices of each bar
Series array that contains open prices of each bar


Indicator Curves created:

Implements a curve of type DRAW_LINE


Indicators Used:



Custom Indicators Used:

Order Management characteristics:

Other Features: