TradingView
insideandup
Feb 28, 2024 6:26 PM

Up Down Volume Ratio by 3iau 

Apple Inc.NASDAQ

Description

This script considers the total volume within a user specified time frame, and whether price closed higher or lower at the end of each period within that time frame.

EXAMPLE:

* If the time period of interest is 50-periods, the script considers the volume within each of those 50 periods beginning with the most recent closed period.

* SumUpVol = the sum of all volume occurring within only those periods where price closed higher than that of the previous period.

* SumDnVol = the sum of all volume occurring within only those periods where price closed lower than that of the previous period.

* Difference = the difference between SumUpVol and SumDnVol = SumUpVol - SumDnVol

* Total = the sum of SumUpVol and SumDnVol = SumUpVol + SumDnVol

* The plot will present the change in Difference divided by Total = Difference/Total = (SumUpVol - SumDnVol)/(SumUpVol + SumDnVol) occurring within those 50 periods. What will be plotted is the moving average of this value. The user can specify the moving average type and the number of period for which the average is calculated.

* The plot needs to be fitted into a range, for example, +/- 50 (default) or +/-100, by multiplying the result of Difference/Total by a user specified constant. The constant will contain the majority (not all) of the values within +/- the specified value.

* Range = the user specified constant. If Range = 50, the majority of values plotted will be fall within the range +/- 50.

* Therefore, what is plotted is the moving average of Range * Difference / Total.

* When the value = 0, accumulation = distribution over the user specified 50-periods time frame.

* When the value is positive, accumulation > distribution over the user specified 50-periods time frame.

* When the value is negative, distribution > accumulation over the user specified 50-periods time frame.

This plot allows one to see possible accumulation and distribution occurring within a particular stock. The slope of this plot must be considered, and not any single value. The selected constant (“Range” in the example above) does not have an effect on the slope of the plot.

Three values may be plotted at once, for comparison of accumulation or distribution occurring over different time frames. For example, compare Difference / Total calculated over a 50-periods timeframe with 10-periods timeframe, both time frames beginning with the most recent closed period.

In addition to the above, J. Welles Wilder’s Relative Strength Index (RSI) can be plotted over the Difference / Total.

NOTE: this script is not the same as the more commonly used Up/Down Volume Ratio defined as SumUpVol / SumDnVol over a 50-periods time frame, where SumUpVol = the sum of all volume occurring within only those periods where price closed higher than that of the previous period, and SumDnVol = the sum of all volume occurring within only those periods where price closed lower than that of the previous period.

Compare...

Up Down Volume Ratio = SumUpVol / SumDnVol

Up Down Volume Ratio by 3iau = the moving average of Range * (SumUpVol - SumDnVol) / (SumUpVol + SumDnVol)

Release Notes

Added notes in the script for clarity.
Changed defaults and added the ability to change the price used for calculations: close, typical, etc.

Release Notes

Reformatted settings.
Added standard deviation.

Release Notes

Added notes and edited the settings.

Release Notes

Added plots:
1) (UpVolume - DownVolume) / 10^Scale.
2) (UpVolume / DownVolume) * Multiplier.
Added some tooltips.

Release Notes

Changed the chart for perhaps a better example of the plots usefulness in revealing a change in volume from buying to selling despite ongoing increasing price... a potential sign of a coming change in price movement.

Release Notes

Add OBV oscillator to the list of overlay plots.

Release Notes

Added a table for exchange information: % up volume, % down volume, % unchanged volume, TICK, TRIN.

Release Notes

edited tooltips to help clarify settings options
Comments
biokon70
Can I ask what combination you used,like narayana , Lucas etc. with what what setting and any other avarage use?

Personally I'm using Narayan mid with ema . With volume
And I'm curious how you use this all together.
Thanks.
biokon70
@biokon70, and how to use this with Pythagoras moving average, if you want tell us more helpful.
Again thanks mathematician.
insideandup
@biokon70, The Up Down Volume plots a few different ways to look at the volume.

Using a 50 period example, the plot will consider: 1) days closing up and sum their volume, 2) days closing down and the sum of their volume, 3) the sum of all volume over the 50 periods. The plot is a moving average of (UpVolume - DownVolume) / TotalVolume over 50 periods. If the slope of the plot is positive, buying volume is increasing and selling volume is decreasing. If the plot is positive, buying volume is > selling volume. So, I start looking for a span of periods on the chart where the plot slope is positive, but price action is negative... or vice versa. I think of these as a possible sign that price could be changing direction, but there's nothing here to guarantee price will change direction or when it will happen.
i
You can also plot the classic up-down volume ratio = UpVolume / DownVolume over 50 periods. This plot will tell you the same thing described above, but 1 is the defining line. When the plot is above 1, buying volume is > selling volume. These plots can be pretty narrow, so I added a multiplier such that the plot conveys (UpVolume / DownVolume) * Multiplier. I like to use Multiplier = 10, which means 10 is the new defining line. This also expands the plot vertically, making it easier to interpret its slope. The slope is what is most important.

I use this with Pythagorean moving averages, when price gets away from the support/resistance levels for quite a number of periods. I think price will begin returning to the moving averages... so I watch the up-down volume to see whether buying or selling is dominating the total volume.
biokon70
@insideandup, thanks , before I've use Pythagoras moving average with OBV , when price touch/retest moving average and obv( on balance volume) show divergence like( price make lower low and touch moving average and obv not making lower with price) then I've confirm it was might be pullback, enter in trade .

You are still use Twitter! So I'll connect you.

Thanks for giving valuable time, and shared this information.😊
insideandup
@biokon70, @3insideandup at Twitter, but I've not posted much there. Just using Twitter to follow some talented people.
biokon70
@insideandup, I've tried it with Pythagoras moving average, working good,
One request if you can , add OBV with this updown volume, easy to find divergence, I know this indicator also provided divergence, (gap b/w moving average) hard to understand, and I think both divergence different.
biokon70
@biokon70, this indicator hard to understand, for 1st time spend whole day to understand 😅 also my English not good that much , difficult this to understand but I think understand..
Thanks more making this indicator great devloper with great knowledge . And sorry to disturb you haha😅🥺
insideandup
@biokon70, I can work on this when I find some free time. Thank you.
insideandup
@biokon70, OBV oscillator is added. It's available at the bottom of the settings in a dropdown menu. I modified the formula to fit into the range of the other plots.
biokon70
Thanks you so much 😊 always respect for your work.

And I've share chart explain on your Twitter post comments,so please check I'm correct or incorrect, if you have time .
More