Loading ...
Sorry, an error occurred while loading the content.

AUTOMATICALLY PLOT Prior Day High and Low Extended Lines

Expand Messages
  • djterm
    Hello all, following is a re-post of my prior post. A couple of members attempted to address my issue but none of the input correctly addressed my issue.
    Message 1 of 14 , Mar 6, 2013
    • 0 Attachment
      Hello all, following is a re-post of my prior post. A couple of members attempted to address my issue but none of the input correctly addressed my issue. Please read post in its entirety and note that I am not looking for the standard "stair-step-look" indicator that is referenced in the Files folder. Thank you in advance.
      _____________________________________________________________________

      I need help. I have perused the 'Files' folder but to no avail. I have tried myself to script it but to no avail. I need the following:

      Manual Process - Current way of doing it:
      On TOS when you select 'Drawings' and then select 'Price Level' and then manually draw two horizontal lines say at prior day's H and L and then for each line select 'Edit Properties' and then select 'Yes' to 'Left Ray' and 'Right Ray' you now have two lines drawn at prior day's H and L. This is what I need to plot but NOT AS A MANUAL PROCESS.

      Problem Stated:
      How to automate the above Manual Process so that the prior day's H and L lines automatically update each day with the next prior day's H and L etc., etc. Is there a RAY command or something akin to it so that when the prior day's H and L are automatically generated the lines will continue to essentially extend themselves to the left and to the right indefinitely such as a RAY does in the above Manual Process. This would need to work across timeframes and within defined trading hours of equities, futures, and ideally forex - or at least
      equities to start with. And ideally the lines could be modified to be dotted with a certain color.

      There are a lot of good scripters on here to have generated some of the code that I have seen. I would have to believe that this would be relatively straight-forward for them to provide code or give direction as to how. I am at wits end on this one since I have to manually adjust these prior day's H and L lines after the close of each respective session. With multiple symbol, multiple charts on multiple grids, and across multiple timeframes this is very,
      very time-consuming and painful to perform.

      I would really appreciate a solution to this dilemma. Thank you very much in advance.
    • djterm
      Hello all, following is a re-post of my prior post. A couple of members attempted to address my issue but none of the input correctly addressed my issue.
      Message 2 of 14 , Mar 15, 2013
      • 0 Attachment
        Hello all, following is a re-post of my prior post. A couple of members attempted to address my issue but none of the input correctly addressed my issue. Please read post in its entirety and note that I am not looking for the standard "stair-step-look" indicator that is referenced in the Files folder. Thank you in advance.
        _____________________________________________________________________

        I need help. I have perused the 'Files' folder but to no avail. I have tried myself to script it but to no avail. I need the following:

        Manual Process - Current way of doing it:
        On TOS when you select 'Drawings' and then select 'Price Level' and then manually draw two horizontal lines say at prior day's H and L and then for each line select 'Edit Properties' and then select 'Yes' to 'Left Ray' and 'Right Ray' you now have two lines drawn at prior day's H and L. This is what I need to plot but NOT AS A MANUAL PROCESS.

        Problem Stated:
        How to automate the above Manual Process so that the prior day's H and L lines automatically update each day with the next prior day's H and L etc., etc. Is there a RAY command or something akin to it so that when the prior day's H and L are automatically generated the lines will continue to essentially extend themselves to the left and to the right indefinitely such as a RAY does in the above Manual Process. This would need to work across timeframes and within
        defined trading hours of equities, futures, and ideally forex - or at least equities to start with. And ideally the lines could be modified to be dotted with a certain color.

        There are a lot of good scripters on here to have generated some of the code that I have seen. I would have to believe that this would be relatively straight-forward for them to provide code or give direction as to how. I am at wits end on this one since I have to manually adjust these prior day's H and L lines after the close of each respective session. With multiple symbol, multiple charts on multiple grids, and across multiple timeframes this is very, very time-consuming and painful to perform.

        I would really appreciate a solution to this dilemma. Thank you very much in advance.
      • Larry thompson
        I only trade stocks, so I am not sure of trading hours for other instruments. However, I have created a script that plots up to the last 10 days of previous
        Message 3 of 14 , Mar 15, 2013
        I only trade stocks, so I am not sure of trading hours for other instruments. However, I have created a script that plots up to the last 10 days of previous high/lows, extending them to the right, but not the left. It has selectable (click the ? next to the input to see the options) plotting and coloring for the plots. It seems to plot on all intraday timeframes and for both time and tick charts. See if this is close to what you were looking to get.

        #High and Lows per day for last 10 days on chart
        input painthigh=4;#Hint painthigh: 1=dots,2=dashes,3=squares,4=horizontal
        def paintingStrategyhigh = if painthigh==1 then PaintingStrategy.POINTS else if painthigh==4 then PaintingStrategy.DASHES else if painthigh==3 then PaintingStrategy.SQUARES else PaintingStrategy.HORIZONTAL;
        input paintlow=1; #Hint paintlow: 1=dots,2=dashes,3=squares,4=horizontal
        def paintingStrategylow = if painthigh==1 then PaintingStrategy.POINTS else if painthigh==2 then PaintingStrategy.DASHES else if painthigh==3 then PaintingStrategy.SQUARES else PaintingStrategy.HORIZONTAL;
        rec high1 = if Getday()==getlastday() then high(period=aggregationPeriod.DAY) else high1[1];
        input colorhigh=5;#Hint colorhigh: 0=magenta,1=cyan,2=light-red,3=light_green,4=yellow,5=red,6=green,7=light_gray,8=gold,9=white
        input colorlow =6;#Hint colorlow: 0=magenta,1=cyan,2=light-red,3=light_green,4=yellow,5=red,6=green,7=light_gray,8=gold,9=white
        plot h1=high1;
        h1.setpaintingStrategy(paintingStrategyhigh);
        h1.setdefaultColor(getcolor(colorhigh));
        rec high2 = if Getday()==getlastday()-1 then high(period=aggregationPeriod.DAY) else high2[1];
        plot h2=high2;
        h2.setpaintingStrategy(paintingStrategyhigh);
        h2.setdefaultColor(getcolor(colorhigh));
        rec high3 = if Getday()==getlastday()-2 then high(period=aggregationPeriod.DAY) else high3[1];
        plot h3=high3;
        h3.setpaintingStrategy(paintingStrategyhigh);
        h3.setdefaultColor(getcolor(colorhigh));
        rec high4 = if Getday()==getlastday()-3 then high(period=aggregationPeriod.DAY) else high4[1];
        plot h4=high4;
        h4.setpaintingStrategy(paintingStrategyhigh);
        h4.setdefaultColor(getcolor(colorhigh));
        rec high5 = if Getday()==getlastday()-4 then high(period=aggregationPeriod.DAY) else high5[1];
        plot h5=high5;
        h5.setpaintingStrategy(paintingStrategyhigh);
        h5.setdefaultColor(getcolor(colorhigh));
        rec high6 = if Getday()==getlastday()-5 then high(period=aggregationPeriod.DAY) else high6[1];
        plot h6=high6;
        h6.setpaintingStrategy(paintingStrategyhigh);
        h6.setdefaultColor(getcolor(colorhigh));
        rec high7 = if Getday()==getlastday()-6 then high(period=aggregationPeriod.DAY) else high7[1];
        plot h7=high7;
        h7.setpaintingStrategy(paintingStrategyhigh);
        h7.setdefaultColor(getcolor(colorhigh));
        rec high8 = if Getday()==getlastday()-7 then high(period=aggregationPeriod.DAY) else high8[1];
        plot h8=high8;
        h8.setpaintingStrategy(paintingStrategyhigh);
        h8.setdefaultColor(getcolor(colorhigh));
        rec high9 = if Getday()==getlastday()-8 then high(period=aggregationPeriod.DAY) else high9[1];
        plot h9=high9;
        h9.setpaintingStrategy(paintingStrategyhigh);
        h9.setdefaultColor(getcolor(colorhigh));
        rec high10 = if Getday()==getlastday()-9 then high(period=aggregationPeriod.DAY) else high10[1];
        plot h10=high10;
        h10.setpaintingStrategy(paintingStrategyhigh);
        h10.setdefaultColor(getcolor(colorhigh));
        rec high11 = if Getday()==getlastday()-10 then high(period=aggregationPeriod.DAY) else high11[1];
        plot h11=high11;
        h11.setpaintingStrategy(paintingStrategyhigh);
        h11.setdefaultColor(getcolor(colorhigh));
        rec high12 = if Getday()==getlastday()-11 then high(period=aggregationPeriod.DAY) else high12[1];
        plot h12=high12;
        h12.setpaintingStrategy(paintingStrategyhigh);
        h12.setdefaultColor(getcolor(colorhigh));
        rec high13 = if Getday()==getlastday()-12 then high(period=aggregationPeriod.DAY) else high13[1];
        plot h13=high13;
        h13.setpaintingStrategy(paintingStrategyhigh);
        h13.setdefaultColor(getcolor(colorhigh));
        rec high14 = if Getday()==getlastday()-13 then high(period=aggregationPeriod.DAY) else high14[1];
        plot h14=high14;
        h14.setpaintingStrategy(paintingStrategyhigh);
        h14.setdefaultColor(getcolor(colorhigh));
        rec high15 = if Getday()==getlastday()-14 then high(period=aggregationPeriod.DAY) else high15[1];
        plot h15=high15;
        h15.setpaintingStrategy(paintingStrategyhigh);
        h15.setdefaultColor(getcolor(colorhigh));

        rec low1 = if Getday()==getlastday() then low(period=aggregationPeriod.DAY) else low1[1];
        plot l1=low1;
        l1.setpaintingStrategy(paintingStrategylow);
        l1.setdefaultColor(getcolor(colorlow));
        rec low2 = if Getday()==getlastday()-1 then low(period=aggregationPeriod.DAY) else low2[1];
        plot l2=low2;
        l2.setpaintingStrategy(paintingStrategylow);
        l2.setdefaultColor(getcolor(colorlow));
        rec low3 = if Getday()==getlastday()-2 then low(period=aggregationPeriod.DAY) else low3[1];
        plot l3=low3;
        l3.setpaintingStrategy(paintingStrategylow);
        l3.setdefaultColor(getcolor(colorlow));
        rec low4 = if Getday()==getlastday()-3 then low(period=aggregationPeriod.DAY) else low4[1];
        plot l4=low4;
        l4.setpaintingStrategy(paintingStrategylow);
        l4.setdefaultColor(getcolor(colorlow));
        rec low5 = if Getday()==getlastday()-4 then low(period=aggregationPeriod.DAY) else low5[1];
        plot l5=low5;
        l5.setpaintingStrategy(paintingStrategylow);
        l5.setdefaultColor(getcolor(colorlow));
        rec low6 = if Getday()==getlastday()-5 then low(period=aggregationPeriod.DAY) else low5[1];
        plot l6=low6;
        l6.setpaintingStrategy(paintingStrategylow);
        l6.setdefaultColor(getcolor(colorlow));
        rec low7 = if Getday()==getlastday()-6 then low(period=aggregationPeriod.DAY) else low7[1];
        plot l7=low7;
        l7.setpaintingStrategy(paintingStrategylow);
        l7.setdefaultColor(getcolor(colorlow));
        rec low8 = if Getday()==getlastday()-7 then low(period=aggregationPeriod.DAY) else low8[1];
        plot l8=low8;
        l8.setpaintingStrategy(paintingStrategylow);
        l8.setdefaultColor(getcolor(colorlow));
        rec low9 = if Getday()==getlastday()-8 then low(period=aggregationPeriod.DAY) else low9[1];
        plot l9=low9;
        l9.setpaintingStrategy(paintingStrategylow);
        l9.setdefaultColor(getcolor(colorlow));
        rec low10 = if Getday()==getlastday()-9 then low(period=aggregationPeriod.DAY) else low10[1];
        plot l10=low10;
        l10.setpaintingStrategy(paintingStrategylow);
        l10.setdefaultColor(getcolor(colorlow));
        rec low11 = if Getday()==getlastday()-10 then low(period=aggregationPeriod.DAY) else low11[1];
        plot l11=low11;
        l11.setpaintingStrategy(paintingStrategylow);
        l11.setdefaultColor(getcolor(colorlow));
        rec low12 = if Getday()==getlastday()-11then low(period=aggregationPeriod.DAY) else low12[1];
        plot l12=low12;
        l12.setpaintingStrategy(paintingStrategylow);
        l12.setdefaultColor(getcolor(colorlow));
        rec low13 = if Getday()==getlastday()-12 then low(period=aggregationPeriod.DAY) else low13[1];
        plot l13=low13;
        l13.setpaintingStrategy(paintingStrategy.HORIZONTAL);
        l13.setdefaultColor(getcolor(colorlow));
        rec low14 = if Getday()==getlastday()-13 then low(period=aggregationPeriod.DAY) else low14[1];
        plot l14=low14;
        l14.setpaintingStrategy(paintingStrategy.HORIZONTAL);
        l14.setdefaultColor(getcolor(colorlow));
        rec low15 = if Getday()==getlastday()-14 then low(period=aggregationPeriod.DAY) else low15[1];
        plot l15=low15;
        l15.setpaintingStrategy(paintingStrategy.HORIZONTAL);
        l15.setdefaultColor(getcolor(colorlow));
      • larthomp1
        I made a few corrections to the code for lines and colors. The files section script is up to date. #High and Lows per day for last 10 days on chart input
        Message 4 of 14 , Mar 15, 2013
        • 0 Attachment
          I made a few corrections to the code for lines and colors. The files section script is up to date.

          #High and Lows per day for last 10 days on chart

          input painthigh=4;#Hint painthigh: 1=dots,2=dashes,3=squares,4=horizontal
          def paintingStrategyhigh = if painthigh==1 then PaintingStrategy.POINTS else if painthigh==4 then PaintingStrategy.DASHES else if painthigh==3 then PaintingStrategy.SQUARES else PaintingStrategy.HORIZONTAL;
          input paintlow=1; #Hint paintlow: 1=dots,2=dashes,3=squares,4=horizontal
          def paintingStrategylow = if paintlow==1 then PaintingStrategy.POINTS else if paintlow==2 then PaintingStrategy.DASHES else if paintlow==3 then PaintingStrategy.SQUARES else PaintingStrategy.HORIZONTAL;
          rec high1 = if Getday()==getlastday() then high(period=aggregationPeriod.DAY) else high1[1];
          input colorhigh=5;#Hint colorhigh: 0=magenta,1=cyan,2=light-red,3=light_green,4=yellow,5=red,6=green,7=light_gray,8=gold,9=white
          input colorlow =6;#Hint colorlow: 0=magenta,1=cyan,2=light-red,3=light_green,4=yellow,5=red,6=green,7=light_gray,8=gold,9=white

          plot h1=high1;
          h1.setpaintingStrategy(paintingStrategyhigh);
          h1.setdefaultColor(getcolor(colorhigh));
          rec high2 = if Getday()==getlastday()-1 then high(period=aggregationPeriod.DAY) else high2[1];
          plot h2=high2;
          h2.setpaintingStrategy(paintingStrategyhigh);
          h2.setdefaultColor(getcolor(colorhigh));
          rec high3 = if Getday()==getlastday()-2 then high(period=aggregationPeriod.DAY) else high3[1];
          plot h3=high3;
          h3.setpaintingStrategy(paintingStrategyhigh);
          h3.setdefaultColor(getcolor(colorhigh));
          rec high4 = if Getday()==getlastday()-3 then high(period=aggregationPeriod.DAY) else high4[1];
          plot h4=high4;
          h4.setpaintingStrategy(paintingStrategyhigh);
          h4.setdefaultColor(getcolor(colorhigh));
          rec high5 = if Getday()==getlastday()-4 then high(period=aggregationPeriod.DAY) else high5[1];
          plot h5=high5;
          h5.setpaintingStrategy(paintingStrategyhigh);
          h5.setdefaultColor(getcolor(colorhigh));
          rec high6 = if Getday()==getlastday()-5 then high(period=aggregationPeriod.DAY) else high6[1];
          plot h6=high6;
          h6.setpaintingStrategy(paintingStrategyhigh);
          h6.setdefaultColor(getcolor(colorhigh));
          rec high7 = if Getday()==getlastday()-6 then high(period=aggregationPeriod.DAY) else high7[1];
          plot h7=high7;
          h7.setpaintingStrategy(paintingStrategyhigh);
          h7.setdefaultColor(getcolor(colorhigh));
          rec high8 = if Getday()==getlastday()-7 then high(period=aggregationPeriod.DAY) else high8[1];
          plot h8=high8;
          h8.setpaintingStrategy(paintingStrategyhigh);
          h8.setdefaultColor(getcolor(colorhigh));
          rec high9 = if Getday()==getlastday()-8 then high(period=aggregationPeriod.DAY) else high9[1];
          plot h9=high9;
          h9.setpaintingStrategy(paintingStrategyhigh);
          h9.setdefaultColor(getcolor(colorhigh));
          rec high10 = if Getday()==getlastday()-9 then high(period=aggregationPeriod.DAY) else high10[1];
          plot h10=high10;
          h10.setpaintingStrategy(paintingStrategyhigh);
          h10.setdefaultColor(getcolor(colorhigh));
          rec high11 = if Getday()==getlastday()-10 then high(period=aggregationPeriod.DAY) else high11[1];
          plot h11=high11;
          h11.setpaintingStrategy(paintingStrategyhigh);
          h11.setdefaultColor(getcolor(colorhigh));
          rec high12 = if Getday()==getlastday()-11 then high(period=aggregationPeriod.DAY) else high12[1];
          plot h12=high12;
          h12.setpaintingStrategy(paintingStrategyhigh);
          h12.setdefaultColor(getcolor(colorhigh));
          rec high13 = if Getday()==getlastday()-12 then high(period=aggregationPeriod.DAY) else high13[1];
          plot h13=high13;
          h13.setpaintingStrategy(paintingStrategyhigh);
          h13.setdefaultColor(getcolor(colorhigh));
          rec high14 = if Getday()==getlastday()-13 then high(period=aggregationPeriod.DAY) else high14[1];
          plot h14=high14;
          h14.setpaintingStrategy(paintingStrategyhigh);
          h14.setdefaultColor(getcolor(colorhigh));
          rec high15 = if Getday()==getlastday()-14 then high(period=aggregationPeriod.DAY) else high15[1];
          plot h15=high15;
          h15.setpaintingStrategy(paintingStrategyhigh);
          h15.setdefaultColor(getcolor(colorhigh));


          rec low1 = if Getday()==getlastday() then low(period=aggregationPeriod.DAY) else low1[1];
          plot l1=low1;
          l1.setpaintingStrategy(paintingStrategylow);
          l1.setdefaultColor(getcolor(colorlow));
          rec low2 = if Getday()==getlastday()-1 then low(period=aggregationPeriod.DAY) else low2[1];
          plot l2=low2;
          l2.setpaintingStrategy(paintingStrategylow);
          l2.setdefaultColor(getcolor(colorlow));
          rec low3 = if Getday()==getlastday()-2 then low(period=aggregationPeriod.DAY) else low3[1];
          plot l3=low3;
          l3.setpaintingStrategy(paintingStrategylow);
          l3.setdefaultColor(getcolor(colorlow));
          rec low4 = if Getday()==getlastday()-3 then low(period=aggregationPeriod.DAY) else low4[1];
          plot l4=low4;
          l4.setpaintingStrategy(paintingStrategylow);
          l4.setdefaultColor(getcolor(colorlow));
          rec low5 = if Getday()==getlastday()-4 then low(period=aggregationPeriod.DAY) else low5[1];
          plot l5=low5;
          l5.setpaintingStrategy(paintingStrategylow);
          l5.setdefaultColor(getcolor(colorlow));
          rec low6 = if Getday()==getlastday()-5 then low(period=aggregationPeriod.DAY) else low5[1];
          plot l6=low6;
          l6.setpaintingStrategy(paintingStrategylow);
          l6.setdefaultColor(getcolor(colorlow));
          rec low7 = if Getday()==getlastday()-6 then low(period=aggregationPeriod.DAY) else low7[1];
          plot l7=low7;
          l7.setpaintingStrategy(paintingStrategylow);
          l7.setdefaultColor(getcolor(colorlow));
          rec low8 = if Getday()==getlastday()-7 then low(period=aggregationPeriod.DAY) else low8[1];
          plot l8=low8;
          l8.setpaintingStrategy(paintingStrategylow);
          l8.setdefaultColor(getcolor(colorlow));
          rec low9 = if Getday()==getlastday()-8 then low(period=aggregationPeriod.DAY) else low9[1];
          plot l9=low9;
          l9.setpaintingStrategy(paintingStrategylow);
          l9.setdefaultColor(getcolor(colorlow));
          rec low10 = if Getday()==getlastday()-9 then low(period=aggregationPeriod.DAY) else low10[1];
          plot l10=low10;
          l10.setpaintingStrategy(paintingStrategylow);
          l10.setdefaultColor(getcolor(colorlow));
          rec low11 = if Getday()==getlastday()-10 then low(period=aggregationPeriod.DAY) else low11[1];
          plot l11=low11;
          l11.setpaintingStrategy(paintingStrategylow);
          l11.setdefaultColor(getcolor(colorlow));
          rec low12 = if Getday()==getlastday()-11then low(period=aggregationPeriod.DAY) else low12[1];
          plot l12=low12;
          l12.setpaintingStrategy(paintingStrategylow);
          l12.setdefaultColor(getcolor(colorlow));
          rec low13 = if Getday()==getlastday()-12 then low(period=aggregationPeriod.DAY) else low13[1];
          plot l13=low13;
          l13.setpaintingStrategy(paintingStrategylow);
          l13.setdefaultColor(getcolor(colorlow));
          rec low14 = if Getday()==getlastday()-13 then low(period=aggregationPeriod.DAY) else low14[1];
          plot l14=low14;
          l14.setpaintingStrategy(paintingStrategylow);
          l14.setdefaultColor(getcolor(colorlow));
          rec low15 = if Getday()==getlastday()-14 then low(period=aggregationPeriod.DAY) else low15[1];
          plot l15=low15;
          l15.setpaintingStrategy(paintingStrategylow);
          l15.setdefaultColor(getcolor(colorlow));


          --- In TOS_thinkscript@yahoogroups.com, Larry thompson <larthomp1@...> wrote:
          >
          > I only trade stocks, so I am not sure of trading hours for other instruments. However, I have created a script that plots up to the last 10 days of previous high/lows, extending them to the right, but not the left. It has selectable (click the ? next to the input to see the options) plotting and coloring for the plots. It seems to plot on all intraday timeframes and for both time and tick charts. See if this is close to what you were looking to get.
          >
          > #High and Lows per day for last 10 days on chart
          > input painthigh=4;#Hint painthigh: 1=dots,2=dashes,3=squares,4=horizontal
          > def paintingStrategyhigh = if painthigh==1 then PaintingStrategy.POINTS else if painthigh==4 then PaintingStrategy.DASHES else if painthigh==3 then PaintingStrategy.SQUARES else PaintingStrategy.HORIZONTAL;
          > input paintlow=1; #Hint paintlow: 1=dots,2=dashes,3=squares,4=horizontal
          > def paintingStrategylow = if painthigh==1 then PaintingStrategy.POINTS else if painthigh==2 then PaintingStrategy.DASHES else if painthigh==3 then PaintingStrategy.SQUARES else PaintingStrategy.HORIZONTAL;
          > rec high1 = if Getday()==getlastday() then high(period=aggregationPeriod.DAY) else high1[1];
          > input colorhigh=5;#Hint colorhigh: 0=magenta,1=cyan,2=light-red,3=light_green,4=yellow,5=red,6=green,7=light_gray,8=gold,9=white
          > input colorlow =6;#Hint colorlow: 0=magenta,1=cyan,2=light-red,3=light_green,4=yellow,5=red,6=green,7=light_gray,8=gold,9=white
          > plot h1=high1;
          > h1.setpaintingStrategy(paintingStrategyhigh);
          > h1.setdefaultColor(getcolor(colorhigh));
          > rec high2 = if Getday()==getlastday()-1 then high(period=aggregationPeriod.DAY) else high2[1];
          > plot h2=high2;
          > h2.setpaintingStrategy(paintingStrategyhigh);
          > h2.setdefaultColor(getcolor(colorhigh));
          > rec high3 = if Getday()==getlastday()-2 then high(period=aggregationPeriod.DAY) else high3[1];
          > plot h3=high3;
          > h3.setpaintingStrategy(paintingStrategyhigh);
          > h3.setdefaultColor(getcolor(colorhigh));
          > rec high4 = if Getday()==getlastday()-3 then high(period=aggregationPeriod.DAY) else high4[1];
          > plot h4=high4;
          > h4.setpaintingStrategy(paintingStrategyhigh);
          > h4.setdefaultColor(getcolor(colorhigh));
          > rec high5 = if Getday()==getlastday()-4 then high(period=aggregationPeriod.DAY) else high5[1];
          > plot h5=high5;
          > h5.setpaintingStrategy(paintingStrategyhigh);
          > h5.setdefaultColor(getcolor(colorhigh));
          > rec high6 = if Getday()==getlastday()-5 then high(period=aggregationPeriod.DAY) else high6[1];
          > plot h6=high6;
          > h6.setpaintingStrategy(paintingStrategyhigh);
          > h6.setdefaultColor(getcolor(colorhigh));
          > rec high7 = if Getday()==getlastday()-6 then high(period=aggregationPeriod.DAY) else high7[1];
          > plot h7=high7;
          > h7.setpaintingStrategy(paintingStrategyhigh);
          > h7.setdefaultColor(getcolor(colorhigh));
          > rec high8 = if Getday()==getlastday()-7 then high(period=aggregationPeriod.DAY) else high8[1];
          > plot h8=high8;
          > h8.setpaintingStrategy(paintingStrategyhigh);
          > h8.setdefaultColor(getcolor(colorhigh));
          > rec high9 = if Getday()==getlastday()-8 then high(period=aggregationPeriod.DAY) else high9[1];
          > plot h9=high9;
          > h9.setpaintingStrategy(paintingStrategyhigh);
          > h9.setdefaultColor(getcolor(colorhigh));
          > rec high10 = if Getday()==getlastday()-9 then high(period=aggregationPeriod.DAY) else high10[1];
          > plot h10=high10;
          > h10.setpaintingStrategy(paintingStrategyhigh);
          > h10.setdefaultColor(getcolor(colorhigh));
          > rec high11 = if Getday()==getlastday()-10 then high(period=aggregationPeriod.DAY) else high11[1];
          > plot h11=high11;
          > h11.setpaintingStrategy(paintingStrategyhigh);
          > h11.setdefaultColor(getcolor(colorhigh));
          > rec high12 = if Getday()==getlastday()-11 then high(period=aggregationPeriod.DAY) else high12[1];
          > plot h12=high12;
          > h12.setpaintingStrategy(paintingStrategyhigh);
          > h12.setdefaultColor(getcolor(colorhigh));
          > rec high13 = if Getday()==getlastday()-12 then high(period=aggregationPeriod.DAY) else high13[1];
          > plot h13=high13;
          > h13.setpaintingStrategy(paintingStrategyhigh);
          > h13.setdefaultColor(getcolor(colorhigh));
          > rec high14 = if Getday()==getlastday()-13 then high(period=aggregationPeriod.DAY) else high14[1];
          > plot h14=high14;
          > h14.setpaintingStrategy(paintingStrategyhigh);
          > h14.setdefaultColor(getcolor(colorhigh));
          > rec high15 = if Getday()==getlastday()-14 then high(period=aggregationPeriod.DAY) else high15[1];
          > plot h15=high15;
          > h15.setpaintingStrategy(paintingStrategyhigh);
          > h15.setdefaultColor(getcolor(colorhigh));
          >
          > rec low1 = if Getday()==getlastday() then low(period=aggregationPeriod.DAY) else low1[1];
          > plot l1=low1;
          > l1.setpaintingStrategy(paintingStrategylow);
          > l1.setdefaultColor(getcolor(colorlow));
          > rec low2 = if Getday()==getlastday()-1 then low(period=aggregationPeriod.DAY) else low2[1];
          > plot l2=low2;
          > l2.setpaintingStrategy(paintingStrategylow);
          > l2.setdefaultColor(getcolor(colorlow));
          > rec low3 = if Getday()==getlastday()-2 then low(period=aggregationPeriod.DAY) else low3[1];
          > plot l3=low3;
          > l3.setpaintingStrategy(paintingStrategylow);
          > l3.setdefaultColor(getcolor(colorlow));
          > rec low4 = if Getday()==getlastday()-3 then low(period=aggregationPeriod.DAY) else low4[1];
          > plot l4=low4;
          > l4.setpaintingStrategy(paintingStrategylow);
          > l4.setdefaultColor(getcolor(colorlow));
          > rec low5 = if Getday()==getlastday()-4 then low(period=aggregationPeriod.DAY) else low5[1];
          > plot l5=low5;
          > l5.setpaintingStrategy(paintingStrategylow);
          > l5.setdefaultColor(getcolor(colorlow));
          > rec low6 = if Getday()==getlastday()-5 then low(period=aggregationPeriod.DAY) else low5[1];
          > plot l6=low6;
          > l6.setpaintingStrategy(paintingStrategylow);
          > l6.setdefaultColor(getcolor(colorlow));
          > rec low7 = if Getday()==getlastday()-6 then low(period=aggregationPeriod.DAY) else low7[1];
          > plot l7=low7;
          > l7.setpaintingStrategy(paintingStrategylow);
          > l7.setdefaultColor(getcolor(colorlow));
          > rec low8 = if Getday()==getlastday()-7 then low(period=aggregationPeriod.DAY) else low8[1];
          > plot l8=low8;
          > l8.setpaintingStrategy(paintingStrategylow);
          > l8.setdefaultColor(getcolor(colorlow));
          > rec low9 = if Getday()==getlastday()-8 then low(period=aggregationPeriod.DAY) else low9[1];
          > plot l9=low9;
          > l9.setpaintingStrategy(paintingStrategylow);
          > l9.setdefaultColor(getcolor(colorlow));
          > rec low10 = if Getday()==getlastday()-9 then low(period=aggregationPeriod.DAY) else low10[1];
          > plot l10=low10;
          > l10.setpaintingStrategy(paintingStrategylow);
          > l10.setdefaultColor(getcolor(colorlow));
          > rec low11 = if Getday()==getlastday()-10 then low(period=aggregationPeriod.DAY) else low11[1];
          > plot l11=low11;
          > l11.setpaintingStrategy(paintingStrategylow);
          > l11.setdefaultColor(getcolor(colorlow));
          > rec low12 = if Getday()==getlastday()-11then low(period=aggregationPeriod.DAY) else low12[1];
          > plot l12=low12;
          > l12.setpaintingStrategy(paintingStrategylow);
          > l12.setdefaultColor(getcolor(colorlow));
          > rec low13 = if Getday()==getlastday()-12 then low(period=aggregationPeriod.DAY) else low13[1];
          > plot l13=low13;
          > l13.setpaintingStrategy(paintingStrategy.HORIZONTAL);
          > l13.setdefaultColor(getcolor(colorlow));
          > rec low14 = if Getday()==getlastday()-13 then low(period=aggregationPeriod.DAY) else low14[1];
          > plot l14=low14;
          > l14.setpaintingStrategy(paintingStrategy.HORIZONTAL);
          > l14.setdefaultColor(getcolor(colorlow));
          > rec low15 = if Getday()==getlastday()-14 then low(period=aggregationPeriod.DAY) else low15[1];
          > plot l15=low15;
          > l15.setpaintingStrategy(paintingStrategy.HORIZONTAL);
          > l15.setdefaultColor(getcolor(colorlow));
          >
        • djterm
          Hello all, below this post is a repost followed by the original post. Please peruse. Let me restate in a different way what I am trying to do to hopefully
          Message 5 of 14 , Mar 24, 2013
          • 0 Attachment
            Hello all, below this post is a repost followed by the original post. Please peruse. Let me restate in a different way what I am trying to do to hopefully provide additional clarity:

            I need an automatically generated horizontal line of the prior day high that is a RAY i.e. a line that is generated at a level of the prior day's high and line continues to the left indefinitely and continues to the right indefinitely - with the meaning of the word 'indefinitely' in that the line continues to both ends of the chart i.e. the line runs entire length of the chart.

            Ditto per above for the prior day low.

            When properly generated there will be only two horizontal lines in total - one at the prior day's high and one at the prior day's low - and will adjust daily to the new levels of the next day's prior day high and the next day's prior day low, etc.

            This is driving me crazy. I need help. Thank you in advance.
            __________________________________________________________

            Hello all, following is a re-post of my prior post. A couple of members attempted to address my issue but none of the input correctly addressed my issue. Please read post in its entirety and note that I am not looking for the standard "stair-step-look" indicator that is referenced in the Files folder. Thank you in advance.
            __________________________________________________________

            I need help. I have perused the Files folder but to no avail. I have tried myself to script it but to no avail. I need the following:

            Manual Process - Current way of doing it:
            On TOS when you select Drawings and then select Price Level and then manually draw two horizontal lines at prior day's H and L and then for each line select Edit Properties and then select Yes to Left Ray and Right Ray you now have two lines drawn at prior day's H and L. This is what I need to plot but NOT AS A MANUAL PROCESS.

            Problem Stated:
            How to automate the above Manual Process so that the prior day's H and L lines automatically update each day with the next prior day's H and L etc., etc. Is there a RAY command or something akin to it so that when the prior day's H and L are automatically generated the lines will continue to essentially extend themselves to the left and to the right indefinitely such as a RAY does in the above Manual Process. This would need to work across timeframes and within
            defined trading hours of equities, futures, and ideally forex - or at least equities to start with. And ideally the lines could be modified to be dotted with a certain color.

            There are a lot of good scripters on here to have generated some of the code that I have seen. I would have to believe that this would be relatively straight-forward for them to provide code or give direction as to how. I am at wits end on this one since I have to manually adjust these prior day's H and L lines after the close of each respective session. With multiple symbol, multiple charts on multiple grids, and across multiple timeframes this is very, very time-consuming and painful to perform.

            I would really appreciate a solution to this dilemma. Thank you very much in advance.
          • Richard Houser
            declare upper; def barNum = if IsNaN( close ) then Double.NaN else BarNumber(); def nextHighestBarNum = HighestAll( barNum ) - 1; plot
            Message 6 of 14 , Mar 24, 2013
            • 0 Attachment

              declare upper;

              def barNum            = if IsNaN( close ) then Double.NaN else BarNumber();
              def nextHighestBarNum = HighestAll( barNum ) - 1;
              plot YesterdaysHigh   = HighestAll ( if barNum == nextHighestBarNum then high else Double.NaN );
              plot YesterdaysLow    = LowestAll( if barNum == nextHighestBarNum then low else Double.NaN );


               

              From: TOS_thinkscript@yahoogroups.com [mailto:TOS_thinkscript@yahoogroups.com] On Behalf Of djterm
              Sent: Sunday, March 24, 2013 9:22 PM
              To: TOS_thinkscript@yahoogroups.com
              Subject: [TOS_thinkscript] AUTOMATICALLY PLOT Prior Day High and Low Extended Lines

               

               

              Hello all, below this post is a repost followed by the original post. Please peruse. Let me restate in a different way what I am trying to do to hopefully provide additional clarity:

              I need an automatically generated horizontal line of the prior day high that is a RAY i.e. a line that is generated at a level of the prior day's high and line continues to the left indefinitely and continues to the right indefinitely - with the meaning of the word 'indefinitely' in that the line continues to both ends of the chart i.e. the line runs entire length of the chart.

              Ditto per above for the prior day low.

              When properly generated there will be only two horizontal lines in total - one at the prior day's high and one at the prior day's low - and will adjust daily to the new levels of the next day's prior day high and the next day's prior day low, etc.

              This is driving me crazy. I need help. Thank you in advance.
              __________________________________________________________

              Hello all, following is a re-post of my prior post. A couple of members attempted to address my issue but none of the input correctly addressed my issue. Please read post in its entirety and note that I am not looking for the standard "stair-step-look" indicator that is referenced in the Files folder. Thank you in advance.
              __________________________________________________________

              I need help. I have perused the Files folder but to no avail. I have tried myself to script it but to no avail. I need the following:

              Manual Process - Current way of doing it:
              On TOS when you select Drawings and then select Price Level and then manually draw two horizontal lines at prior day's H and L and then for each line select Edit Properties and then select Yes to Left Ray and Right Ray you now have two lines drawn at prior day's H and L. This is what I need to plot but NOT AS A MANUAL PROCESS.

              Problem Stated:
              How to automate the above Manual Process so that the prior day's H and L lines automatically update each day with the next prior day's H and L etc., etc. Is there a RAY command or something akin to it so that when the prior day's H and L are automatically generated the lines will continue to essentially extend themselves to the left and to the right indefinitely such as a RAY does in the above Manual Process. This would need to work across timeframes and within
              defined trading hours of equities, futures, and ideally forex - or at least equities to start with. And ideally the lines could be modified to be dotted with a certain color.

              There are a lot of good scripters on here to have generated some of the code that I have seen. I would have to believe that this would be relatively straight-forward for them to provide code or give direction as to how. I am at wits end on this one since I have to manually adjust these prior day's H and L lines after the close of each respective session. With multiple symbol, multiple charts on multiple grids, and across multiple timeframes this is very, very time-consuming and painful to perform.

              I would really appreciate a solution to this dilemma. Thank you very much in advance.

            • Richard Houser
              Apparently djterm needed this on any time frame. As it turned out writing this to function on all intraday charts and the daily chart was much more of a
              Message 7 of 14 , Apr 10, 2013

              Apparently djterm needed this on any time frame. As it turned out writing this to function on all intraday charts and the daily chart was much more of a challenge than I thought it was going to be, as I couldn't use the normal SecondsFromTime/SecondsTillTime functions on a daily chart. At one point I had to step away and do a little chop wood carry water thing to clear my thoughts, so I went downstairs and whipped up a cauldron of pozole. That did the trick when I returned to my desk it just fell together. It doesn't look like much, but it's been one of the trickiest little scripts I've done.

              I've seen similar requests for a previous day's range plot in the past, so here it is. Be careful, this is not the same as an opening range plot. The .ts file is attached.

              # RH_PreviousDayHighLowRangeSTUDY.ts
              # Code by rhouser
              # copyright 4/10/2013 All rights reserved.
              # Permission granted to use, copy, modify to members of the Yahoo TOS_thinkscript Group

              #hint:<b>RH_PreviousDayHighLowRangeSTUDY</b>\nShows the high/low range from the previous day, works on all timeframes from daily through intraday.

              declare upper;

              def day             = GetDay();
              def lastDay         = GetLastDay();
              def year            = GetYear();
              def lastYear        = GetLastYear();
              def yyyymmdd        = GetYYYYMMDD();

              def lastDate        = HighestAll( if day == lastDay and year == lastYear then yyyymmdd else Double.NaN );
              def currentDate     = if yyyymmdd < lastDate then yyyymmdd else lastDate;
              def previousDay     = if CountTradingDays( currentDate, lastDate ) == 2 then yes else no;

              plot YesterdaysHigh = HighestAll( if previousDay then high( period = "DAY" ) else Double.NaN );
              plot YesterdaysLow  = HighestAll( if previousDay then low( period = "DAY" )  else Double.NaN );

              #===============================[ Look & Feel ]================================
              YesterdaysHigh
              .SetDefaultColor( Color.UPTICK );
              YesterdaysHigh
              .SetLineWeight( 2 );
              YesterdaysHigh
              .HideBubble();

              YesterdaysLow
              .SetDefaultColor( Color.DOWNTICK );
              YesterdaysLow
              .SetLineWeight( 2 );
              YesterdaysLow
              .HideBubble();


               

              From: TOS_thinkscript@yahoogroups.com [mailto:TOS_thinkscript@yahoogroups.com] On Behalf Of Richard Houser
              Sent: Monday, March 25, 2013 1:18 AM
              To: TOS_thinkscript@yahoogroups.com
              Subject: RE: [TOS_thinkscript] AUTOMATICALLY PLOT Prior Day High and Low Extended Lines

               

               

              declare upper;

              def barNum            = if IsNaN( close ) then Double.NaN else BarNumber();
              def nextHighestBarNum = HighestAll( barNum ) - 1;
              plot YesterdaysHigh   = HighestAll ( if barNum == nextHighestBarNum then high else Double.NaN );
              plot YesterdaysLow    = LowestAll( if barNum == nextHighestBarNum then low else Double.NaN );



               

              From: TOS_thinkscript@yahoogroups.com [mailto:TOS_thinkscript@yahoogroups.com] On Behalf Of djterm
              Sent: Sunday, March 24, 2013 9:22 PM
              To: TOS_thinkscript@yahoogroups.com
              Subject: [TOS_thinkscript] AUTOMATICALLY PLOT Prior Day High and Low Extended Lines

               

               

              Hello all, below this post is a repost followed by the original post. Please peruse. Let me restate in a different way what I am trying to do to hopefully provide additional clarity:

              I need an automatically generated horizontal line of the prior day high that is a RAY i.e. a line that is generated at a level of the prior day's high and line continues to the left indefinitely and continues to the right indefinitely - with the meaning of the word 'indefinitely' in that the line continues to both ends of the chart i.e. the line runs entire length of the chart.

              Ditto per above for the prior day low.

              When properly generated there will be only two horizontal lines in total - one at the prior day's high and one at the prior day's low - and will adjust daily to the new levels of the next day's prior day high and the next day's prior day low, etc.

              This is driving me crazy. I need help. Thank you in advance.
              __________________________________________________________

              Hello all, following is a re-post of my prior post. A couple of members attempted to address my issue but none of the input correctly addressed my issue. Please read post in its entirety and note that I am not looking for the standard "stair-step-look" indicator that is referenced in the Files folder. Thank you in advance.
              __________________________________________________________

              I need help. I have perused the Files folder but to no avail. I have tried myself to script it but to no avail. I need the follo! wing:

              Manual Process - Current way of doing it:
              On TOS when you select Drawings and then select Price Level and then manually draw two horizontal lines at prior day's H and L and then for each line select Edit Properties and then select Yes to Left Ray and Right Ray you now have two lines drawn at prior day's H and L. This is what I need to plot but NOT AS A MANUAL PROCESS.

              Problem Stated:
              How to automate the above Manual Process so that the prior day's H and L lines automatically update each day with the next prior day's H and L etc., etc. Is there a RAY command or something akin to it so that when the prior day's H and L are automatically generated the lines will continue to essentially extend themselves to the left and to the right indefinitely such as a RAY does in the above Manual Process. This would need to work across timeframes and within
              defined trading hours of equities, futures, and ideally forex - or at least equities to start with. And ideally the lines could be modified to be dotted with a certain color.

              There are a lot of good scripters on here to have generated some of the code that I have seen. I would have to believe that this would be relatively straight-forward for them to provide code or give direction as to how. I am at wits end on this one since I have to manually adjust these prior day's H and L lines after the close of each respective session. With multiple symbol, multiple charts on multiple grids, and across multiple timeframes this is very, very time-consuming and painful to perform.

              I would really appreciate a solution to this dilemma. Thank you very much in advance.

            • tos_susie
              This is great! Thank you. Susie
              Message 8 of 14 , May 22, 2013
              • 0 Attachment
                This is great! Thank you.

                Susie

                --- In TOS_thinkscript@yahoogroups.com, "Richard Houser" <rhouser@...> wrote:
                >
                > Apparently djterm needed this on any time frame. As it turned out writing
                > this to function on all intraday charts and the daily chart was much more of
                > a challenge than I thought it was going to be, as I couldn't use the normal
                > SecondsFromTime/SecondsTillTime functions on a daily chart. At one point I
                > had to step away and do a little chop wood carry water thing to clear my
                > thoughts, so I went downstairs and whipped up a cauldron of pozole. That did
                > the trick when I returned to my desk it just fell together. It doesn't look
                > like much, but it's been one of the trickiest little scripts I've done.
                >
                > I've seen similar requests for a previous day's range plot in the past, so
                > here it is. Be careful, this is not the same as an opening range plot. The
                > .ts file is attached.
                >
                > # RH_PreviousDayHighLowRangeSTUDY.ts
                > # Code by rhouser
                > # copyright 4/10/2013 All rights reserved.
                > # Permission granted to use, copy, modify to members of the Yahoo
                > TOS_thinkscript Group
                >
                > #hint:<b>RH_PreviousDayHighLowRangeSTUDY</b>\nShows the high/low range from
                > the previous day, works on all timeframes from daily through intraday.
                >
                > declare upper;
                >
                > def day = GetDay();
                > def lastDay = GetLastDay();
                > def year = GetYear();
                > def lastYear = GetLastYear();
                > def yyyymmdd = GetYYYYMMDD();
                >
                > def lastDate = HighestAll( if day == lastDay and year == lastYear
                > then yyyymmdd else Double.NaN );
                > def currentDate = if yyyymmdd < lastDate then yyyymmdd else lastDate;
                > def previousDay = if CountTradingDays( currentDate, lastDate ) == 2 then
                > yes else no;
                >
                > plot YesterdaysHigh = HighestAll( if previousDay then high( period = "DAY" )
                > else Double.NaN );
                > plot YesterdaysLow = HighestAll( if previousDay then low( period = "DAY" )
                > else Double.NaN );
                >
                > #===============================[ Look & Feel
                > ]================================
                > YesterdaysHigh.SetDefaultColor( Color.UPTICK );
                > YesterdaysHigh.SetLineWeight( 2 );
                > YesterdaysHigh.HideBubble();
                >
                > YesterdaysLow.SetDefaultColor( Color.DOWNTICK );
                > YesterdaysLow.SetLineWeight( 2 );
                > YesterdaysLow.HideBubble();
                >
                >
                >
                >
                >
                >
                > From: TOS_thinkscript@yahoogroups.com
                > [mailto:TOS_thinkscript@yahoogroups.com] On Behalf Of Richard Houser
                > Sent: Monday, March 25, 2013 1:18 AM
                > To: TOS_thinkscript@yahoogroups.com
                > Subject: RE: [TOS_thinkscript] AUTOMATICALLY PLOT Prior Day High and Low
                > Extended Lines
                >
                >
                >
                >
                >
                > declare upper;
                >
                > def barNum = if IsNaN( close ) then Double.NaN else BarNumber();
                > def nextHighestBarNum = HighestAll( barNum ) - 1;
                > plot YesterdaysHigh = HighestAll ( if barNum == nextHighestBarNum then
                > high else Double.NaN );
                > plot YesterdaysLow = LowestAll( if barNum == nextHighestBarNum then low
                > else Double.NaN );
                >
                >
                >
                >
                >
                >
                >
                > From: TOS_thinkscript@yahoogroups.com
                > [mailto:TOS_thinkscript@yahoogroups.com] On Behalf Of djterm
                > Sent: Sunday, March 24, 2013 9:22 PM
                > To: TOS_thinkscript@yahoogroups.com
                > Subject: [TOS_thinkscript] AUTOMATICALLY PLOT Prior Day High and Low
                > Extended Lines
                >
                >
                >
                >
                >
                > Hello all, below this post is a repost followed by the original post. Please
                > peruse. Let me restate in a different way what I am trying to do to
                > hopefully provide additional clarity:
                >
                > I need an automatically generated horizontal line of the prior day high that
                > is a RAY i.e. a line that is generated at a level of the prior day's high
                > and line continues to the left indefinitely and continues to the right
                > indefinitely - with the meaning of the word 'indefinitely' in that the line
                > continues to both ends of the chart i.e. the line runs entire length of the
                > chart.
                >
                > Ditto per above for the prior day low.
                >
                > When properly generated there will be only two horizontal lines in total -
                > one at the prior day's high and one at the prior day's low - and will adjust
                > daily to the new levels of the next day's prior day high and the next day's
                > prior day low, etc.
                >
                > This is driving me crazy. I need help. Thank you in advance.
                > __________________________________________________________
                >
                > Hello all, following is a re-post of my prior post. A couple of members
                > attempted to address my issue but none of the input correctly addressed my
                > issue. Please read post in its entirety and note that I am not looking for
                > the standard "stair-step-look" indicator that is referenced in the Files
                > folder. Thank you in advance.
                > __________________________________________________________
                >
                > I need help. I have perused the Files folder but to no avail. I have tried
                > myself to script it but to no avail. I need the follo! wing:
                >
                > Manual Process - Current way of doing it:
                > On TOS when you select Drawings and then select Price Level and then
                > manually draw two horizontal lines at prior day's H and L and then for each
                > line select Edit Properties and then select Yes to Left Ray and Right Ray
                > you now have two lines drawn at prior day's H and L. This is what I need to
                > plot but NOT AS A MANUAL PROCESS.
                >
                > Problem Stated:
                > How to automate the above Manual Process so that the prior day's H and L
                > lines automatically update each day with the next prior day's H and L etc.,
                > etc. Is there a RAY command or something akin to it so that when the prior
                > day's H and L are automatically generated the lines will continue to
                > essentially extend themselves to the left and to the right indefinitely such
                > as a RAY does in the above Manual Process. This would need to work across
                > timeframes and within
                > defined trading hours of equities, futures, and ideally forex - or at least
                > equities to start with. And ideally the lines could be modified to be dotted
                > with a certain color.
                >
                > There are a lot of good scripters on here to have generated some of the code
                > that I have seen. I would have to believe that this would be relatively
                > straight-forward for them to provide code or give direction as to how. I am
                > at wits end on this one since I have to manually adjust these prior day's H
                > and L lines after the close of each respective session. With multiple
                > symbol, multiple charts on multiple grids, and across multiple timeframes
                > this is very, very time-consuming and painful to perform.
                >
                > I would really appreciate a solution to this dilemma. Thank you very much in
                > advance.
                >
              • armesj
                Thanks Richard, One issue I have is the study doesn t plot using Range charts. It works fine on all Tick and Time charts for me. Maybe I ve screwed up
                Message 9 of 14 , May 26, 2013
                • 0 Attachment
                  Thanks Richard,
                  One issue I have is the study doesn't plot using Range charts. It works fine on all Tick and Time charts for me. Maybe I've screwed up somewhere. John

                  --- In TOS_thinkscript@yahoogroups.com, "Richard Houser" <rhouser@...> wrote:
                  >
                  > Apparently djterm needed this on any time frame. As it turned out writing
                  > this to function on all intraday charts and the daily chart was much more of
                  > a challenge than I thought it was going to be, as I couldn't use the normal
                  > SecondsFromTime/SecondsTillTime functions on a daily chart. At one point I
                  > had to step away and do a little chop wood carry water thing to clear my
                  > thoughts, so I went downstairs and whipped up a cauldron of pozole. That did
                  > the trick when I returned to my desk it just fell together. It doesn't look
                  > like much, but it's been one of the trickiest little scripts I've done.
                  >
                  > I've seen similar requests for a previous day's range plot in the past, so
                  > here it is. Be careful, this is not the same as an opening range plot. The
                  > .ts file is attached.
                  >
                  > # RH_PreviousDayHighLowRangeSTUDY.ts
                  > # Code by rhouser
                  > # copyright 4/10/2013 All rights reserved.
                  > # Permission granted to use, copy, modify to members of the Yahoo
                  > TOS_thinkscript Group
                  >
                  > #hint:<b>RH_PreviousDayHighLowRangeSTUDY</b>\nShows the high/low range from
                  > the previous day, works on all timeframes from daily through intraday.
                  >
                  > declare upper;
                  >
                  > def day = GetDay();
                  > def lastDay = GetLastDay();
                  > def year = GetYear();
                  > def lastYear = GetLastYear();
                  > def yyyymmdd = GetYYYYMMDD();
                  >
                  > def lastDate = HighestAll( if day == lastDay and year == lastYear
                  > then yyyymmdd else Double.NaN );
                  > def currentDate = if yyyymmdd < lastDate then yyyymmdd else lastDate;
                  > def previousDay = if CountTradingDays( currentDate, lastDate ) == 2 then
                  > yes else no;
                  >
                  > plot YesterdaysHigh = HighestAll( if previousDay then high( period = "DAY" )
                  > else Double.NaN );
                  > plot YesterdaysLow = HighestAll( if previousDay then low( period = "DAY" )
                  > else Double.NaN );
                  >
                  > #===============================[ Look & Feel
                  > ]================================
                  > YesterdaysHigh.SetDefaultColor( Color.UPTICK );
                  > YesterdaysHigh.SetLineWeight( 2 );
                  > YesterdaysHigh.HideBubble();
                  >
                  > YesterdaysLow.SetDefaultColor( Color.DOWNTICK );
                  > YesterdaysLow.SetLineWeight( 2 );
                  > YesterdaysLow.HideBubble();
                  >
                  >
                  >
                  >
                  >
                  >
                  > From: TOS_thinkscript@yahoogroups.com
                  > [mailto:TOS_thinkscript@yahoogroups.com] On Behalf Of Richard Houser
                  > Sent: Monday, March 25, 2013 1:18 AM
                  > To: TOS_thinkscript@yahoogroups.com
                  > Subject: RE: [TOS_thinkscript] AUTOMATICALLY PLOT Prior Day High and Low
                  > Extended Lines
                  >
                  >
                  >
                  >
                  >
                  > declare upper;
                  >
                  > def barNum = if IsNaN( close ) then Double.NaN else BarNumber();
                  > def nextHighestBarNum = HighestAll( barNum ) - 1;
                  > plot YesterdaysHigh = HighestAll ( if barNum == nextHighestBarNum then
                  > high else Double.NaN );
                  > plot YesterdaysLow = LowestAll( if barNum == nextHighestBarNum then low
                  > else Double.NaN );
                  >
                  >
                  >
                  >
                  >
                  >
                  >
                  > From: TOS_thinkscript@yahoogroups.com
                  > [mailto:TOS_thinkscript@yahoogroups.com] On Behalf Of djterm
                  > Sent: Sunday, March 24, 2013 9:22 PM
                  > To: TOS_thinkscript@yahoogroups.com
                  > Subject: [TOS_thinkscript] AUTOMATICALLY PLOT Prior Day High and Low
                  > Extended Lines
                  >
                  >
                  >
                  >
                  >
                  > Hello all, below this post is a repost followed by the original post. Please
                  > peruse. Let me restate in a different way what I am trying to do to
                  > hopefully provide additional clarity:
                  >
                  > I need an automatically generated horizontal line of the prior day high that
                  > is a RAY i.e. a line that is generated at a level of the prior day's high
                  > and line continues to the left indefinitely and continues to the right
                  > indefinitely - with the meaning of the word 'indefinitely' in that the line
                  > continues to both ends of the chart i.e. the line runs entire length of the
                  > chart.
                  >
                  > Ditto per above for the prior day low.
                  >
                  > When properly generated there will be only two horizontal lines in total -
                  > one at the prior day's high and one at the prior day's low - and will adjust
                  > daily to the new levels of the next day's prior day high and the next day's
                  > prior day low, etc.
                  >
                  > This is driving me crazy. I need help. Thank you in advance.
                  > __________________________________________________________
                  >
                  > Hello all, following is a re-post of my prior post. A couple of members
                  > attempted to address my issue but none of the input correctly addressed my
                  > issue. Please read post in its entirety and note that I am not looking for
                  > the standard "stair-step-look" indicator that is referenced in the Files
                  > folder. Thank you in advance.
                  > __________________________________________________________
                  >
                  > I need help. I have perused the Files folder but to no avail. I have tried
                  > myself to script it but to no avail. I need the follo! wing:
                  >
                  > Manual Process - Current way of doing it:
                  > On TOS when you select Drawings and then select Price Level and then
                  > manually draw two horizontal lines at prior day's H and L and then for each
                  > line select Edit Properties and then select Yes to Left Ray and Right Ray
                  > you now have two lines drawn at prior day's H and L. This is what I need to
                  > plot but NOT AS A MANUAL PROCESS.
                  >
                  > Problem Stated:
                  > How to automate the above Manual Process so that the prior day's H and L
                  > lines automatically update each day with the next prior day's H and L etc.,
                  > etc. Is there a RAY command or something akin to it so that when the prior
                  > day's H and L are automatically generated the lines will continue to
                  > essentially extend themselves to the left and to the right indefinitely such
                  > as a RAY does in the above Manual Process. This would need to work across
                  > timeframes and within
                  > defined trading hours of equities, futures, and ideally forex - or at least
                  > equities to start with. And ideally the lines could be modified to be dotted
                  > with a certain color.
                  >
                  > There are a lot of good scripters on here to have generated some of the code
                  > that I have seen. I would have to believe that this would be relatively
                  > straight-forward for them to provide code or give direction as to how. I am
                  > at wits end on this one since I have to manually adjust these prior day's H
                  > and L lines after the close of each respective session. With multiple
                  > symbol, multiple charts on multiple grids, and across multiple timeframes
                  > this is very, very time-consuming and painful to perform.
                  >
                  > I would really appreciate a solution to this dilemma. Thank you very much in
                  > advance.
                  >
                Your message has been successfully submitted and would be delivered to recipients shortly.