//+------------------------------------------------------------------+
//|                                                   quick draw.mq4 |
//|                                                           .....h |
//|                                                 hayseedville.com |
//+------------------------------------------------------------------+
#property copyright ".....h"
#property link      "hayseedville.com"

#property indicator_chart_window

extern double startprice  =    0.0; 
extern int    pips        =    100;
extern int    steps       =      5;
extern bool   DrawUp      =   true;
extern bool   DrawDown    =   true;
extern color  upcolor     =   Lime;
extern color  downcolor   =   Magenta;
extern color  startcolor  =   Blue;
extern bool   usehighlow  =   false;
extern int    timeframe   =   0;
extern int    shift       =   1;
extern bool   evenlyspace =   false;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
    
    pips = pips*10;
    
    if(usehighlow) 
     {
     startprice = ((iHigh(Symbol(),timeframe,shift)-iLow(Symbol(),timeframe,shift))*0.5)+iLow(Symbol(),timeframe,shift);
     }
  
  
    if(evenlyspace) 
     {
     pips       = (( (iHigh(Symbol(),timeframe,shift)-iLow(Symbol(),timeframe,shift))+0.000001)/(Point))/(steps*2); 
     steps      = steps+1;    
     }  
  
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
//----
   int i;
   
   if(DrawUp)
   {
   for(i=1; i<steps;i++)
    {
    Draw("up"+i,startprice+pips*i*Point, upcolor);
    }
   }
 
   if(DrawDown)
   {
   for(i=1; i<steps;i++)
    {
    Draw("dn"+i,startprice-pips*i*Point, downcolor);
    }
   }
 
    Draw("start",startprice, startcolor);
 
 
   
//----
   return(0);
  }
//+------------------------------------------------------------------+

   
   void Draw(string name, double level, color clr)
   {  
   ObjectDelete(name);
   ObjectCreate(name, OBJ_HLINE, 0, 0, level);
   ObjectSet(name, OBJPROP_STYLE, STYLE_SOLID);
   ObjectSet(name, OBJPROP_WIDTH, 2);
   ObjectSet(name, OBJPROP_COLOR, clr);
   }
   

