Hello,
I have searched the forums but cannot find what I need. Please tell me if it exists somewhere already.
I want horizontal support/resistance lines plotted from the zig/zag turning points. I’d like them plotted up to the point that they are crossed by the closing price.
I’d be much obliged if someone could help. Cheers.
I have the following, but you can see the line needs to continue until close>line, and it doesn’t do that.
I’m sure it just needs a little tweak but I can’t figure out what it is.
percentVariation = (i)
ww = ZigZag[percentVariation](close)
peak = ww<ww[1] and ww[1]>ww[2]
trough = ww>ww[1] and ww[1]<ww[2]
IF trough THEN
support=low
ENDIF
IF peak THEN
resistance=high
ENDIF
support=min(low,support)
resistance=max(high,resistance)
RETURN support as "support", resistance as "resistance"