Horizontal Line Label Question

 
In a script the following coding can be used to create a Horizontal Line and a label for it:
ObjectCreate("Label 1",OBJ_HLINE,0,CurTie(),1.3000);
ObjectSetText("Label 1","Text of Label",13,"Arial", Black);
When the script is attached the above code is executed and places a horizontal at the proper point and places a label just above the line. This label remains at the left side of the screen when the chart is scrolled left or right. I have not found a way to do the same thing in a Custom Indicator. Is there anyway to do this in a Custom Indicator?
Reason: