The script is written for Constance Brown-like anayis with divergence signals between price and indicator (i.e. stock close / RSI divergence)
Note: Though the example here with NVDA shows good reversal predictions, best results generally are optained with un-normalized indicators and oscilators like CB#s comosite index.
(For Trading view written by LazyBear.) I use two different lines: an indi high line for baerish, and an indi low line for bullish divergences.
The script only shows divergences to pivot pairs next to each other, not between actual pivot and those "a few pivots ago"
For individual work, chose your indicator and replace rsi in line 10 with it, anything else is auto. Sript bottom: optional comparison lines addable.