Announcement

Collapse
No announcement yet.

previous high low

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

  • previous high low

    Is there a study that shows the previous bars high and low on the side of the chart?

  • #2
    marky707
    If by "on the side of the chart" you mean that it displays in the Y-axis (ie the price scale) then you need a script that will return those values to the chart. This can be as simple as the following
    PHP Code:
    function preMain(){
        
    setPriceStudy(true);
        
    setShowCursorLabel(false);
    }
    function 
    main(){
        return new Array (
    high(-1), low(-1));

    Keep in mind that with this solution the script will plot the previous High and Low on all bars in the chart.
    Alternatively you could implement a solution similar to the one offered in this thread in which the lines and text labels are drawn on the chart (the labels will not display in the price scale since the values are not returned to the chart)
    In this case just replace the following lines in that script
    PHP Code:
    var L1 low(0)-Lower1;//ACM added 0 in low()
    var L2 low(0)+Upper2;//as above and replaced invalid Lower2 with Upper2 
    with the following
    PHP Code:
    var L1 high(-1);
    var 
    L2 low(-1); 
    Once you implement this change the script will draw the lines and the text labels based on the prior bar's High and Low
    Alex

    Comment

    Working...
    X