
#property copyright "© 2007 RickD"
#property link      "www.e2e-fx.net"

#define major   1
#define minor   0

#property indicator_chart_window
#property indicator_buffers 3
#property indicator_color1  Red
#property indicator_color2  DodgerBlue
#property indicator_color3  Lime


extern double Periode = 61.8;
int N2 = 0;

double UpperBuf[];
double LowerBuf[];
double MidBuf[];
double range;
double high;
double low;

void init()
{       
   SetIndexStyle(0, DRAW_LINE);
   SetIndexStyle(1, DRAW_LINE);
   SetIndexStyle(2, DRAW_LINE);
   SetIndexDrawBegin(0, Periode);
   SetIndexDrawBegin(1, Periode);
   SetIndexDrawBegin(2, Periode);
   SetIndexBuffer(0, UpperBuf);
   SetIndexBuffer(1, LowerBuf);
   SetIndexBuffer(2, MidBuf);
}

void deinit() {
}  

void start() 
{
  int counted = IndicatorCounted();
  if (counted < 0) return (-1);
  
  if (counted > 0) counted--;
  int limit = Bars-counted;
  
  for (int i=0; i < limit; i++) 
  {
    UpperBuf[i] = iHigh(NULL, 0, iHighest(NULL, 0, MODE_HIGH, Periode, i)) + N2*Point;
    LowerBuf[i] = iLow(NULL, 0, iLowest(NULL, 0, MODE_LOW, Periode, i)) - N2*Point;
    MidBuf[i] = (UpperBuf[i]+LowerBuf[i])/2;
  }
    
   
}