OPEN-SOURCE SCRIPT

+ Accumulation/Distribution

Updated
This is an updated version (with lots of extras added) of the Accumulation/Distribution indicator coded by @Cl8DH.
You can read about what he says about his indicator, and how to use it, here:
tradingview.com/v/hM0zajVr/

So, from that, what have I done?

I added a moving average (of which there are many types to choose from) so that you can use this as a "two lines cross" indicator, as well as a "mid-line cross" indicator.

I added Bollinger Bands (primarily for when "range" is turned off, but if you want to use the Bands with it in fixed range mode too, that's fine. You do you.).

I added candle coloring for both ways of using this indicator:
In rangebound mode there is overbought and oversold coloring, as well as bullish (ADP above the MA and median) and bearish (ADP below the MA and median), and neutral (ADP is above the MA but below the median, or below the MA and above the median). With range turned off there is no overbought or oversold of course. Above the MA and median is bullish, below both is bearish, and neutral covers that grey area where it's neither one nor the other.

The indicator itself is also colored in the same way the candles are. The MA and BBands are biased colored as well (green/red).

Alerts for pretty much every condition imaginable.

Please note in the image above the indicator is pretty gaudy. I don't use it like that, and you can turn a lot of that stuff off (lines, shading, etc.). That is just the default settings.

Like I said, I think Bollinger Bands make most sense if you have it set to range off, but they could be useful either way. Depends on you, the trader.

The candle color is 100% based on the moving average, so if you are using the BBands, set your MA to the default 20 SMA because that's what BBands use for the basis. If you just turn off the MA, whatever it is set to the indicator will still see that and use it (unless you turn off candle colors) to color the candles.

snapshot

Above is the same image, but just with range turned off, and the Bollinger Bands turned off.

That's all. Hope you like this! It's becoming a favorite of mine, and a lot of what I've implemented here will be added to my previously released indicators, as well as any new ones.
Release Notes
added a second moving average like my +BB and +Detrended Price Oscillator indicators
added Jurik Phase input
Release Notes
added a second plot and inputs for it. Idea being similar to moving average crosses and such. I was thinking about this last night: how to filter out false signals, or maybe just make it a little bit easier to detect signals in momentum change. At first I thought just adding moving averages to these indicators might help, and it does, but recently I had a thought that all these indicators we use are just averages of a particular mathematical equation. We could set the lookback/length on all these things to 1, right? But that's incredibly noisy. Better to just use pa if that's the case. So we set these indicators to different values, like 14 or 20, or 50 or whatever, in the same way that moving averages on a chart are used: to clean up the signal to noise. So, instead of just having one plot on the indicator, why not have two of them of varying lengths instead of taking a moving average of what is already a moving average essentially? This would be like running two different MAs on top of price. So, yeah, I've just added a second optional plot to this. Giving it a quick eye check, it looks promising. Haven't traded with it. Just added it this morning.

Tried to figure out some ways to cleanup the inputs side of the indicator, but what I've looked at (inline functions and groups) is beyond my expertise, so it'll have to wait. Screenshot for eyeball test below. Enjoy!

snapshot
Release Notes
added shape plots for moving average cross
added ALMA in moving averages
removed band fill
Release Notes
Updated inputs tab so it's more organized
Added background stripes where the primary and secondary ADPs cross
Added second Bollinger Band in order to create a soft band. This eliminates the need to use the background fill if the user doesn't like the indicator being compressed by the Bollinger Band plots. Color fills can extend outside of frame, whereas plots can not. This is turned on by default, and the plots are turned off. Background fill is always on, as there is no way to turn it off by default. Strange, that.
Lastly, got rid of the "basis" code for the Bollinger Bands. Now, whichever moving average is your primary moving average the bands will be drawn via those data points.
Release Notes
some very important updates here!

This is mainly as a result of a question I received from a user about the use of the secondary DPO in my + DPO indicator (check it out, btw, it's a highly underrated oscillator, imo). And, while understanding the use myself, I realized that my implementation of DPO+DPO crosses was WRONG for the intended use of the second DPO. This realization has carried over into this script, and my implementation of indications around how the second ADP should be used in conjunction with the first, and with all other parts of the indicator. If you want to read why I changed what I did I would suggest checking the update on my +DPO indicator because I don't feel like typing it out again; the reasoning is the same.

With the change in how I've approached the momentum issue between the two different ADP's and the median, I've removed the background stripes from the ADP+ADP cross (they were not very useful) and added background stripes for ADP median crosses as this is a MUCH more useful feature.

I also got rid of the Bollinger Bands fill as my implementation of dual bands with a fill between them does a much neater job of what filling from the bottom to the top plot did.

That's all! Thanks! And happy trading!
Release Notes
just fixed a thing with the TEMA on secondary moving average
increased default length of secondary ADP to 55 from 34 as I think it's a better period for longer periods momentum bias
Release Notes
improved MA color some
Release Notes
fixing a change/error in candle color. apologies.
Release Notes
Changed a few things in the code, here. Mostly, again, cleaning stuff up.

Added color themes using color.from_gradient just as I've been doing with my newer indicators. Overhauling the color for everything. This was the bulk of the work, so it was basically spending a lot of time creating a consistent aesthetic across my indicators.

Added Donchian Channel Bands with adjustable band thickness. I like these, personally, as more of a gauge of indicator volatility than the Bollinger Bands.

Added FRAMA as a moving average type.
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
added auto-plotting divergences

snapshot
Release Notes
added alerts for divergences, clarified alert messages, removed separate bullish/bearish moving average crosses but kept the alert for all types of moving average crosses (with the ADP line, as that is all there is for that)
Release Notes
- updated to pinescript version5
- added VWMA and RMA
- cleaned up some code and verbiage
- inputs for changing colors for moving average crosses, and center line crosses
- removed moving average fill because too many outputs--apologies to anyone who liked filling between the two moving averages if you used that
Release Notes
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.

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)
accumulation_distributionadlinebarcolorCandlestick analysisMoving AveragesnononsenseforexnononsensefxOscillatorsRelative Strength Index (RSI)signalline

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 publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?


Also on:

Disclaimer