void CommentLab(string CommentText, int Ydistance, int Xdistance, int Label, int Cor)
{
int CommentIndex = 0;
string label_name = "label" + string(Label);
ObjectCreate(0,label_name,OBJ_LABEL,0,0,0);
ObjectSetInteger(0,label_name, OBJPROP_CORNER, 1);
//--- set X coordinate
ObjectSetInteger(0,label_name,OBJPROP_XDISTANCE,160); <<<<<<
//--- set Y coordinate
ObjectSetInteger(0,label_name,OBJPROP_YDISTANCE,100);
//--- define text color
ObjectSetInteger(0,label_name,OBJPROP_COLOR,Cor);
//--- define text for object Label
ObjectSetString(0,label_name,OBJPROP_TEXT,CommentText);
//--- define font
ObjectSetString(0,label_name,OBJPROP_FONT,"Tahoma");
//--- define font size
ObjectSetInteger(0,label_name,OBJPROP_FONTSIZE,12);
//--- disable for mouse selecting
ObjectSetInteger(0,label_name,OBJPROP_SELECTABLE,false);
ObjectSetInteger(0, label_name,OBJPROP_BACK,false);
//--- draw it on the chart
ChartRedraw(0);
}