Red dots above the candle represent bearish divergences, while green dots below the candle represent bullish divergences.
The main filter for divergences focuses on ATR and the price movement in the past candles up to the lookback period. Divergences are determined when a price movement over the lookback period is sharp enough to be greater/less than the ATR multiplier multiplied by the ATR.
Under "Divergence Settings", both the lookback period and ATR multiplier can be adjusted.
Due to the nature of the calculations, the ATR multiplier and the lookback period should be set lower on higher time frames. As price movements become more averaged, for example on the 15 minute chart, sharp price movements happen less frequently and are often contained in fewer candles as they happen on lower time frames. Less volatile stocks such as KO, CL, or BAC should also use lower ATR multipliers and lower lookback periods.
Under "Visual Settings", you can change the color of the VWAP line, show alternating VWAP colors, adjust divergence signal size, and show the VWAP line.
In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.