//+------------------------------------------------------------------+ 
//|  _TRO_FIB_Multi                                                  | 
//|                                                                  | 
//|                                                                  | 
//|   Copyright © 2008, Avery T. Horton, Jr. aka TheRumpledOne       |
//|                                                                  |
//|   PO BOX 43575, TUCSON, AZ 85733                                 |
//|                                                                  |
//|   GIFTS AND DONATIONS ACCEPTED                                   | 
//|                                                                  |  
//|   therumpledone@gmail.com                                        |  
//+------------------------------------------------------------------+ 

#property  copyright "Copyright © 2008, Avery T. Horton, Jr. aka TRO" 
#property  link      "http://www.therumpledone.com/" 


#property link      "" 

#property indicator_chart_window 

//---- input parameters 


extern int myPeriod1  = 15 ;
extern int myPeriod2  = 30 ;
extern int myPeriod3  = 60 ;
extern int myPeriod4  = 240 ;
extern int myPeriod5  = 1440 ;
extern int myPeriod6  = 10080 ;
extern int myPeriod7  = 43200 ;

double v0 =  0.764 ;
double v1 =  0.618 ;
double v2 =  0.5 ;
double v3 =  0.382 ;
double v4 =  0.236 ;
double v5 =  0.0 ;

int      window;  
string   shortName;



//+------------------------------------------------------------------+ 
//| Custom indicator initialization function                         | 
//+------------------------------------------------------------------+ 
int init() 
  { 
   shortName  = "TROfibs" + Period();
   IndicatorShortName(shortName); 
   window      = WindowFind(shortName);
      
     initGraph();
  
//---- 
   return(0); 
  } 
//+------------------------------------------------------------------+ 
//| Custom indicator deinitialization function                       | 
//+------------------------------------------------------------------+ 
int deinit() 
  { 

deleteObject(); 
ObjectsDeleteAll( window, 21);
ObjectsDeleteAll( window, 22);
ObjectsDeleteAll( window, 23);   

   return(0); 
  } 
//+------------------------------------------------------------------+ 
//| Custom indicator iteration function                              | 
//+------------------------------------------------------------------+ 
string Period2Text(int TmPeriod)
{
  switch (TmPeriod)
  {
    case PERIOD_M1  : return("M1");
    case PERIOD_M5  : return("M5");
    case PERIOD_M15 : return("M15");
    case PERIOD_M30 : return("M30");
    case PERIOD_H1  : return("H1");
    case PERIOD_H4  : return("H4");
    case PERIOD_D1  : return("D1");
    case PERIOD_W1  : return("W1");
    case PERIOD_MN1 : return("MN1");
  }      
  return ("ERR");
}


//+---------------

double prOpen( int i, int j)
{
  return (iOpen(NULL,i,j));
}
//+---------------
double prHigh( int i, int j)
{
  return (iHigh(NULL,i,j));
}
//+---------------


double prLow( int i, int j)
{
  return (iLow(NULL,i,j));
}
//+---------------
double prClose( int i, int j)
{
  return (iClose(NULL,i,j));
}
//+---------------
/*
double prRange( int i, int j)
{
  double _Range = ( iHigh(NULL,i,j) - iLow(NULL,i,j) ) ;
  return (_Range);
}
//+---------------
double prMid( int i, int j)
{
  double _Mid = ( iHigh(NULL,i,j) + iLow(NULL,i,j) ) * 0.5 ;
  return (_Mid);
}
//+---------------

*/


int start() 
  { 
   double xhigh1        = prHigh( myPeriod1, 1 );
   double xlow1         = prLow( myPeriod1, 1 );
   double xclose1       = prClose( myPeriod1, 0 ); 
   double xopen1        = prOpen( myPeriod1, 0 ); 
   double xmid1         = ( xhigh1 + xlow1 ) * 0.5 ;
   double xrange1       = xhigh1 - xlow1 ; 

   double xhigh2        = prHigh( myPeriod2, 1 );
   double xlow2         = prLow( myPeriod2, 1 );
   double xclose2       = prClose( myPeriod2, 0 ); 
   double xopen2        = prOpen( myPeriod2, 0 ); 
   double xmid2         = ( xhigh2 + xlow2 ) * 0.5 ;
   double xrange2       = xhigh2 - xlow2 ;
   
   double xhigh3        = prHigh( myPeriod3, 1 );
   double xlow3         = prLow( myPeriod3, 1 );
   double xclose3       = prClose( myPeriod3, 0 ); 
   double xopen3        = prOpen( myPeriod3, 0 ); 
   double xmid3         = ( xhigh3 + xlow3 ) * 0.5 ; 
   double xrange3       = xhigh3 - xlow3 ; 

   double xhigh4        = prHigh( myPeriod4, 1 );
   double xlow4         = prLow( myPeriod4, 1 );
   double xclose4       = prClose( myPeriod4, 0 ); 
   double xopen4        = prOpen( myPeriod4, 0 ); 
   double xmid4         = ( xhigh4 + xlow4 ) * 0.5 ;
   double xrange4       = xhigh4 - xlow4  ;
   
   double xhigh5        = prHigh( myPeriod5, 1 );
   double xlow5         = prLow( myPeriod5, 1 );
   double xclose5       = prClose( myPeriod5, 0 ); 
   double xopen5        = prOpen( myPeriod5, 0 ); 
   double xmid5         = ( xhigh5 + xlow5 ) * 0.5 ; 
   double xrange5       = xhigh5 - xlow5 ; 

   double xhigh6        = prHigh( myPeriod6, 1 );
   double xlow6         = prLow( myPeriod6, 1 );
   double xclose6       = prClose( myPeriod6, 0 ); 
   double xopen6        = prOpen( myPeriod6, 0 ); 
   double xmid6         = ( xhigh6 + xlow6 ) * 0.5 ; 
   double xrange6       = xhigh6 - xlow6 ;

   double xhigh7        = prHigh( myPeriod7, 1 );
   double xlow7         = prLow( myPeriod7, 1 );
   double xclose7       = prClose( myPeriod7, 0 ); 
   double xopen7        = prOpen( myPeriod7, 0 ); 
   double xmid7         = ( xhigh7 + xlow7 ) * 0.5 ;
   double xrange7       = xhigh7 - xlow7 ;  
   
   double xfib1        = (xclose1 - xlow1 ) / xrange1 ;
   double xfib2        = (xclose2 - xlow2 ) / xrange2 ;     
   double xfib3        = (xclose3 - xlow3 ) / xrange3 ;
   double xfib4        = (xclose4 - xlow4 ) / xrange4 ;     
   double xfib5        = (xclose5 - xlow5 ) / xrange5 ;
   double xfib6        = (xclose6 - xlow6 ) / xrange6 ;     
   double xfib7        = (xclose7 - xlow7 ) / xrange7 ;
 
      


   objectBlank();   
   paintCol1(xfib1);  
   paintCol2(xfib2);  
   paintCol3(xfib3);  
   paintCol4(xfib4);    
   paintCol5(xfib5); 
   paintCol6(xfib6);    
   paintCol7(xfib7); 


    
   paintLine();
   
   
   
 
//---- 
   return(0); 
  } 
//+------------------------------------------------------------------+ 


void initGraph()
  {
   deleteObject();

   objectCreate("Fib1_0",130,51);
   objectCreate("Fib1_1",130,43);
   objectCreate("Fib1_2",130,35);
   objectCreate("Fib1_3",130,27);
   objectCreate("Fib1_4",130,19);   
   objectCreate("Fib1_5",130,11);
   objectCreate("Fib1",132,12,Period2Text(myPeriod1),7,"Arial Narrow",SkyBlue);
   objectCreate("Fib1p",134,21,DoubleToStr(9,1),8,"Arial Narrow",Silver);   
   
   objectCreate("Fib2_0",110,51);
   objectCreate("Fib2_1",110,43);
   objectCreate("Fib2_2",110,35);
   objectCreate("Fib2_3",110,27);
   objectCreate("Fib2_4",110,19);  
   objectCreate("Fib2_5",110,11);
   objectCreate("Fib2",112,12,Period2Text(myPeriod2),7,"Arial Narrow",SkyBlue);
   objectCreate("Fib2p",114,21,DoubleToStr(9,1),8,"Arial Narrow",Silver);

   objectCreate("Fib3_0",90,51);
   objectCreate("Fib3_1",90,43);
   objectCreate("Fib3_2",90,35);
   objectCreate("Fib3_3",90,27);
   objectCreate("Fib3_4",90,19);  
   objectCreate("Fib3_5",90,11);
   objectCreate("Fib3",92,12,Period2Text(myPeriod3),7,"Arial Narrow",SkyBlue);
   objectCreate("Fib3p",94,21,DoubleToStr(9,1),8,"Arial Narrow",Silver);

   objectCreate("Fib4_0",70,51);
   objectCreate("Fib4_1",70,43);
   objectCreate("Fib4_2",70,35);
   objectCreate("Fib4_3",70,27);
   objectCreate("Fib4_4",70,19);     
   objectCreate("Fib4_5",70,11);
   objectCreate("Fib4",72,12,Period2Text(myPeriod4),7,"Arial Narrow",SkyBlue);
   objectCreate("Fib4p",74,21,DoubleToStr(9,1),8,"Arial Narrow",Silver);
   
   objectCreate("Fib5_0",50,51);
   objectCreate("Fib5_1",50,43);
   objectCreate("Fib5_2",50,35);
   objectCreate("Fib5_3",50,27);
   objectCreate("Fib5_4",50,19);
   objectCreate("Fib5_5",50,11);
   objectCreate("Fib5",52,12,Period2Text(myPeriod5),7,"Arial Narrow",SkyBlue);
   objectCreate("Fib5p",54,21,DoubleToStr(9,1),8,"Arial Narrow",Silver);
   
   objectCreate("Fib6_0",30,51);
   objectCreate("Fib6_1",30,43);
   objectCreate("Fib6_2",30,35);
   objectCreate("Fib6_3",30,27);
   objectCreate("Fib6_4",30,19);     
   objectCreate("Fib6_5",30,11);
   objectCreate("Fib6",32,12,Period2Text(myPeriod6),7,"Arial Narrow",SkyBlue);
   objectCreate("Fib6p",34,21,DoubleToStr(9,1),8,"Arial Narrow",Silver);

   objectCreate("Fib7_0",10,51);
   objectCreate("Fib7_1",10,43);
   objectCreate("Fib7_2",10,35);
   objectCreate("Fib7_3",10,27);
   objectCreate("Fib7_4",10,19);    
   objectCreate("Fib7_5",10,11);
   objectCreate("Fib7",13,12,Period2Text(myPeriod7),7,"Arial Narrow",SkyBlue);
   objectCreate("Fib7p",14,21,DoubleToStr(9,1),8,"Arial Narrow",Silver);
   
   
   objectCreate("line97",10,100,"-----------------------------------",10,"Arial",DimGray);
   objectCreate("sign",11,1,"»»» FIB MULTI © «««",8,"Arial Narrow",DimGray);
  }   
  
//+------------------------------------------------------------------+
void objectCreate(string name,int x,int y,string text="-",int size=42,
                  string font="Arial",color colour=CLR_NONE)
  {
   ObjectCreate(name,OBJ_LABEL,0,0,0);
   ObjectSet(name,OBJPROP_CORNER,3);
   ObjectSet(name,OBJPROP_COLOR,colour);
   ObjectSet(name,OBJPROP_XDISTANCE,x);
   ObjectSet(name,OBJPROP_YDISTANCE,y);
   ObjectSetText(name,text,size,font,colour);
  }
  
void deleteObject()
  {  

   ObjectDelete("Fib1_0"); 
   ObjectDelete("Fib1_1");
   ObjectDelete("Fib1_2");
   ObjectDelete("Fib1_3");
   ObjectDelete("Fib1_4");  
   ObjectDelete("Fib1_5");
   ObjectDelete("Fib1");
   ObjectDelete("Fib1p");

   ObjectDelete("Fib2_0"); 
   ObjectDelete("Fib2_1");
   ObjectDelete("Fib2_2");
   ObjectDelete("Fib2_3");
   ObjectDelete("Fib2_4");     
   ObjectDelete("Fib2_5");
   ObjectDelete("Fib2");
   ObjectDelete("Fib2p");
 
   ObjectDelete("Fib3_0"); 
   ObjectDelete("Fib3_1");
   ObjectDelete("Fib3_2");
   ObjectDelete("Fib3_3");
   ObjectDelete("Fib3_4");     
   ObjectDelete("Fib3_5");
   ObjectDelete("Fib3");
   ObjectDelete("Fib3p");
 
   ObjectDelete("Fib4_0"); 
   ObjectDelete("Fib4_1");
   ObjectDelete("Fib4_2");
   ObjectDelete("Fib4_3");
   ObjectDelete("Fib4_4");  
   ObjectDelete("Fib4_5");
   ObjectDelete("Fib4");
   ObjectDelete("Fib4p");
 
   ObjectDelete("Fib5_0"); 
   ObjectDelete("Fib5_1");
   ObjectDelete("Fib5_2");
   ObjectDelete("Fib5_3");
   ObjectDelete("Fib5_4");    
   ObjectDelete("Fib5_5");
   ObjectDelete("Fib5");
   ObjectDelete("Fib5p"); 
 
   ObjectDelete("Fib6_0"); 
   ObjectDelete("Fib6_1");
   ObjectDelete("Fib6_2");
   ObjectDelete("Fib6_3");
   ObjectDelete("Fib6_4");      
   ObjectDelete("Fib6_5");
   ObjectDelete("Fib6");
   ObjectDelete("Fib6p");
 
   ObjectDelete("Fib7_0"); 
   ObjectDelete("Fib7_1");
   ObjectDelete("Fib7_2");
   ObjectDelete("Fib7_3");
   ObjectDelete("Fib7_4");     
   ObjectDelete("Fib7_5");
   ObjectDelete("Fib7");
   ObjectDelete("Fib7p");
   
  }
  
void objectBlank()
  {
  
   ObjectSet("Fib1_0",OBJPROP_COLOR,CLR_NONE); 
   ObjectSet("Fib1_1",OBJPROP_COLOR,CLR_NONE);
   ObjectSet("Fib1_2",OBJPROP_COLOR,CLR_NONE);
   ObjectSet("Fib1_3",OBJPROP_COLOR,CLR_NONE);
   ObjectSet("Fib1_4",OBJPROP_COLOR,CLR_NONE);
   ObjectSet("Fib1_5",OBJPROP_COLOR,CLR_NONE);
   ObjectSet("Fib1",OBJPROP_COLOR,CLR_NONE);
   ObjectSet("Fib1p",OBJPROP_COLOR,CLR_NONE);

   ObjectSet("Fib2_0",OBJPROP_COLOR,CLR_NONE); 
   ObjectSet("Fib2_1",OBJPROP_COLOR,CLR_NONE);
   ObjectSet("Fib2_2",OBJPROP_COLOR,CLR_NONE);
   ObjectSet("Fib2_3",OBJPROP_COLOR,CLR_NONE);
   ObjectSet("Fib2_4",OBJPROP_COLOR,CLR_NONE);
   ObjectSet("Fib2_5",OBJPROP_COLOR,CLR_NONE);
   ObjectSet("Fib2",OBJPROP_COLOR,CLR_NONE);
   ObjectSet("Fib2p",OBJPROP_COLOR,CLR_NONE);

   ObjectSet("Fib3_0",OBJPROP_COLOR,CLR_NONE); 
   ObjectSet("Fib3_1",OBJPROP_COLOR,CLR_NONE);
   ObjectSet("Fib3_2",OBJPROP_COLOR,CLR_NONE);
   ObjectSet("Fib3_3",OBJPROP_COLOR,CLR_NONE);
   ObjectSet("Fib3_4",OBJPROP_COLOR,CLR_NONE);
   ObjectSet("Fib3_5",OBJPROP_COLOR,CLR_NONE);
   ObjectSet("Fib3",OBJPROP_COLOR,CLR_NONE);
   ObjectSet("Fib3p",OBJPROP_COLOR,CLR_NONE);

   ObjectSet("Fib4_0",OBJPROP_COLOR,CLR_NONE); 
   ObjectSet("Fib4_1",OBJPROP_COLOR,CLR_NONE);
   ObjectSet("Fib4_2",OBJPROP_COLOR,CLR_NONE);
   ObjectSet("Fib4_3",OBJPROP_COLOR,CLR_NONE);
   ObjectSet("Fib4_4",OBJPROP_COLOR,CLR_NONE);
   ObjectSet("Fib4_5",OBJPROP_COLOR,CLR_NONE);
   ObjectSet("Fib4",OBJPROP_COLOR,CLR_NONE);
   ObjectSet("Fib4p",OBJPROP_COLOR,CLR_NONE);

   ObjectSet("Fib5_0",OBJPROP_COLOR,CLR_NONE); 
   ObjectSet("Fib5_1",OBJPROP_COLOR,CLR_NONE);
   ObjectSet("Fib5_2",OBJPROP_COLOR,CLR_NONE);
   ObjectSet("Fib5_3",OBJPROP_COLOR,CLR_NONE);
   ObjectSet("Fib5_4",OBJPROP_COLOR,CLR_NONE);
   ObjectSet("Fib5_5",OBJPROP_COLOR,CLR_NONE);
   ObjectSet("Fib5",OBJPROP_COLOR,CLR_NONE);
   ObjectSet("Fib5p",OBJPROP_COLOR,CLR_NONE);

   ObjectSet("Fib6_0",OBJPROP_COLOR,CLR_NONE); 
   ObjectSet("Fib6_1",OBJPROP_COLOR,CLR_NONE);
   ObjectSet("Fib6_2",OBJPROP_COLOR,CLR_NONE);
   ObjectSet("Fib6_3",OBJPROP_COLOR,CLR_NONE);
   ObjectSet("Fib6_4",OBJPROP_COLOR,CLR_NONE);    
   ObjectSet("Fib6_5",OBJPROP_COLOR,CLR_NONE);
   ObjectSet("Fib6",OBJPROP_COLOR,CLR_NONE);
   ObjectSet("Fib6p",OBJPROP_COLOR,CLR_NONE);

   ObjectSet("Fib7_0",OBJPROP_COLOR,CLR_NONE); 
   ObjectSet("Fib7_1",OBJPROP_COLOR,CLR_NONE);
   ObjectSet("Fib7_2",OBJPROP_COLOR,CLR_NONE);
   ObjectSet("Fib7_3",OBJPROP_COLOR,CLR_NONE);
   ObjectSet("Fib7_4",OBJPROP_COLOR,CLR_NONE);   
   ObjectSet("Fib7_5",OBJPROP_COLOR,CLR_NONE);
   ObjectSet("Fib7",OBJPROP_COLOR,CLR_NONE);
   ObjectSet("Fib7p",OBJPROP_COLOR,CLR_NONE);      
   
   ObjectSet("line98",OBJPROP_COLOR,CLR_NONE);
   ObjectSet("line97",OBJPROP_COLOR,CLR_NONE); 
  }
  
void paintCol1(double value)
  {
  
// 0.146 - 0.236 - 0.382 - 0.5 - 0.618 - 0.764 - 0.854 - 1.0 - 1.236 - 1.618 - 4.236

   if (value > v5) ObjectSet("Fib1_5",OBJPROP_COLOR,Red);
   if (value > v4) ObjectSet("Fib1_4",OBJPROP_COLOR,Orange);
   if (value > v3) ObjectSet("Fib1_3",OBJPROP_COLOR,Gold);   
   if (value > v2) ObjectSet("Fib1_2",OBJPROP_COLOR,Yellow);
   if (value > v1) ObjectSet("Fib1_1",OBJPROP_COLOR,YellowGreen);
   if (value > v0) ObjectSet("Fib1_0",OBJPROP_COLOR,Lime);   
   ObjectSet("Fib1",OBJPROP_COLOR,SkyBlue);
   ObjectSetText("Fib1p",DoubleToStr(value*100,0),8,"Arial Narrow",Silver);
   GlobalVariableSet("Fib1",value);
  }
  
void paintCol2(double value)
  {
   if (value > v5) ObjectSet("Fib2_5",OBJPROP_COLOR,Red);
   if (value > v4) ObjectSet("Fib2_4",OBJPROP_COLOR,Orange);
   if (value > v3) ObjectSet("Fib2_3",OBJPROP_COLOR,Gold);   
   if (value > v2) ObjectSet("Fib2_2",OBJPROP_COLOR,Yellow);
   if (value > v1) ObjectSet("Fib2_1",OBJPROP_COLOR,YellowGreen);
   if (value > v0) ObjectSet("Fib2_0",OBJPROP_COLOR,Lime);    
   ObjectSet("Fib2",OBJPROP_COLOR,SkyBlue);
   ObjectSetText("Fib2p",DoubleToStr(value*100,0),8,"Arial Narrow",Silver);
   GlobalVariableSet("Fib2",value);
  }


void paintCol3(double value)
  {
   if (value > v5) ObjectSet("Fib3_5",OBJPROP_COLOR,Red);
   if (value > v4) ObjectSet("Fib3_4",OBJPROP_COLOR,Orange);
   if (value > v3) ObjectSet("Fib3_3",OBJPROP_COLOR,Gold);   
   if (value > v2) ObjectSet("Fib3_2",OBJPROP_COLOR,Yellow);
   if (value > v1) ObjectSet("Fib3_1",OBJPROP_COLOR,YellowGreen);
   if (value > v0) ObjectSet("Fib3_0",OBJPROP_COLOR,Lime);    
   ObjectSet("Fib3",OBJPROP_COLOR,SkyBlue);
   ObjectSetText("Fib3p",DoubleToStr(value*100,0),8,"Arial Narrow",Silver);
   GlobalVariableSet("Fib3",value);
  }

void paintCol4(double value)
  {
   if (value > v5) ObjectSet("Fib4_5",OBJPROP_COLOR,Red);
   if (value > v4) ObjectSet("Fib4_4",OBJPROP_COLOR,Orange);
   if (value > v3) ObjectSet("Fib4_3",OBJPROP_COLOR,Gold);   
   if (value > v2) ObjectSet("Fib4_2",OBJPROP_COLOR,Yellow);
   if (value > v1) ObjectSet("Fib4_1",OBJPROP_COLOR,YellowGreen);
   if (value > v0) ObjectSet("Fib4_0",OBJPROP_COLOR,Lime);     
   ObjectSet("Fib4",OBJPROP_COLOR,SkyBlue);
   ObjectSetText("Fib4p",DoubleToStr(value*100,0),8,"Arial Narrow",Silver);
   GlobalVariableSet("Fib4",value);
  }

void paintCol5(double value)
  {
   if (value > v5) ObjectSet("Fib5_5",OBJPROP_COLOR,Red);
   if (value > v4) ObjectSet("Fib5_4",OBJPROP_COLOR,Orange);
   if (value > v3) ObjectSet("Fib5_3",OBJPROP_COLOR,Gold);   
   if (value > v2) ObjectSet("Fib5_2",OBJPROP_COLOR,Yellow);
   if (value > v1) ObjectSet("Fib5_1",OBJPROP_COLOR,YellowGreen);
   if (value > v0) ObjectSet("Fib5_0",OBJPROP_COLOR,Lime);     
   ObjectSet("Fib5",OBJPROP_COLOR,SkyBlue);
   ObjectSetText("Fib5p",DoubleToStr(value*100,0),8,"Arial Narrow",Silver);
   GlobalVariableSet("Fib5",value);
  }

void paintCol6(double value)
  {
   if (value > v5) ObjectSet("Fib6_5",OBJPROP_COLOR,Red);
   if (value > v4) ObjectSet("Fib6_4",OBJPROP_COLOR,Orange);
   if (value > v3) ObjectSet("Fib6_3",OBJPROP_COLOR,Gold);   
   if (value > v2) ObjectSet("Fib6_2",OBJPROP_COLOR,Yellow);
   if (value > v1) ObjectSet("Fib6_1",OBJPROP_COLOR,YellowGreen);
   if (value > v0) ObjectSet("Fib6_0",OBJPROP_COLOR,Lime);    
   ObjectSet("Fib6",OBJPROP_COLOR,SkyBlue);
   ObjectSetText("Fib6p",DoubleToStr(value*100,0),8,"Arial Narrow",Silver);
   GlobalVariableSet("Fib6",value);
  }

void paintCol7(double value)
  {
   if (value > v5) ObjectSet("Fib7_5",OBJPROP_COLOR,Red);
   if (value > v4) ObjectSet("Fib7_4",OBJPROP_COLOR,Orange);
   if (value > v3) ObjectSet("Fib7_3",OBJPROP_COLOR,Gold);   
   if (value > v2) ObjectSet("Fib7_2",OBJPROP_COLOR,Yellow);
   if (value > v1) ObjectSet("Fib7_1",OBJPROP_COLOR,YellowGreen);
   if (value > v0) ObjectSet("Fib7_0",OBJPROP_COLOR,Lime);   
   ObjectSet("Fib7",OBJPROP_COLOR,SkyBlue);
   ObjectSetText("Fib7p",DoubleToStr(value*100,0),8,"Arial Narrow",Silver);
   GlobalVariableSet("Fib7",value);
  }
  

  
void paintLine()
  {
   ObjectSet("line98",OBJPROP_COLOR,DimGray);
   ObjectSet("line97",OBJPROP_COLOR,DimGray);
  }