+ Breadth & Volume

ClassicScott Updated   
note* If you've used my "+ Rate of Change Indicator", I am updating that without the OBV, which has been moved here. Just an FYI.

This "indicator" is basically a variety of indicators that measure volume, or accumulation/distribution. There's a bit of a story about how this came about but
it's not that interesting, so I'll spare you.

Indicators from which you may choose here are On Balance Volume (OBV), Money Flow Index (MFI), Chaikin Money Flow (CMF), Chaikin Oscillator, and Positive & Negative Net Volume.

I'll give a brief overview of these below, and if you want to educate yourself further on them you may. There are many web resources for that.

Most people are probably familiar with OBV. It's one of the more commonly used volume indicators, especially in the crypto crowd (at least amongst those traders I follow). It's basically a cumulative (doesn't oscillate around a midpoint) momentum indicator that measures volume of the current period versus volume of the previous period and adds it if price closed higher, but subtracts it if price closes lower. It's another way of using volume to confirm trend.

The MFI is a momentum indicator that measures the flow of money into and out of an asset over some period of time (user input). It's calculated using the RSI, so it can be used similarly to RSI (divergences, overbought, oversold, etc.), but of course unlike the RSI it's calculated primarily using volume and comparing the most recent candle close to the previous one (similar to OBV).

CMF is a volume-weighted average of accumulation and distribution over a some period of time (typically 21). It's a way of measuring accumulation versus
distribution in an asset, and oscillates around a zero line. You would use it similarly to any other oscillator, in that you can look for divergences, and general positive or negative momentum.

Chaikin Oscillator is basically a MACD (without signal line) of the accumulation and distribution index (or line--which is somehow different than simply accumulation and distribution). I haven't looked into these differences deeply, but if you look below at the calculations, and substituted 'ad' for 'accdist' you get very different readings. I actually did that, and what it looks like it would do is turn the actual Oscillator into a MACD signal line. So, by substituting 'ad' for 'accdist' (or the accumulation/distribution index) you produce a signal line of the Chaikin Oscillator.
Anyway, all that confusion out of the way, as I said, it's a MACD on the accumulation and distribution index, therefore it is another zero line oscillator, and similarly to CMF, it's a way of measuring price movements in the chart versus a/d. The zero line isn't just any old zero line, however, it is actually the accumulation distribution line. I've made an OBV version of this by substituting the OBV for AD, so if you prefer OBV maybe you will like that.

Pos. & Neg Net Volume is actually an indicator I had seen made by RafaelZioni. It basically takes net volume, calculates a cumulative of that, then subtracts a moving average of some period from the cumulative net volume in order to create a volume oscillator. Use it like the other oscillators!

Added Donchian Channels, moving averages, Bollinger Bands, colored everything, and alerts.


Below I will post images with the different indicators, everything on default settings (except for lookback period, which I have adjusted to my personal preferences).

Above is an image with the MFI being compared to the RSI since they are very similar (MFI being basically a volume derivative of the RSI).

Chaikin Money Flow set to lookback of 13. You could probably extend that a bit if you wanted to smooth the line more.

Chaikin Oscillator and Chaikin Oscillator of OBV, with a zoomed in look below, to see the differences more clearly.

CO and COBV closer look.

Positive & Negative Net Volume.
Release Notes:
I just changed 'power' to a float from an integer so that you can fine tune the moving average more. It was something that someone pointed out to me in a comment of another indicator I released.
Release Notes:
Been adding auto-plotting divergences to my indicators of late.

I have to say this was kind of a bad spot to take a screenshot, in terms of divergences. Probably the worst spot I could have chosen, tbh. Every indicator on the planet was showing divergences on this grind up from 30k to 50k on bitcoin. And then of course the typical pop all the way at the top that destroys an divergences (except for CMF, apparently? (though it's close)) and traps bulls.
Release Notes:
changing the bandwidth of the donchian bands to a float in half steps, so you can adjust it a bit more minutely. Thought I had changed this across all indicators, but obviously missed it here.
Release Notes:
added alerts for divergences and clarified alert messages
Release Notes:
-converted to pinescript 5
-fixed formula for OBV - previous formula using rate of change instead of just change, was so it could be smoothed, but smoothing obv doesn't work out that great (at least by using rate of change). Consequently it screwed up the Chaikin Osc. OBV because it was double smoothing that. Chaikin OBV works much better now, and changing lookback periods produces results that make much more visual sense.
-added colors for center line cross, so the oscillator and candles are highlighted only if they are above or below the center line
-improved the reading of some menu items
--added a couple moving averages

Open-source script

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.


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.

Want to use this script on a chart?