at_ZDnsw





//**********************************
#property indicator_separate_window
#property  indicator_buffers 2
#property indicator_color1 LightSkyBlue
#property indicator_color2 Pink
#property indicator_width1 2
#property indicator_width2 2
//==================================
extern int p=6;
extern int s=3;
extern int cb=300;
//==================================
double fx[],fxL[],za[];
double z1,z2,ki;
int fs;
//**********************************
int init()
{
   IndicatorBuffers(3);
   //-------------------
   SetIndexBuffer(0,fx);  SetIndexEmptyValue(0,0.0);
   SetIndexBuffer(1,fxL); SetIndexEmptyValue(1,0.0);
   //-------------------
   SetIndexBuffer(2,za); 
   //--------------------------
   ki=2.0/(p+1);
   //--------------------------
   return(0);
}
//***************************************************************************
int start()
{
   SetIndexDrawBegin(0,Bars-cb);
   SetIndexDrawBegin(1,Bars-cb);
   
   for (int i=cb; i>=0; i--) {fx[i]=Close[i];}
   
   for (int m=0; m<=s; m++)
   {
      z1=fx[0];
      for (i=0; i<=cb; i++) {z1=z1+(fx[i]-z1)*ki; za[i]=z1;}
      
      z2=fx[cb];
      for (i=cb; i>=0; i--) {z2=z2+(fx[i]-z2)*ki; fx[i]=(za[i]+z2)/2;}
   } 
   
   fs=0; 
   for (i=cb; i>=0; i--) 
   {
      if (fx[i]>fx[i+1]) fs=1;
      if (fx[i]<fx[i+1]) {if (fs==1) fxL[i+1]=fx[i+1]; fs=2;}
      if (fs==2) fxL[i]=fx[i]; else fxL[i]=0.0;
   }
   
   return(0);
}
//************************************************************





Sample





Analysis



Market Information Used:

Series array that contains close prices for each bar


Indicator Curves created:



Indicators Used:



Custom Indicators Used:

Order Management characteristics:

Other Features: