PROTECTED SOURCE SCRIPT

Swings P1 / P2 / P3

58
Swing detection via ta.pivothigh/ta.pivotlow (len/len), so labels appear after pivot confirmation (len bars). P2 = swing high, P3 = swing low, P1 marks the prior pivot at trend transition (HH/HL → up, LL/LH → down). Optional ATR minimum leg-length filter.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.