Adding Text to a Horizontal Line

 
This seems like quite an easy thing that I am trying to do but I have created an indicator that draws a horizontal line and sends an alert when price passes the line. I just wanted to add text to the horizontal line so that the text is displayed just above the line at the far left. Is this possible and if so could someone let me know how to do it?

Many thanks.
 
ObjectCreate(string name, OBJ_TEXT (or OBJ_LABEL),....)
 
qjol:


Thanks for the answer. I already have these lines in my code that creates the horizontal line, where do I put your suggestion?

ObjectCreate(LineName, OBJ_HLINE, 0, 0, Bid);

ObjectSet(LineName, OBJPROP_STYLE, LineStyle);
ObjectSet(LineName, OBJPROP_COLOR, LineColor);

 
DMFX:


Thanks for the answer. I already have these lines in my code that creates the horizontal line, where do I put your suggestion?

ObjectCreate(LineName, OBJ_HLINE, 0, 0, Bid);

ObjectSet(LineName, OBJPROP_STYLE, LineStyle);
ObjectSet(LineName, OBJPROP_COLOR, LineColor);


Ok - so I have created a new label object which I can now see on my chart but how do I attach it to my horizontal line so that if the line is moved the label is moved as well?
 
DMFX:

Ok - so I have created a new label object which I can now see on my chart but how do I attach it to my horizontal line so that if the line is moved the label is moved as well?

ObjectSetText(bs, "buy_stop", 8, "Arial", Magenta);
 
gavin:

ObjectSetText(bs, "buy_stop", 8, "Arial", Magenta);

ObjectSetText(LineName, "What you want to call your line", 8, "Arial", Magenta);
 
gavin:

ObjectSetText(LineName, "What you want to call your line", 8, "Arial", Magenta);

Thanks for the reply Gavin, but what I really want is text permanently on the chart just above the horizontal line so that when the line is moved the text is moved as well and you can always see it. Your suggestion is good but it only appears when you hover over the line.
 
qjol:


No go to your platform properties and set "show object description to true..

 
gavin:


No go to your platform properties and set "show object description to true..


Great Gavin - that works perfectly :)

Thanks for you help :)

 
DMFX:


Great Gavin - that works perfectly :)

Thanks for you help :)


DMFX IS THERE ANY CHANCE YOU CAN SEND ME THIS INDICATOR? I WANT TO DRAW A HORIZONTAL LINE AND PUT TEXT ON IT AND THAT IT IS, BUT HAVE NO IDEA HOW TO MAKE MY OWN INDICATOR. I WOULD GREATLY APPRECIATE IT!
Reason: