Code Library / Indicators
Volume Bars
Relative volume colored bars.
Language: Pine Script · Category: Indicators · Tags: volume, bars, Pine Script
Source code
//@version=5
indicator("Volume Bars")
avg = ta.sma(volume,20)
rel = volume/avg
c = rel>2?color.red:rel>1?color.green:color.gray
plot(volume,"Vol",c,style=plot.style_columns)How to use this snippet
This is a building block, not a finished trading system. Paste it into your own Pine Script project, compile it, and test it on a demo account with your broker's real spreads before relying on it. You can convert it to MQL4 or MQL5 with the Pine Script converter.