I am so glad to join this forum.
I'm very new in Pine Script so sorry if my question is very elementary. This is just to learning and understanding the concepts.
I want to write an indicator that searches for 3 consecutive Bar, that middle one's High is higher than two others, then plot a "xcross" shape above the middle Bar use "plotshape" command.
I used this code, but the "xcross" shape is plotted above the first candle, not the middle one.
Code: Select all
//@version=5
indicator("My script" , overlay = true)
swing_highs=(high[1]>high[0] and high[1]>high[2])
plotshape(swing_highs)