//+------------------------------------------------------------------+ 
//|   TRO_MyNotes                                                    | 
//|                                                                  | 
//|   Copyright © 2008, Avery T. Horton, Jr. aka TheRumpledOne       |
//|                                                                  |
//|   PO BOX 43575, TUCSON, AZ 85733                                 |
//|                                                                  |
//|   GIFTS AND DONATIONS ACCEPTED                                   | 
//|   All my indicators should be considered donationware. That is   |
//|   you are free to use them for your personal use, and are        |
//|   under no obligation to pay for them. However, if you do find   |
//|   this or any of my other indicators help you with your trading  |
//|   then any Gift or Donation as a show of appreciation is         |
//|   gratefully accepted.                                           |
//|                                                                  |
//|   Gifts or Donations also keep me motivated in producing more    |
//|   great free indicators. :-)                                     |
//|                                                                  |
//|   PayPal - THERUMPLEDONE@GMAIL.COM                               |  
//+------------------------------------------------------------------+  
 

//----
#property indicator_chart_window

extern bool Show.Notes = true ;

extern int myChartX   = 10 ;
extern int myChartY   = 600 ;
extern int myCorner   = 0 ;
extern string myFont  = "Arial Bold" ;
extern int myFontSize = 20 ;
extern color colorHead  = DarkGray ;
 

extern string myNote01 = "GO SHORT AT THE MAGENTA COLORED DOT" ;
extern string myNote02 = "" ;
extern string myNote03 = "GO LONG AT THE AQUA COLORED DOT" ;
extern string myNote04 = "" ;
extern string myNote05 = "" ;
extern string myNote06 = "THIS SHOULD END ANY CONFUSION" ;
extern string myNote07 = "" ;
extern string myNote08 = "" ;
extern string myNote09 = "" ;
extern string myNote10 = "" ;

extern color myColor01 = Magenta ;
extern color myColor02 = Orange ;
extern color myColor03 = Aqua ;
extern color myColor04 = Orange ;
extern color myColor05 = Orange ;
extern color myColor06 = Orange ;
extern color myColor07 = Orange ;
extern color myColor08 = Orange ;
extern color myColor09 = Orange ;
extern color myColor10 = Orange ;

string symbol, tChartPeriod, ShortName ;  

int    glimit, digits, period, win, digits2, n, j, i, k, g; 
 
double point, point2, value ;
string lbl[15], lbl2[15];

//---- PipsToOpen
string Indicator_Name = "MyNotes:" ;
int Objs = 0;

//+------------------------------------------------------------------+ 
int     ind_bufferOp[] ;
string shortName ;
int    cpairsLenH;
int    cpairsLenV;
int    shortLength;
int    ctimesLen;
string cpairsh[];
string cpairsv[];
int    aTimes[];
string addition  = "";


 
double gap, high0, low0, open1, close1, open0, close0, diff, spread, DailyOpen, xPsycho, xPrice, xdiff, bid, ask  ; 
 
color colorPair ; 
 

int GapUp       = 0 ;
int GapDn       = 0 ;

int GapUpFilled  = 0 ;
int GapDnFilled  = 0 ; 

double GapUpFillPct = 0 ;
double GapDnFillPct = 0 ; 

double GapUpMin = 9999999 ;
double GapDnMin = 9999999 ; 

double GapUpMax = 0 ;
double GapDnMax = 0 ; 

double GapUpAvg = 0 ;
double GapDnAvg = 0 ; 
 

 
string comm01, comm02, comm03, comm04, comm05, comm06, comm07, comm08, comm09 ; 
string commL01 = "gs01", commL02 = "gs02", commL03 = "gs03", commL04 = "gs04", commL05 = "gs05", commL06 = "gs06", commL07 = "gs07", commL08 = "gs08", commL09 = "gs09"; 
//+------------------------------------------------------------------+
int init()
  {
  
   period = Period() ; 
   
   tChartPeriod =  TimeFrameToString(period) ;
   symbol       =  Symbol() ;
   digits       =  Digits ;
   point        =  Point ;
   ShortName    =  tChartPeriod + "MyNotes" ;
   win          =  1 ;

   if(digits == 5 || digits == 3) { digits2 = 0 ; point = point * 10 ; } else { digits2 = 0 ; }

 
      shortName   = ShortName ;
      shortLength = StringLen(shortName);
      IndicatorShortName(shortName);
 
deinit() ;

if( Show.Notes ) {DoHelp () ;  }


   return(0);
  }
 
//+------------------------------------------------------------------+
int deinit()
  {
//----

for( int h = 0 ; h < 10 ; h++ )
{
   ObjectDelete("aHelp"+h) ;
}
   
//----
   return(0);
  }
 
//+------------------------------------------------------------------+
int start()
{



WindowRedraw() ;   


   return(0);
}
//+------------------------------------------------------------------+
string TimeFrameToString(int tf)
{
   string tfs;
   switch(tf) {
      case PERIOD_M1:  tfs="M1"  ; break;
      case PERIOD_M5:  tfs="M5"  ; break;
      case PERIOD_M15: tfs="M15" ; break;
      case PERIOD_M30: tfs="M30" ; break;
      case PERIOD_H1:  tfs="H1"  ; break;
      case PERIOD_H4:  tfs="H4"  ; break;
      case PERIOD_D1:  tfs="D1"  ; break;
      case PERIOD_W1:  tfs="W1"  ; break;
      case PERIOD_MN1: tfs="MN";
   }
   return(tfs);
}


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



void DoHelp()
{



string aHelp[10];
color aColor[10];



aHelp[0] =  myNote01 ;
aHelp[1] =  myNote02 ;
aHelp[2] =  myNote03 ;
aHelp[3] =  myNote04 ;
aHelp[4] =  myNote05 ;
aHelp[5] =  myNote06 ;
aHelp[6] =  myNote07 ;
aHelp[7] =  myNote08 ;
aHelp[8] =  myNote09 ;
aHelp[9] =  myNote10 ;

aColor[0] =  myColor01 ;
aColor[1] =  myColor02 ;
aColor[2] =  myColor03 ;
aColor[3] =  myColor04 ;
aColor[4] =  myColor05 ;
aColor[5] =  myColor06 ;
aColor[6] =  myColor07 ;
aColor[7] =  myColor08 ;
aColor[8] =  myColor09 ;
aColor[9] =  myColor10 ;


ArrayResize(aHelp,11) ;
ArrayResize(aColor,11) ;

for( int h = 0 ; h < 10 ; h++ )
{
   int yAxis =  myChartY + myFontSize + myFontSize*h;
   int xAxis =  myChartX + 10 ;
   
  if(aHelp[h] != "") { drawComment("aHelp"+h,aHelp[h] , xAxis , yAxis , aColor[h]  ) ; }
} 

}

//+------------------------------------------------------------------+  
 
void drawComment(string tLabel,string name, int xPos, int yPos ,color Color  )
{

ObjectCreate(tLabel,23,0,Time[0],PRICE_CLOSE);
ObjectSet(tLabel, OBJPROP_CORNER, myCorner );
ObjectSet(tLabel,OBJPROP_XDISTANCE,xPos);
ObjectSet(tLabel,OBJPROP_YDISTANCE,yPos);
ObjectSetText(tLabel,name,myFontSize,myFont,Color); 
}

//+------------------------------------------------------------------+ 
/*

*/