ytg_Zodiac_V0

Download script
Author: Yuriy Tokman
ytg_Zodiac_V0

This script is designed to create a visual "Zodiac" display directly on your trading chart. Rather than analyzing price action or market trends, its purpose is purely decorative and informational—it tracks the current astrological sign based on the real-world date.

How it Works

The logic of the script can be broken down into three main phases:

1. Setup and Display Configuration When you first load the script, it prepares the visual elements. It creates a list of twelve different names (corresponding to the zodiac signs) and pairs them with specific symbols. It then places these names and symbols on your screen in a structured row so that they are clearly visible without cluttering your main trading data.

2. Real-Time Date Tracking The core logic of the script relies on "listening" to the current date and month provided by your computer's system clock. It constantly checks:

  • What month is it currently?
  • What day of that month is it?

3. Dynamic Highlighting The script contains a specific set of rules for every zodiac sign (for example, identifying that certain dates in March and April belong to one sign, while others belong to another).

Every time the script runs:

  • It compares the current date against these predefined ranges.
  • Once it identifies which zodiac sign matches today's date, it "activates" that specific icon.
  • The active icon changes color (to a highlighted lime green) and performs a subtle shifting motion, making it stand out from the rest of the gold-colored text on your screen.

Summary for the User

Think of this as a digital calendar widget for your trading platform. It automatically updates itself as time passes. You don't need to manually change anything; the script simply looks at today's date and ensures that the correct zodiac sign is highlighted and glowing on your chart, providing a stylized visual reference while you trade.

18 Views
0 Downloads
0 Favorites
ytg_Zodiac_V0
//+------------------------------------------------------------------+
//|                                                ytg_Zodiac_V0.mq4 |
//|                                                     Yuriy Tokman |
//|                                            yuriytokman@gmail.com |
//+------------------------------------------------------------------+
#property copyright "Yuriy Tokman"
#property link      "yuriytokman@gmail.com"

#property indicator_chart_window

extern color Zodiac         = Yellow;
extern color Name           = Gold;
extern color Zodiac_current = Lime;

int arrow[]={105,104,103,102,101,100,99,98,97,96,95,94};
string name[]={"Ðûáû","Âîäîëåé","Êîçåðîã","Ñòðåëåö","Ñêîðïèîí","Âåñû","Äåâà","Ëåâ","Ðàê","Áëèçíåöû","Òåëåö","Îâåí"};

int count = 0;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   int x;
   for(x=0;x<12;x++)SetText("Zodiac_txt"+x,name[x],1,(x+11)*30,33,9,"Tahoma",Name,45);
   for(x=0;x<12;x++)SetText("Zodiac_arrow"+x,CharToStr(arrow[x]),1,(x+11)*29,10,18, "Wingdings", Zodiac);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   string vName;
   for(int i=ObjectsTotal()-1; i>=0;i--)
    {
     vName = ObjectName(i);
     if (StringFind(vName,"Zodiac_") !=-1) ObjectDelete(vName);
    }   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
//----
  count++;
  if(count>5)count=0; 
//----11
   if((Month()==3 && Day()>=21 && Day()<=31) ||
      (Month()==4 && Day()>=1 && Day()<=20))
      {
       SetText("Zodiac_arrow"+11,CharToStr(arrow[11]),1,(11+11)*29,10,18+count,"Wingdings",Zodiac_current);
      }
//----10
   if((Month()==4 && Day()>=21 && Day()<=31) ||
      (Month()==5 && Day()>=1 && Day()<=21))
      {
       SetText("Zodiac_arrow"+10,CharToStr(arrow[10]),1,(10+11)*29,10,18+count,"Wingdings",Zodiac_current);
      }      
//----9
   if((Month()==5 && Day()>=22 && Day()<=31) ||
      (Month()==6 && Day()>=1 && Day()<=21))
      {
       SetText("Zodiac_arrow"+9,CharToStr(arrow[9]),1,(9+11)*29,10,18+count,"Wingdings",Zodiac_current);
      }      
//----8
   if((Month()==6 && Day()>=22 && Day()<=31) ||
      (Month()==7 && Day()>=1 && Day()<=22))
      {
       SetText("Zodiac_arrow"+8,CharToStr(arrow[8]),1,(8+11)*29,10,18+count,"Wingdings",Zodiac_current);
      }
//----7
   if((Month()==7 && Day()>=23 && Day()<=31) ||
      (Month()==8 && Day()>=1 && Day()<=23))
      {
       SetText("Zodiac_arrow"+7,CharToStr(arrow[7]),1,(7+11)*29,10,18+count,"Wingdings",Zodiac_current);
      }      
//----6
   if((Month()==8 && Day()>=24 && Day()<=31) ||
      (Month()==9 && Day()>=1 && Day()<=23))
      {
       SetText("Zodiac_arrow"+6,CharToStr(arrow[6]),1,(6+11)*29,10,18+count,"Wingdings",Zodiac_current);
      }
//----5
   if((Month()==9 && Day()>=24 && Day()<=31) ||
      (Month()==10 && Day()>=1 && Day()<=23))
      {
       SetText("Zodiac_arrow"+5,CharToStr(arrow[5]),1,(5+11)*29,10,18+count,"Wingdings",Zodiac_current);
      }      
//----4
   if((Month()==10 && Day()>=24 && Day()<=31) ||
      (Month()==11 && Day()>=1 && Day()<=22))
      {
       SetText("Zodiac_arrow"+4,CharToStr(arrow[4]),1,(4+11)*29,10,18+count,"Wingdings",Zodiac_current);
      }      
//----3
   if((Month()==11 && Day()>=23 && Day()<=31) ||
      (Month()==12 && Day()>=1 && Day()<=21))
      {
       SetText("Zodiac_arrow"+3,CharToStr(arrow[3]),1,(3+11)*29,10,18+count,"Wingdings",Zodiac_current);
      }      
//----2
   if((Month()==12 && Day()>=22 && Day()<=31) ||
      (Month()==1 && Day()>=1 && Day()<=20))
      {
       SetText("Zodiac_arrow"+2,CharToStr(arrow[2]),1,(2+11)*29,10,18+count,"Wingdings",Zodiac_current);
      }      
//----1
   if((Month()==1 && Day()>=21 && Day()<=31) ||
      (Month()==2 && Day()>=1 && Day()<=18))
      {
       SetText("Zodiac_arrow"+1,CharToStr(arrow[1]),1,(1+11)*29,10,18+count,"Wingdings",Zodiac_current);
      }
//----0
   if((Month()==2 && Day()>=19 && Day()<=31) ||
      (Month()==3 && Day()>=1 && Day()<=20))
      {
       SetText("Zodiac_arrow"+0,CharToStr(arrow[0]),1,(0+11)*29,10,18+count,"Wingdings",Zodiac_current);
      }                          
//----
   return(0);
  }
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
void SetText(string name,string text,int CORNER,int XDISTANCE,int YDISTANCE, 
             int font_size, string font_name, color text_color=CLR_NONE, double ANGLE = 0)
 {
  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);
  ObjectSet(name, OBJPROP_ANGLE , ANGLE);
  ObjectSetText(name,text,font_size,font_name,text_color);
 }

Comments