Add text and numbers to the end of a dynamic level

 

How can I add text and numbers at the end of a dynamic level like in the picture?

Files:
 
Make a time based trendline and place a label
 
Tiofelo Da Olga Gilbert Teles:

How can I add text and numbers at the end of a dynamic level like in the picture?

//+------------------------------------------------------------------+
void Disp_Symbol(string obj_name, int win_idx, string text, double value, color col)
{
        int TxtSize  = 8;
        string font  = "Arial Black";
        string dText = "";
        
        if (ObjectFind(0, obj_name) < 0)
        {
                dText = "        " + text + "  " + DoubleToString(value, 0) + "%";
                ObjectCreate(0,     obj_name, OBJ_TEXT,         win_idx, iTime(_Symbol, _Period, 0), value);
                ObjectSetString(0,  obj_name, OBJPROP_TEXT,     dText);
                ObjectSetInteger(0, obj_name, OBJPROP_FONTSIZE, TxtSize);
                ObjectSetString(0,  obj_name, OBJPROP_FONT,     font);
                ObjectSetInteger(0, obj_name, OBJPROP_COLOR,    col);
        }
        else
        {
                dText = "        " + text + "  " + DoubleToString(value, 0) + "%";
                ObjectSetInteger(0, obj_name, OBJPROP_TIME,     iTime(_Symbol, _Period, 0));
                ObjectSetDouble(0,  obj_name, OBJPROP_PRICE,    value);
                ObjectSetString(0,  obj_name, OBJPROP_TEXT,     dText);
                ObjectSetInteger(0, obj_name, OBJPROP_FONTSIZE, TxtSize);
                ObjectSetString(0,  obj_name, OBJPROP_FONT,     font);
                ObjectSetInteger(0, obj_name, OBJPROP_COLOR,    col);
        }       
} 
//+------------------------------------------------------------------+
 
Nagisa Unada #:

Thanks for the answer. I will take a look at that code.

 

Hello everybody! Well, as I had never worked with objects, I made it difficult to make the "text object". So I decided to start with something simpler, "a moving line according to the RSI". In this "project" how can I draw the line always in the RSI window?

Files:
 

Thank you all. I finally managed to make the "text and number" object moveable according to RSI.

Files:
Reason: