Hi,
Is this possible to display the comment on chart with bold/big size font and different colour?
currently i used to display comments as normal. but i like to display header as bigger font with bold and ey-catch colour.
Please help me if there is any functions available to use?
currently i use:
Change in Font ? No. Change in colour ? yes if you are happy to change the colour of the other chart elements that share the same colour, change the Foreground colour - F8
Alternatively use something like my CommentLab() function . . .
I did better than that, I gave you the code . . . did you click the link I gave ?
I try the code you have given,when i compile shows error.
2;116;67:20;'(' - function definition unexpected
2;75;88:9;'CommentLabel' - variable not defined
2;75;89:22;'CommentLabel' - variable not defined
2;75;90:19;'CommentLabel' - variable not defined
2;75;91:19;'CommentLabel' - variable not defined
2;75;92:19;'CommentLabel' - variable not defined
2;75;93:23;'CommentLabel' - variable not defined
2;75;93:63;'Status_Color' - variable not defined
2;73;97:1;'}' - unbalanced parentheses
void CommentLab(string CommentText) { string CommentLabel; int CommentIndex = 0; if (CommentText == "") { // delete all Comment texts while(ObjectFind(StringConcatenate("CommentLabel", CommentIndex )) >= 0) { ObjectDelete(StringConcatenate("CommentLabel", CommentIndex )); CommentIndex++; } return; } while(ObjectFind(StringConcatenate("CommentLabel", CommentIndex )) >= 0) { CommentIndex++; } CommentLabel = StringConcatenate("CommentLabel", CommentIndex); ObjectCreate(CommentLabel, OBJ_LABEL, 0, 0, 0 ); ObjectSet(CommentLabel, OBJPROP_CORNER, 0); ObjectSet(CommentLabel, OBJPROP_XDISTANCE, 5); ObjectSet(CommentLabel, OBJPROP_YDISTANCE, 15 + (CommentIndex * 15) ); ObjectSetText(CommentLabel, CommentText, 10, "Tahoma", Status_Color ); }
I try the code you have given,when i compile shows error.
2;116;67:20;'(' - function definition unexpected
2;75;88:9;'CommentLabel' - variable not defined
2;75;89:22;'CommentLabel' - variable not defined
2;75;90:19;'CommentLabel' - variable not defined
2;75;91:19;'CommentLabel' - variable not defined
2;75;92:19;'CommentLabel' - variable not defined
2;75;93:23;'CommentLabel' - variable not defined
2;75;93:63;'Status_Color' - variable not defined
2;73;97:1;'}' - unbalanced parentheses
Status_Color is a globally declared color, have you added it ?
CommentLabel is a locally declared variable inside the function . . .
To use the Function do it like this:
CommentLab("This is a comment . . .");
or like this
CommentLab( StringConcatenate( "Ask price is: ", DoubleToStr(Ask, Digits) ) );
Status_Color is a globally declared color, have you added it ?
CommentLabel is a locally declared variable inside the function . . .
To use the Function do it like this:
or like this
the correct code is:
void CommentLab(string CommentText)
{
string CommentLabel;
int CommentIndex = 0;
if (CommentText == "")
{
// delete all Comment texts
while(ObjectFind(0,StringConcatenate(CommentLabel,"CommentLabel", CommentIndex )) >= 0)
{
ObjectDelete(0,StringConcatenate(CommentLabel,"CommentLabel", CommentIndex ));
CommentIndex++;
}
return;
}
while(ObjectFind(0,StringConcatenate(CommentLabel,"CommentLabel", CommentIndex )) >= 0)
{
CommentIndex++;
}
CommentLabel = StringConcatenate(CommentLabel,"CommentLabel", CommentIndex);
ObjectCreate(0,CommentLabel, OBJ_LABEL, 0, 0, 0 );
ObjectSetInteger(0,CommentLabel, OBJPROP_CORNER, 0);
ObjectSetInteger(0,CommentLabel, OBJPROP_XDISTANCE, 5);
ObjectSetInteger(0,CommentLabel, OBJPROP_YDISTANCE, 15 + (CommentIndex * 15) );
ObjectSetInteger(0,CommentLabel, OBJPROP_COLOR, clrGoldenrod);
// ObjectSetInteger(0,CommentLabel, CommentText, 10, "Tahoma", Status_Color );
}
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
Is this possible to display the comment on chart with bold/big size font and different colour?
currently i used to display comments as normal. but i like to display header as bigger font with bold and ey-catch colour.
Please help me if there is any functions available to use?
currently i use: