/////////////////////////////////////////////////////////////////////////////
#property indicator_chart_window
#property indicator_plots 0
/////////////////////////////////////////////////////////////////////////////
enum Fonts
{
  a, // Arial
  b  // Segoe UI
};
/////////////////////////////////////////////////////////////////////////////
input int               WindowNumber         = 0;								// Window
input ENUM_BASE_CORNER  Corner               = CORNER_RIGHT_LOWER;		// Corner
input int               Left_Right           = 5;								// Horizontal shift
input int               Up_Down              = 5;								// Vertical shift
input color             Color                = clrGold;						// Font Color
input Fonts             Font                 = b;                       // Font
input int               FontSize             = 20;								// Font Size
input bool              FontBold             = false;							// Font is Bold?
input bool              usecustomfont        = false;							// Use Custom Font?
input string            customfont           = "Cambria";					// Custom Font
/////////////////////////////////////////////////////////////////////////////
#define obj "iSymbol_TF"
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   if(ObjectFind(0,obj) == -1){
//---
// https://www.mql5.com/en/docs/constants/objectconstants/enum_basecorner#enum_base_corner
// https://www.mql5.com/en/docs/constants/objectconstants/enum_anchorpoint#enum_anchor_point
   ENUM_ANCHOR_POINT anchpoint = -1;
	switch(Corner){
		case 0 : anchpoint = 0; break;
		case 1 : anchpoint = 2; break;
		case 2 : anchpoint = 4; break;
		case 3 : anchpoint = 6;}
//---
	ObjectCreate    (0,obj,OBJ_LABEL,WindowNumber,0,0);
	ObjectSetInteger(0,obj,OBJPROP_XDISTANCE,Left_Right);
	ObjectSetInteger(0,obj,OBJPROP_YDISTANCE, Corner == 1 || Corner == 2 ? Up_Down : Up_Down - 5);
	ObjectSetInteger(0,obj,OBJPROP_CORNER,Corner);
	ObjectSetInteger(0,obj,OBJPROP_ANCHOR,anchpoint);
	ObjectSetString (0,obj,OBJPROP_FONT,usecustomfont && customfont != "" && customfont != NULL ? customfont : (Font == a ? "Arial" : "Segoe UI") + (FontBold ? " Black" : ""));
	ObjectSetInteger(0,obj,OBJPROP_FONTSIZE,FontSize);
	ObjectSetInteger(0,obj,OBJPROP_COLOR,Color);
	ObjectSetInteger(0,obj,OBJPROP_SELECTABLE,false);
	ObjectSetInteger(0,obj,OBJPROP_HIDDEN,true);
	ObjectSetInteger(0,obj,OBJPROP_BACK,false);}
//---
	ObjectSetString (0,obj,OBJPROP_TEXT,_Symbol + " " + StringSubstr(EnumToString(_Period),7));
	ChartRedraw();
   return INIT_SUCCEEDED;
  }
//+------------------------------------------------------------------+
// https://www.mql5.com/en/docs/event_handlers/ondeinit
void OnDeinit(const int reason)
  {
	if(reason != 3 && reason != 6 && reason != 9){
	ObjectDelete(0,obj);
	ChartRedraw();}
  }
//+------------------------------------------------------------------+
int OnCalculate(const int     rates_total,
                const int     prev_calculated,
                const int     begin,
                const double& price[])
  {
   return 0;
  }
//+------------------------------------------------------------------+
