Author: Copyright � 2009, Yuriy Tokman
ytg_1

This script is a specialized visual tool designed for the MetaTrader platform. Its primary function is to dynamically display and update text information directly on your trading chart interface.

Core Functionality

The tool serves as an automated label generator. Instead of a static piece of information, it creates a dynamic text display that changes its visual appearance—specifically its typography—over time. It is designed to cycle through different font styles automatically, providing a decorative and informative overlay on the price chart.

How it Works

  • Dynamic Font Cycling: The script contains an internal sequence of various professional fonts (such as Georgia, Tahoma, Arial Black, and several stylized "LET" fonts). It is programmed to rotate through these styles automatically as new data updates occur on the chart.
  • Automatic Label Management: Every time the market moves or updates, the script checks for its existing text label. If it finds one, it refreshes it; if not, it creates a new one. This ensures that the information remains visible and correctly positioned without cluttering the workspace.
  • Customized Positioning: The script is hard-coded to place the text in a specific location on your screen (the top right area). It handles the coordinates and the size of the text automatically, ensuring consistent placement regardless of how you resize your window.
  • Visual Customization: The text is set to appear in a distinct red color with a specific font size, making it easily readable against standard trading backgrounds while allowing the visual style to shift periodically.

User Experience

For the trader, this means that a specific information label will remain constant in its location on your screen, but you will notice the "look and feel" of the text change automatically as it cycles through different artistic styles. It is a clean, automated way to personalize your chart's dashboard area.

16 Views
0 Downloads
0 Favorites
ytg_1
//+------------------------------------------------------------------+
//|                                                        ytg_1.mq4 |
//|                                   Copyright © 2009, Yuriy Tokman |
//|                                            yuriytokman@gmail.com |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2009, Yuriy Tokman"
#property link      "yuriytokman@gmail.com"

#property indicator_chart_window

int j = 0;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
//----
   j=j+1;if(j>9)j=0;   
//----
   SetText("Òåêñò","Íàèìåíîâàíèå øðèôòà",1,350,50,30, Font_Name(j), Red);
//----
   return(0);
  }
//+------------------------------------------------------------------+


//+----------------------------------------------------------------------------+
//|  Àâòîð    : Þðèé Òîêìàíü  yuriytokman@gmail.com                            |
//+----------------------------------------------------------------------------+
//|  Îïèñàíèå : Âîçâðàùàåò íàèìåíîâàíèå øðèôòà                                 |
//+----------------------------------------------------------------------------+
//|  Ïàðàìåòðû:                                                                |
//|  Font_Number - ïðîèçâîëüíîå ÷èñëî  îò 0 äî 10                              |
//+----------------------------------------------------------------------------+
string Font_Name(int Font_Number=10) {
  switch (Font_Number) {
    case 1:     return("Academy Engraved LET");
    case 2:     return("Georgia");
    case 3:     return("Haettenschweiler");
    case 4:     return("Highlight LET");
    case 5:     return("OldDreadfulNo7 BT");
    case 6:     return("Tiranti Sdid LET");
    case 7:     return("Victorian LET");
    case 8:     return("Westwood LET");
    case 9:     return("Tahoma");
    case 10:    return("Arial Black");    
    default:    return("Times New Roman");
  }
}
//+------------------------------------------------------------------+
void SetText(string name,string text,int CORNER,int XDISTANCE,int YDISTANCE, 
             int font_size, string font_name, color text_color=CLR_NONE)
 {
  if (ObjectFind(name)!=-1) ObjectDelete(name);
  ObjectCreate(name,OBJ_LABEL,0,0,0,0,0);         
  ObjectSet(name,OBJPROP_CORNER,CORNER);
  ObjectSet(name,OBJPROP_XDISTANCE,XDISTANCE);
  ObjectSet(name,OBJPROP_YDISTANCE,YDISTANCE);
  ObjectSetText(name,text,font_size,font_name,text_color);
 } 

Comments