Fibo. Pivot line which I want to show the line only today ~

 

There are Fibo. Pivot lines. But it shows from left to right of full length of window.

(1) What I want is these lines to be displayed only from today to the rightest. How can I change this?

(2) I want to color between R1 and R2, S1 and S2. Rectangle in Color. How can I do this?

Thanks in advance ~

 //---- Set lines on chart window
    //----- PIVOT --------
    if(ObjectFind("P line") != 0)
      {
        ObjectCreate("P line", OBJ_HLINE, 0, Time[40], P);
        ObjectSet("P line", OBJPROP_STYLE, STYLE_DOT);
        ObjectSet("P line", OBJPROP_COLOR, Magenta);
      }
    else
      {
        ObjectMove("P line", 0, Time[40], P);
      }
    if(ObjectFind("FR1 line") != 0)
      {
        ObjectCreate("FR1 line", OBJ_HLINE, 0, Time[40], R1);
        ObjectSet("FR1 line", OBJPROP_STYLE, STYLE_DASHDOTDOT);
        ObjectSet("FR1 line", OBJPROP_COLOR, LimeGreen);
      }
    else
      {
        ObjectMove("FR1 line", 0, Time[40], R1);
      }
//----
    if(ObjectFind("FS1 line") != 0)
      {
        ObjectCreate("FS1 line", OBJ_HLINE, 0, Time[40], S1);
        ObjectSet("FS1 line", OBJPROP_STYLE, STYLE_DASHDOTDOT);
        ObjectSet("FS1 line", OBJPROP_COLOR, Red);
      }
    else
      {
        ObjectMove("FS1 line", 0, Time[40], S1);
      }
//----
    if(ObjectFind("FR2 line") != 0)
      {
        ObjectCreate("FR2 line", OBJ_HLINE, 0, Time[40], R2);
        ObjectSet("FR2 line", OBJPROP_STYLE, STYLE_DASHDOTDOT);
        ObjectSet("FR2 line", OBJPROP_COLOR, LimeGreen);
      }
    else
      {
        ObjectMove("FR2 line", 0, Time[40], R2);
      }
    if(ObjectFind("FS2 line") != 0)
      {
        ObjectCreate("FS2 line", OBJ_HLINE, 0, Time[40], S2);
        ObjectSet("FS2 line", OBJPROP_STYLE, STYLE_DASHDOTDOT);
        ObjectSet("FS2 line", OBJPROP_COLOR, Red);
      }
    else
      {
        ObjectMove("FS2 line", 0, Time[40], S2);
      }
//----
    if(ObjectFind("FR3 line") != 0)
      {
        ObjectCreate("FR3 line", OBJ_HLINE, 0, Time[40], R3);
        ObjectSet("FR3 line", OBJPROP_STYLE, STYLE_DASHDOTDOT);
        ObjectSet("FR3 line", OBJPROP_COLOR, LimeGreen);
      }
    else
      {
        ObjectMove("FR3 line", 0, Time[40], R3);
      }
    if(ObjectFind("FS3 line") != 0)
      {
        ObjectCreate("FS3 line", OBJ_HLINE, 0, Time[40], S3);
        ObjectSet("FS3 line", OBJPROP_STYLE, STYLE_DASHDOTDOT);
        ObjectSet("FS3 line", OBJPROP_COLOR, Red);
      }
    else
      {
        ObjectMove("FS3 line", 0, Time[40], S3);
      }
//----
 
paul.seldon:

There are Fibo. Pivot lines. But it shows from left to right of full length of window.

(1) What I want is these lines to be displayed only from today to the rightest. How can I change this?

(2) I want to color between R1 and R2, S1 and S2. Rectangle in Color. How can I do this?

Thanks in advance ~

Use a TrendLine instead of a Horizontal line.
 

paul.seldon:

(1) What I want is these lines to be displayed only from today to the rightest. How can I change this?

(2) I want to color between R1 and R2, S1 and S2. Rectangle in Color. How can I do this?

  1. Use trendline not hline
  2. Use rectangles not lines.
 
WHRoeder:
  1. Use trendline not hline
  2. Use rectangles not lines.


Thanks -

Reason: