Как поместить текст на OBJ_RECTANGLE_LABEL?

 

I'm trying to place text on a colored surface in Mql5. I found OBJ RECTANGLE LABEL, but could not find how to apply text to it, since I did not find any property for it. Please help me.


 
jaffer wilson:

I'm trying to place text on a colored surface in Mql5. I found OBJ RECTANGLE LABEL, but could not find how to apply text to it, since I did not find any property for it. Please help me.


Вы можете вывести любой текст выше прямоугольника. You can write any text ower restangle.

input int       FontSize            = 10;
input color     FontColor           = clrYellow;
input string    FontName            = "Tahoma";

ObjectSetString(0,"SIP_"+lNames[1],OBJPROP_TEXT,lNames[1]+IntegerToString(AccountLeverage())); // example how to change text in Label

bool CreateLabel(string name,int x,int y=10)
  {
   if(!ObjectCreate(0,name,OBJ_LABEL,0,0,0))
      return false;;
   ObjectSetInteger(0,name,OBJPROP_ANCHOR,ANCHOR_LEFT_LOWER);
   ObjectSetInteger(0,name,OBJPROP_CORNER,CORNER_LEFT_LOWER);
   ObjectSetInteger(0,name,OBJPROP_XDISTANCE,x);
   ObjectSetInteger(0,name,OBJPROP_YDISTANCE,y);
   ObjectSetInteger(0,name,OBJPROP_FONTSIZE,FontSize);
   ObjectSetInteger(0,name,OBJPROP_COLOR,FontColor);
   ObjectSetInteger(0,name,OBJPROP_SELECTABLE,true);
   ObjectSetString(0,name,OBJPROP_FONT,FontName);
   ChartRedraw();
   return true;
  }
 
Alexey Volchanskiy :

You can display any text above the rectangle. You can write any text ower restangle.

Привет большое спасибо