How to change OBJ_HLINE to OBJ_TREND ?

 

I want to change line length. At the moment line is full line from the left side of the screen to the right side of the screen. I want them from today to the right side.

At the moment lines made by OBJ_HLINE but I saw somewhere was recommendation to use OBJ_TREND instead of. But If I just change HLINE to TREND, line comes diagonal not horizontal. What I miss?

if(ObjectFind("D_S2 line")!=0)
        {
         ObjectCreate(0,"D_S2 line",OBJ_HLINE,0,time[0],D_S2);
         ObjectSet("D_S2 line",OBJPROP_STYLE,STYLE_SOLID);
         ObjectSet("D_S2 line",OBJPROP_WIDTH,2);
         ObjectSet("D_S2 line",OBJPROP_COLOR,Blue);
        }
      else
        {
         ObjectMove("D_S2 line",0,time[0],D_S2);
 
laurixx:

I want to change line length. At the moment line is full line from the left side of the screen to the right side of the screen. I want them from today to the right side.

At the moment lines made by OBJ_HLINE but I saw somewhere was recommendation to use OBJ_TREND instead of. But If I just change HLINE to TREND, line comes diagonal not horizontal. What I miss?

if(ObjectFind("D_S2 line")!=0)
        {
         ObjectCreate(0,"D_S2 line",OBJ_TREND,0,Time[0],D_S2,iTime(_Symbol,1440,0),D_S2);
         ObjectSet("D_S2 line",OBJPROP_STYLE,STYLE_SOLID);
         ObjectSet("D_S2 line",OBJPROP_WIDTH,2);
         ObjectSet("D_S2 line",OBJPROP_COLOR,Blue);
         ObjectSet("D_S2 line", OBJPROP_RAY,0);
        }
 
Fillellin:
Thank you, works perfect ;)