//+------------------------------------------------------------------+
//|aMarkHorizontalsUP1                                               |
//|Marks horizontals starting at an input price (pivot point)        |
//|and places 7 parallel lines above it                              |
//|08/19/09 initial                                                  |
//|08/02/10 allow lines to be different distances apart              |
//+------------------------------------------------------------------+
#property copyright "z"
#property link      "z"
#property  indicator_chart_window
#property indicator_buffers 8
#property indicator_color1 White
#property indicator_color2 White
#property indicator_color3 White
#property indicator_color4 White
#property indicator_color5 White
#property indicator_color6 White
#property indicator_color7 White
#property indicator_color8 White

extern double dPivotPoint=0;
extern double dGridSize1=0.01;
extern double dGridSize2=0.02;
extern double dGridSize3=0.035;
extern double dGridSize4=0.05;
extern double dGridSize5=0.065;
extern double dGridSize6=0.08;
extern double dGridSize7=0.09;

double PPBuf[],UP1Buf[],UP2Buf[],UP3Buf[],UP4Buf[],UP5Buf[],UP6Buf[],UP7Buf[];
bool bKillIt=False;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init() {
   SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,2);
   SetIndexBuffer(0,PPBuf); 
   SetIndexLabel(0,"pp");
   SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,1);
   SetIndexBuffer(1,UP1Buf); 
   SetIndexStyle(2,DRAW_LINE,STYLE_SOLID,1);
   SetIndexBuffer(2,UP2Buf); 
   SetIndexStyle(3,DRAW_LINE,STYLE_SOLID,1);
   SetIndexBuffer(3,UP3Buf); 
   SetIndexStyle(4,DRAW_LINE,STYLE_SOLID,1);
   SetIndexBuffer(4,UP4Buf); 
   SetIndexStyle(5,DRAW_LINE,STYLE_SOLID,1);
   SetIndexBuffer(5,UP5Buf); 
   SetIndexStyle(6,DRAW_LINE,STYLE_SOLID,1);
   SetIndexBuffer(6,UP6Buf); 
   SetIndexStyle(7,DRAW_LINE,STYLE_SOLID,1);
   SetIndexBuffer(7,UP7Buf);    
   if(dPivotPoint==0)
   {
      Print("Missing input value.");
      bKillIt=true;
      return(-1);
   }
   return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
{
   if(bKillIt==true) return(-1);
   int i,counted_bars=IndicatorCounted();
      if(counted_bars>0) counted_bars--;
   int limit=Bars-counted_bars;
   for(i=0; i<limit; i++)
   {
      PPBuf[i] = dPivotPoint;
      UP1Buf[i] = dPivotPoint + dGridSize1;
      UP2Buf[i] = dPivotPoint + dGridSize2;
      UP3Buf[i] = dPivotPoint + dGridSize3;
      UP4Buf[i] = dPivotPoint + dGridSize4;
      UP5Buf[i] = dPivotPoint + dGridSize5;
      UP6Buf[i] = dPivotPoint + dGridSize6;
      UP7Buf[i] = dPivotPoint + dGridSize7;
   }
   return(0);
}   
//+------------------------------------------------------------------+