How to move a line and it's labels ???

 

Hello

I wrote a custom indi to draw a horizontal lines by value input. I want to used as S and R lines. But if I move the line by dragging manually, the line value didnt change with new line value.

if (Resistance > 0)
       {
        ObjectCreate("resis", OBJ_HLINE, 0,0, Resistance, 0, 0);
        ObjectSet ("resis",OBJPROP_COLOR,Rline_Color); 
        ObjectSet("resis",OBJPROP_WIDTH,Rline_Width);
        ObjectSet("resis",OBJPROP_STYLE,Rline_Style);
        
        ObjectCreate("RVl", OBJ_TEXT, 0,Time[0] + (Period()*750),Resistance);
        ObjectSetText("RVl", DoubleToStr(Resistance,(4)), 8, "Arial", Rline_Color);
        
        if (Close[0] > Resistance) {resisud0 = "p"; resiscolor0  = Green;}   else {resisud0 = "q"; resiscolor0  = Red;}
              ObjectCreate("rsud", OBJ_TEXT, 0,Time[0] + (Period()*300),Resistance);
              ObjectSetText("rsud", resisud0, 8, "Wingdings 3", resiscolor0);
              
        if (Close[1] > Resistance) {resisud1 = "p"; resiscolor1  = Green;}   else {resisud1 = "q"; resiscolor1  = Red;}
              ObjectCreate("resud1", OBJ_TEXT, 0,Time[0]+(Period()*200),Resistance);
              ObjectSetText("resud1", resisud1, 12, "Wingdings 3", resiscolor1);      
            
        }

I want to know the code when I drag and move the line, I also want to move all label and text along with the line move. Somebody please advice me. I here attached an image to show how I want to do.

Reason: