'How to check if low is under a plot
I have the following plot
last13 = lowest(close, 13)
Bottom = last13 == nz(last13[1]) ? last13 : na
plot(Bottom, color=#0000ff, linewidth=4, style=plot.style_linebr, title="Bottom", offset=0)
It will draw a short straight line on the chart.
I would like to count the number of bars where the line appears.
I want to check also if there is any low under or equal that short straight line, from the beginning of line. If yes, return true, if not, return false.
How can I do that?
Solution 1:[1]
You can use a var
counter for this.
var int bottom_counter = 0
bottom_counter := (not na(Bottom)) ? bottom_counter + 1 : 0
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | vitruvius |