PS: Drag and drop the indicator on for stacking. Go to the settings and scale it to right.
More explanation on the original indicator:
I changed the indicator name to Chaikin Money Flow (CMF) Percentage. I think CMF is the most useful volume-price-based indicator especially for detecting divergences.
Note that TV's built-in CMF is set to 20 length by default.
Since this indicator includes close, high and low in its equation, it should be fine to measure divergences relative to candle high and low, altho candle close would be the ideal one. This is not the case in most other indicators such as RSI. In RSI, indicator's input source should match with price source, otherwise, you will find too many false divergences.