TradingView
kakugiki
Mar 26, 2021 10:49 PM

Volume Pressure 

Ether / United States DollarCoinbase

Description

This script modified from @the_akechi's VolumePressure

The sum of buying and selling volume is NOT always equal to the total volume using the original script because the 2 columns are overlaid, not stacked

Release Notes

add buying/selling ratio

Release Notes

Based on @SpinTrades' feedback, added a scale accordingly to a Stack Overflow answer to fit the Candlestick Charts.

Release Notes

1) Add moving average of buying/selling volume. You'll need to go to the setting to enable it. You have an option to show both, or MA, or default volume only.
a) I wonder if there is any useful insight by showing the VMA, crossover, or something. Please share your thoughts.
2) Make the vol limit optional as its sole purpose is to scale the histogram to fit the main chart. This displays better the volume pressure on a separate pane.
3) Side note: if you want to display the volume pressure together with the candlesticks, you'll need to enable the scale from the settings. To put the indicator to the bottom, the best way I can think of is to set the chart's bottom margin to 0.

Release Notes

adjusted some default settings to look more like the build-in volume indicator, e.g., to fit the candlestick pane with any timeframes.
Comments
SpinTrades
Thanks so much for incorporating the feedback!
SpinTrades
@kakugiki The only thing I still notice is that it hovers above where the default volume is flush with the bottom of the pane.
kakugiki
@SpinTrades, thank you very much for your support. I'll see if there is anything that I can do when I get a chance. :)
kakugiki
@SpinTrades, it looks like there is no way to put the volume right at the bottom programmatically. One workaround is to set the Bottom Margin to 0 through the Chart settings > Appearance.
SpinTrades
@kakugiki, Thanks for the update! I have started to do this. I am hoping @TradingView can provide more tools to scale volume better, this works well on many timeframes but once you move to one week or greater the volume of the bars scale too far.
kakugiki
@SpinTrades, if you adjust the lookback length from the setting, it should work for a week or greater.
alterennui
@SpinTrades, I know how to fix the hover:

Right-click Volume Pressure - pin to scale - select pin to right scale (chart will become wonky)
Double-click right scale (price will squish, ignore) - click and hold mouse pointer over right scale and slide up or down to align bottom of Volume Pressure until it's flush with bottom of pane
Right-click Volume Pressure - pin to scale - select No scale (fullscreen)

Save chart

Should be good to go!

PS you'll have to mess around with % of vertical space used and Length in Volume Pressure settings so volume doesn't fill screen in longer periods. I make it much more transparent to deal with volume overlapping candles
alterennui
Nevermind. My post was way off. @SpinTrades is right that the best thing you can do "...is to set the Bottom Margin to 0 through the Chart settings > Appearance."
microembeddedtech
Is it possible to show the buy and sell volume based on percentage
Jb_2
Looks great! I played around with the code to color the bars when the MA of buying volume is greater than MA of selling volume and volume is greater than MA. But I could only get it for one type of MA. Here's the code I came up with. Let me know what you think!

s1=sma(buyingVolume, len)
s2=sma(sellingVolume, len)
s3=sma(volume, len)
mabuysell=s1>s2 and volume>s3?color.green:s1<s2 and volume>s3?color.red:na
barcolor(mabuysell)
More