Object Description character limit

 

Hi All,

I am creating an economic calendar indicator that display the event name in the object description of the vertical line. 
 

However if the character count exceed certain limit, the text will not be fully displayed for Object Description.

Hence, I would like to seek recommendation on alternatives to display string array.

Thank you in advance for the help.

 
I have created a list of OBJ_TEXT as an alternative.
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void calendar_createtext(datetime dt, int direction)
  {
   int bar = iBarShift(NULL, PERIOD_CURRENT, dt, false);
   string objprefix = prefix +(string)dt + "text" ;
   string eventname = b.GetData(dt);
   string arr[];
   string objname;
   if (eventname == NULL){return;}
   
   double price;
   int k=StringSplit(eventname,StringGetCharacter("\n",0),arr);

   for (int i = 0; i <k-1; i ++){
      objname = objprefix + (string)i;
      if (direction ==1){
         price = iHigh(NULL, PERIOD_CURRENT, bar) + 0.001*(i+1);
         }
      else {
         price = iLow(NULL, PERIOD_CURRENT, bar) - 0.001*(i+1);
         }
      ObjectCreate(0,objname,OBJ_TEXT,0,dt,price);
      ObjectSetString(0,objname,OBJPROP_TEXT,arr[i]);
      ObjectSetString(0,objname,OBJPROP_FONT,"Arial");   
      ObjectSetInteger(0,objname,OBJPROP_FONTSIZE,8);
      ObjectSetDouble(0,objname,OBJPROP_ANGLE,0);
      ObjectSetInteger(0,objname,OBJPROP_ANCHOR,ANCHOR_LEFT_UPPER);
      ObjectSetInteger(0,objname,OBJPROP_COLOR,clrBlack);
      ObjectSetInteger(0,objname,OBJPROP_BACK,false);
      ObjectSetInteger(0,objname,OBJPROP_SELECTABLE,false);
      ObjectSetInteger(0,objname,OBJPROP_HIDDEN,true);
      }

  }
//+------------------------------------------------------------------+

Sample outcome as follow:


 

Yes, there is a limit of 63 characters as per posts in the forum ...

Forum on trading, automated trading systems and testing trading strategies

Errors, bugs, questions

TheXpert, 2015.03.28 19:20

I believe the maximum length for all string properties is 63 characters (64 if with '\0');
Reason: