Download MetaTrader 5

Scripts: s-LastPinkEventDate

To add comments, please log in or register
Automated-Trading
Admin
105121
Automated-Trading  

s-LastPinkEventDate:

Since build 344 of the client terminal display of economic calendar news using special graphical objects (OBJ_EVENT) is added.

A script that outputs as a demonstration of the Economic Calendar with current economic data, the date of the last major(Pink) event.

Author: Alexander P.

s-LastPinkEventDate

Alexander Piechotta
7056
Alexander Piechotta  

Be careful with

void OnDeinit(const int reason)
{
ObjectsDeleteAll(0); // Caution
}

Deleted all special graphical objects (OBJ_EVENT).

 

 

Used for example. Removes all objects except (OBJ_EVENT).

void OnDeinit(const int reason)
{
ObjectsDeleteAllExcept(109);
}

 

void ObjectsDeleteAllExcept(int type)
  {
   string  name="";
   int total=ObjectsTotal(0)-1;

   for(int i=total; i>=0; i --)
     {
      name=ObjectName(0,i);

      if(ObjectGetInteger(0,name,OBJPROP_TYPE,0)  ==  type) continue; //Objekt Typ muss eine event sein
         ObjectDelete(0,name);
           } 
  }

      

To add comments, please log in or register