MTF_ChandelierStops





//+------------------------------------------------------------------+
//|                            MTF_ChandelierStops  
//| by Zathar       mod   http://www.forex-tsd.com
//+------------------------------------------------------------------+

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Magenta
#property indicator_color2 Aqua
#property indicator_width1 2
#property indicator_width2 2

extern int TimeFrame=0;
extern int     Length=15;
extern int     ATRperiod=14;
extern double  Kv=4;
//extern int     Shift=1;
extern int     HShift=0;  // horisontal shift

double Shift=1;
double ExtMapBuffer1[];
double ExtMapBuffer2[];


int init()
  {
   //---- indicator line
   SetIndexBuffer(0,ExtMapBuffer1);
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(1,ExtMapBuffer2);
   SetIndexStyle(1,DRAW_LINE);   
   SetIndexDrawBegin(0,Length-1);
   SetIndexDrawBegin(1,Length-1);
     if(TimeFrame==0) TimeFrame = Period();
   SetIndexShift(0,HShift*TimeFrame/Period());
   SetIndexShift(1,HShift*TimeFrame/Period());
   IndicatorShortName("MTF_Chandelier");
   SetIndexLabel(0,"MTF_Chndlr Up;TF"+TimeFrame+"");
   SetIndexLabel(1,"MTF_Chndlr Dn;TF"+TimeFrame+"");
  }
//----
   return(0);
 

int start()
  {
   datetime TimeArray[];
   int    i,shift,limit,y=0,counted_bars=IndicatorCounted();
     
   ArrayCopySeries(TimeArray,MODE_TIME,Symbol(),TimeFrame); 
   
   limit=Bars-counted_bars+TimeFrame/Period();
   for(i=0,y=0;i<limit;i++) {
     if (Time[i]<TimeArray[y]) {y++;}   
     ExtMapBuffer1[i]=iCustom(NULL,TimeFrame,"ChandelierStops_v1",Length,ATRperiod,Kv,HShift,1,y); 
     ExtMapBuffer2[i]=iCustom(NULL,TimeFrame,"ChandelierStops_v1",Length,ATRperiod,Kv,HShift,0,y);
   }
   return(0);
  }



Sample





Analysis



Market Information Used:

Series array that contains open time of each bar


Indicator Curves created:


Implements a curve of type DRAW_LINE

Indicators Used:




Custom Indicators Used:
ChandelierStops_v1

Order Management characteristics:

Other Features: