If a pivothigh is calculated using "ta.pviothigh" in pinescript_v5
Can we use pH[1] to indicate the previous pivot high or how can I get the value of the previous one when a new pivot high is found? As I want to check whether the close price of the new found pivot high is higher or lower than the previous pivot high.
I tried the script below and ran it:
pH = ta.pivothigh (close, 5, 5) pH_fall = pH < pH[1]
plotshape (pH, "pH", shape.triangledown, color=color.aqua, size=size.tiny) plotshape (pH_fall, "fall", shape.xcross, color=color.black, size=size.small)
It didn't say there is any mistake in the script but it just not showing the black Xcross that should be indicating a falling pivothigh. How should I amend it?