Announcement

Collapse
No announcement yet.

Need Help Plotting a Line of the Lowest 1 Minute Close of Today

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Need Help Plotting a Line of the Lowest 1 Minute Close of Today

    Using a 1 minute chart of any symbol, I have been using the EFS library routine of "Todays Low.efs" to plot a line across the chart for the absolute lowest low of each day. My problem is that the low is sometimes set by data errors or other extreme prices. It would be much more stable if the line plot was for the lowest intraday close of 1 minute (or other interval) bars. The efs file shows the following code to identify the absolute low:
    if(bInit == false){
    xLow = low(inv("D"));
    bInit = true;
    }
    var vLow = getSeries(xLow);
    return (vLow);

    How would this need to be modified so that "vLow" becomes a plot of the lowest intraday close for a 1 minute interval? Although I think such a modification should be fairly straightforward, I've tried a number of variations and can't quite get it right. Any help appreciated, thanks.

  • #2
    lyric
    Use a routine similar to the one I illustrate in this post in which rather than calculating and storing the highest range from a specified point you calculate and store the lowest close and then use a single addBand() function to draw the horizontal line at that value
    Alex


    Originally posted by lyric View Post
    Using a 1 minute chart of any symbol, I have been using the EFS library routine of "Todays Low.efs" to plot a line across the chart for the absolute lowest low of each day. My problem is that the low is sometimes set by data errors or other extreme prices. It would be much more stable if the line plot was for the lowest intraday close of 1 minute (or other interval) bars. The efs file shows the following code to identify the absolute low:
    if(bInit == false){
    xLow = low(inv("D"));
    bInit = true;
    }
    var vLow = getSeries(xLow);
    return (vLow);

    How would this need to be modified so that "vLow" becomes a plot of the lowest intraday close for a 1 minute interval? Although I think such a modification should be fairly straightforward, I've tried a number of variations and can't quite get it right. Any help appreciated, thanks.

    Comment


    • #3
      Alexis,
      Thanks very much for the help with this issue. Your example was VERY useful! I have experimented with several variations on the code u suggested and have settled on something that works for me. One point to note (just for yr background info), is that the suggested shown in the "highest range.efs" link correctly identifies the CLOSING LOW OF EACH MINUTE BAR when a chart is first loaded or drawn. However, any subsequent real-time data updated into the chart will switch to the ABSOLUTE LOW of each bar (something i was trying to avoid). One solution is to add the "setComputeOnClose()" command into the "function preMain()" section of the script. This at least identifies the CLOSING LOW of each real-time previous bar as each NEW bar starts to be drawn. The routine is still stuck with the absolute low for the current bar being updated, but it too will be redrawn with the correct CLOSING LOW after that bar is complete and the next is started in a real-time display.

      Again, many thanks for setting me on the right path. Appreciate all the efforts u put into this forum.

      Comment


      • #4
        lyric
        You are welcome

        <SNIP>One point to note (just for yr background info), is that the suggested shown in the "highest range.efs" link correctly identifies the CLOSING LOW OF EACH MINUTE BAR when a chart is first loaded or drawn. However, any subsequent real-time data updated into the chart will switch to the ABSOLUTE LOW of each bar (something i was trying to avoid)<SNIP>
        FWIW that is why in my reply I suggested to use a routine “similar” to the one in the linked thread, the important part being the overall logic.
        That said you can accomplish what you want either by setting the script to compute on close only (as you have already done) or by computing and storing the lowest Close value at each BARSTATE_NEWBAR
        Alex


        Originally posted by lyric View Post
        Alexis,
        Thanks very much for the help with this issue. Your example was VERY useful! I have experimented with several variations on the code u suggested and have settled on something that works for me. One point to note (just for yr background info), is that the suggested shown in the "highest range.efs" link correctly identifies the CLOSING LOW OF EACH MINUTE BAR when a chart is first loaded or drawn. However, any subsequent real-time data updated into the chart will switch to the ABSOLUTE LOW of each bar (something i was trying to avoid). One solution is to add the "setComputeOnClose()" command into the "function preMain()" section of the script. This at least identifies the CLOSING LOW of each real-time previous bar as each NEW bar starts to be drawn. The routine is still stuck with the absolute low for the current bar being updated, but it too will be redrawn with the correct CLOSING LOW after that bar is complete and the next is started in a real-time display.

        Again, many thanks for setting me on the right path. Appreciate all the efforts u put into this forum.

        Comment

        Working...
        X