//+------------------------------------------------------------------+
//|                       tro_spread_dots                            |
//|                                                                  | 
//|   Copyright © 2008, Avery T. Horton, Jr. aka TheRumpledOne       |
//|                                                                  |
//|   PO BOX 43575, TUCSON, AZ 85733                                 |
//|                                                                  |
//|   GIFT AND DONATIONS ACCEPTED                                    | 
//|                                                                  |  
//|    http://docs.mql4.com/constants/wingdings                      |                                         |
//+------------------------------------------------------------------+

#property copyright "Copyright © 2008, Avery T. Horton, Jr. aka TheRumpledOne"
#property link      "therumpledone@gmail.com"

#property indicator_chart_window 
#property indicator_buffers 2

//#property indicator_color1 Yellow 
//#property indicator_color2 Brown

//---- For the small screens
//extern string    Display_infos         = "=== If true, displayed on the chart ===";
//extern bool      display_on_chart      =  true ;  // If true, the open trade analysis, daily pivots and daily range will be displayed on the chart window

// indicators parameters
 

extern bool   Show.PriceBox  = true ;
extern int    myBoxWidth     = 3;
 
  

extern int myStyle1  = 2 ;
extern int myStyle2  = 2 ;


extern int myWingDing1  = 171 ;
extern int myWingDing2  = 171 ;


extern color myColor1 = Red ;
extern color myColor2 = Lime;
 
//---- buffers

double P1Buffer[];
double P2Buffer[];
double P3Buffer[];
double P4Buffer[];
double P5Buffer[];
double P6Buffer[];
double P7Buffer[];
 

string tPIVOT0 = "PIVOT_0" ;
string tPIVOT1 = "PIVOT_1" ;



//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- name for indicator window

   string short_name=" ";
   IndicatorShortName(short_name);
   SetIndexBuffer(0, P1Buffer);
   SetIndexBuffer(1, P2Buffer);

//----

SetIndexArrow(0, myWingDing1); 
SetIndexArrow(1, myWingDing2); 



   SetIndexStyle(0, DRAW_ARROW, myStyle1, 1, myColor1 );
   SetIndexStyle(1, DRAW_ARROW, myStyle2, 1, myColor2 );   
  
   return(0);
  }
 
//+------------------------------------------------------------------+
int deinit()
  {
   
 
   ObjectDelete(tPIVOT0);
   ObjectDelete(tPIVOT1);
   
   return(0);
  }
 
//+------------------------------------------------------------------+
int start()
  {
 
		
   double X01 = Ask ;  
   double X02 = Bid ;  
   double X03 = 0 ;
   double X04 = 0 ;	
   double X05 = 0 ;	
   double X06 = 0 ;
	double X07 = 0 ;

   X01 = NormalizeDouble(X01, Digits) ;
   X02 = NormalizeDouble(X02, Digits) ; 
   

   P1Buffer[1] = EMPTY_VALUE ;
	P2Buffer[1] = EMPTY_VALUE ;
	P1Buffer[0] = X01 ;
	P2Buffer[0] = X02 ;
 

 

if(Show.PriceBox)  
{ 
  if (ObjectFind(tPIVOT0) != 0)
      {
          ObjectCreate(tPIVOT0,OBJ_ARROW,0,Time[0],X01);
          ObjectSet(tPIVOT0,OBJPROP_ARROWCODE,SYMBOL_LEFTPRICE);
          ObjectSet(tPIVOT0,OBJPROP_WIDTH,myBoxWidth);  
          ObjectSet(tPIVOT0,OBJPROP_COLOR,myColor1);  
      } 
      else
      {
         ObjectMove(tPIVOT0,0,Time[0],X01);
      }
 

    
    if (ObjectFind(tPIVOT1) != 0)
      {
          ObjectCreate(tPIVOT1,OBJ_ARROW,0,Time[0],X02);
          ObjectSet(tPIVOT1,OBJPROP_ARROWCODE,SYMBOL_LEFTPRICE);
          ObjectSet(tPIVOT1,OBJPROP_WIDTH,myBoxWidth);            
          ObjectSet(tPIVOT1,OBJPROP_COLOR,myColor2);  
      } 
      else
      {
         ObjectMove(tPIVOT1,0,Time[0],X02);
      }


} // 
 
    
   return(0);
  }


