//+------------------------------------------------------------------+
//|                        -------Symbol Of Chart Expanded------.mq4 |
//|                      Copyright © 2011, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2011, TraderNeal Neal Vanderstelt traderneal@gmail.com"
#property link      "http://forexindicators-metrader.blogspot.com/"

#property indicator_chart_window

//1st object for symbol

extern string font = "Barred Out";
extern color  FontColor = Yellow;
extern int size=30;
extern int WhatCorner=1;
extern int x_distance=47;
extern int y_distance=36;
extern int whichwindow=0;

//2nd object for timeframe
extern string font2 = "Arabic Typesetting";
extern color  FontColor2 = Aqua;
extern int size2=24;
extern int WhatCorner2=1;
extern int x_distance2=64;
extern int y_distance2=112;
extern int whichwindow2=0;
int alertcount=0;
int init()
  {
  
//---- indicators
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   ObjectDelete("current_symbol_11");
   ObjectDelete("current_Period_11");
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
if (NewBar()){alertcount=0;}   
if (alertcount == 0)
{  
  Comment("");
   int    counted_bars=IndicatorCounted();
 //string period = Period();  
 string period = DoubleToStr(Period(), Digits);
 period = Period();
 string symbol = Symbol();
 if(period == "1440")
 {period = "Daily Chart ";}
 if(period == "240")
 {period = "4Hour Chart";}
 if(period == "60")
 {period = "1Hour Chart";}
 if(period == "30")
 {period = "30Min Chart";}
 if(period == "15")
 {period = "15Min Chart";}
 if(period == "5")
 {period = "5Min Chart";}
 if(period == "1")
 {period = "1Min Chart";}
 if(period == "10080")
 {period = "     Weekly Chart";}
 if(period == "43200")
 {period = "        Monthly Chart";}
 
 ObjectCreate("current_symbol_11", OBJ_LABEL, whichwindow, 0, 0);
 ObjectSetText("current_symbol_11",(symbol), size, font, FontColor);
 ObjectSet("current_symbol_11", OBJPROP_CORNER, WhatCorner);
 ObjectSet("current_symbol_11", OBJPROP_XDISTANCE, x_distance);
 ObjectSet("current_symbol_11", OBJPROP_YDISTANCE, y_distance); 

//
 ObjectCreate("current_Period_11", OBJ_LABEL, whichwindow2, 0, 0);
 ObjectSetText("current_Period_11",(period), size2, font2, FontColor2);
 ObjectSet("current_Period_11", OBJPROP_CORNER, WhatCorner2);
 ObjectSet("current_Period_11", OBJPROP_XDISTANCE, x_distance2);
 ObjectSet("current_Period_11", OBJPROP_YDISTANCE, y_distance2); 
//----
   
//----
}
   return(0);
  }
//::::::end of line::::::::
//::::::::::NEWBAR FUNCTION:::::::::::::  
bool NewBar()
{
   static datetime lastbar;
   datetime curbar = Time[0];
   if(lastbar!=curbar)
   {
      lastbar=curbar;
      return (true);
   }
   else
   {
      return(false);
   }
}   
//::::::::::::::::::::::::::::::::::::::