Scripts: s-LastPinkEventDate

 

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

 

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);
           } 
  }