put label next to line dynamically

 

I have a cbit of code that draws a horizonatl line on a chart at specified values.

How can I get a label on the right hand side of the chart just above the line as a description?


How can I set the text to the right hand side of the screen:


      ObjectCreate("H4KsText", OBJ_TEXT, 0, Time[0], iIchimoku(Symbol(), PERIOD_H4, 9, 26, 52, MODE_KIJUNSEN, 0), 0, 0);
      ObjectSet("H4KsText",OBJPROP_COLOR,Blue);
      ObjectSetText("H4KsText","H4 Kijunsen");
      ObjectCreate("H1KsText", OBJ_TEXT, 0, Time[0], iIchimoku(Symbol(), PERIOD_H1, 9, 26, 52, MODE_KIJUNSEN, 0), 0, 0);
      ObjectSet("H1KsText",OBJPROP_COLOR,Orange);
      ObjectSetText("H1KsText","H1 Kijunsen");
 
double top=WindowPriceMax();
double bottom=WindowPriceMin();
datetime left=Time[WindowFirstVisibleBar()];
int right_bound=WindowFirstVisibleBar()-WindowBarsPerChart();
if(right_bound<0) right_bound=0;
datetime right=Time[right_bound]+Period()*60;
//----
ObjectCreate("Padding_rect",OBJ_RECTANGLE,0,left,top,right,bottom);
ObjectSet("Padding_rect",OBJPROP_BACK,true);
ObjectSet("Padding_rect",OBJPROP_COLOR,Blue);
WindowRedraw();
 
FinGeR:
double top=WindowPriceMax();
double bottom=WindowPriceMin();
datetime left=Time[WindowFirstVisibleBar()];
int right_bound=WindowFirstVisibleBar()-WindowBarsPerChart();
if(right_bound<0) right_bound=0;
datetime right=Time[right_bound]+Period()*60;
//----
ObjectCreate("Padding_rect",OBJ_RECTANGLE,0,left,top,right,bottom);
ObjectSet("Padding_rect",OBJPROP_BACK,true);
ObjectSet("Padding_rect",OBJPROP_COLOR,Blue);
WindowRedraw();

The text object has to have the following value though when ObjectCreate is used

iIchimoku(Symbol(), PERIOD_H4, 9, 26, 52, MODE_KIJUNSEN, 0)

So, if I put int left, top, right, bottom - it won't know what the value of the line should be?
 
anyone?