//+------------------------------------------------------------------+
//|                                               Supertrend_MTF.mq4 |
//+------------------------------------------------------------------+
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Green
#property indicator_width1 2
extern int 以=15;
int PeriodST=50;
int  ATR = 5;
double ExtMapBuffer3[];
//+------------------------------------------------------------------+
int init()  {
   if(以<Period())  以=Period();
   SetIndexBuffer(0, ExtMapBuffer3);   SetIndexStyle(0, DRAW_LINE, 1,2);   SetIndexLabel(0, "TF("+ 以 +")");
   return(0);
}
//+------------------------------------------------------------------+
int deinit()  {   return(0);  }
//+------------------------------------------------------------------+
int start()  {
   datetime TimeArray2[];
   int    i, limit, y=0, counted_bars=IndicatorCounted();
    
   ArrayCopySeries(TimeArray2,MODE_TIME,Symbol(),以); 
   limit=Bars-counted_bars;
   limit = 900;
   for(i=0,y=0;i<limit;i++)   {
     if (Time[i]<TimeArray2[y]) y++; 
     ExtMapBuffer3[i]=iCustom(NULL,以,"Supertrend_simple",PeriodST,ATR,0,y);
  } 
  return(0);
}
//+------------------------------------------------------------------+
