TradingView
ClassicScott
2021年11月17日晚上10點02分

+ Breadth & Volume 

Curve / TetherKuCoin

描述

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.

Enjoy!

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.

發布通知

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.

發布通知

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.

發布通知

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.

發布通知

added alerts for divergences and clarified alert messages

發布通知

-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

發布通知

I'm publishing updates to all of my indicators, so I'm just going to comment on everything here since most of the updates are common across most of my indicators.

Specific to + Breadth and Volume I've added Accumulation-Distribution, Price Volume Trend, and the Chaikin Oscillator of PVT as indicators to choose from.

User Non-Visible Updates (basically backend stuff that makes:
- changes in code legibility and consistency across all indicators (basically standardizing the coding across as many indicators as possible)
- implementation of libraries into my indicators; which helps significantly in doing what I typed above; which in turn will make creating any new indicators, if they are of the type to use these libraries, much simpler
- updated descriptions for all indicators, which should (it's possible I've forgotten things) reflect changes I've made recently and any I may have made in the past after first publication (this is very minor, but as I was changing so much I thought I may as well--I don't intend to update these much, if at all, in the future)

User Visible Updates:
- as I mentioned everything now uses my moving averages library and volatility bands library--this cuts down the total amount of code significantly, and has made it easier for me to add moving averages, or volatility bands to these indicators because I only had to/have to add it one time (to the library) rather than multiple times across all indicators*
- since creating these libraries I've added several new moving averages (Kaufman Adaptive, Laguerre Filter, McGinley Dynamic (doesn't work for all), and Zero-lag) to them while retaining all the previous with the exception of the UMA, which wasn't implemented consistently across all indicators anyway
- eliminated having two Bollinger Bands with different standard deviations and a fill between them in exchange for one with the band fill implementation that I use on my Donchian Channels Bands
- part of my code consistency across all indicators resulted in a much needed organization of the 'style' tab

*(affects all but the Wavetrend Oscillator, Wavetrend Oscillator Overlay, Jurik KDJ, Average Candle Bodies Range, Bollinger Bands Width, ALMA Trend Detector, Ultimate Moving Average, Donchian Channels, and Dynamic Donchian Channels)
評論
nangongboling
彩色蜡烛图cun.ma是什么啊,网上怎么搜不到
kakola
Nice. I've no idea what settings are optimal.

Hey keep in mind that pinescript has a `math.e` constant. Thanks.
ionu82
Thank you, you've been quite helpful, and there are no words to express how grateful I am for all of your free sharing.
ClassicScott
@ionu82, Glad I could be of service, and thank you for the kind comment.
rareAnalyst86604
Thank you for a good indicator
ClassicScott
@rareAnalyst86604, of course! my pleasure. Glad you like it.
midWestRider
Great indicator! Is there a way to set an alert when the BV line changes from blue to orange?
ClassicScott
@midWestRider, Thank you very much! There is in a sense a way to set alerts, and it's actually already made available. The color change is a result of a few different things, all of which are selectable by the user. Color change is based on the BV line's relationship to various other plots on the indicator. If you look at the dropdown boxes for the colors you'll see that the colors are caused by the BV line's relationship to 1) the Donchian Channels, 2) the Bollinger Bands, 3) the moving average, 4) the basis of the Donchian Channel, and 5 & 6) the moving average or basis when used as OBV (because there is no centerline with OBV).

So, 1) with the Donchian Channels the color evolves through a gradient based on how far it is from the top and bottom bands. You can see that in the pictures, or if you put it on your chart. There is no way to set an alert for a color change because it is so gradual. There is no orange to blue. It just fades. So, realistically you would use the alerts for price touching the DC bands, and this is the exact same for the Bollinger Bands.

Now, with the moving average and basis it's a little more cut and dry, but the color isn't necessarily going to go directly from blue to orange. It usually goes to gray first because if the moving average is above the centerline, for example, and price crosses down through it I consider that a sort of neutral area where the BV, or price, isn't necessarily bullish because it's coming down (likely just a pullback), but it's not bearish either because momentum is clearly positive (the moving average is above the centerline). This goes for the basis as well. In this case the alert you would use is the one for the BV crossing the moving average or crossing the basis: it's not necessarily going to go from orange to blue (or gray), but those color changes are just reflections of the BV line's relationship to the moving average or basis (as well as the centerline). Of course if you're using the OBV, because there is no centerline the colors will change directly from blue to orange to blue.

Hope that's helpful.
midWestRider
@ClassicScott, thank you for the information. Very helpful!
spdoinkal
awesome indicator, thanks for your contribution to the public scripts!
更多