This “Volume-by-Price” indicator shows the amount of volume for a particular price range selected with the “lookback” setting, which is based on closing prices. The bars are horizontal and shown on the left side of the chart to correspond with these price ranges. The bars are separated into 2 colors to clearly identify the bull and bear Volumes in each price range. By combining volume and closing prices, this indicator can be used to identify high-volume price ranges to mark support or resistance.
The code shows 12 Volume-by-Price bars by default, but users can increase or decrease this number to suit their preferences with the “NbrBars” setting. Be aware that due to some ProBuilder limitations, this setting, as well as the lookback one, cannot be extended very much.
For a better visualization of which side has higher volumes on each price range, I added a small square of the corresponding color.
The ScaleFactor setting is used to adapt the length of the bars, depending of your choice to have small or big bars plotted over the price chart.
//PRC_Bull&Bear Volume on Price | indicator
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
// --- settings
ScaleFactor = 5
// --- end of settings
div = (hh-ll)/NbrBars
startbar = barindex[lookback]
while i<NbrBars do
for j = 1 to lookback do
if close[j]>=lrange and close[j]<=hrange then
if close[j]>open[j] then
bullbar = round((volbull*lookback)/volsum)*scalefactor
bearbar = round((volbear*lookback)/volsum)*scalefactor
if bullbar>bearbar then
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.ProRealTime ITF files and other attachments :