Indicators: Symbol Name On Chart

 

Symbol Name On Chart:

Pretty simple. Seems Stupid. But yes, You need this...

Symbol Name On Chart

Author: Minions Labs

Symbol Name On Chart
Symbol Name On Chart
  • www.mql5.com
Another request from my brotherhood was putting the name of the Symbol being seen - a little bigger - on the Chart, just to get sure that they are seeing the correct one... Mistakes pay a high price on the market... Re-using the previous code from the Simple Server Clock, we re-coded it into a single, very effective, and almost...
 
Automated-Trading:

Symbol Name On Chart:

Author: Minions Labs

string TT, TP;


//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
{  
   if(_Period < PERIOD_H1)
   {
     TT = "M";
     TP = IntegerToString(Period());
   }
   else if(_Period == PERIOD_H1)
   {
      TT = "H1";    
   }
   else if(_Period == PERIOD_H2)
   {
      TT = "H2";    
   }
   else if(_Period == PERIOD_H3)
   {
      TT = "H3";   
   } 
   else if(_Period == PERIOD_H4)
   {
      TT = "H4";   
   }
   else if(_Period == PERIOD_H6)
   {
      TT = "H6";  
   }
   else if(_Period == PERIOD_H8)
   {
      TT = "H8";
   }
   else if(_Period == PERIOD_H12)
   {
      TT = "H12";    
   } 
   else if(_Period == PERIOD_D1)
   {
     TT = "D1";
   }
   else if(_Period == PERIOD_W1)
   {
     TT = "W1";
   }
   else 
   {
     TT = "MN";
   }   
  
   return(INIT_SUCCEEDED);
}
  
void OnDeinit(const int reason)
{
   ObjectDelete(0, "STF");  
}    

int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
{
   ObjectCreate(0, "STF", OBJ_LABEL, 0, 0, 0, 0, 0, 0, 0);
   ObjectSetString(0, "STF", OBJPROP_TEXT, _Symbol +  " - " + TT + TP); 
 
please tell me which line to add
Reason: