The various modes shown on the chart above or explained below. Also, read on for a little trick using the new Pine feature that you can use in your script.
How to read the PVR?
The most desirable market condition occurs when both price and are moving up, that phenomenon is assigned a PVR of 1.
The next most desirable condition, when prices are still moving up but is diminishing, is given a PVR of 2. Although still technically healthy, this relationship between price and issues a warning that market momentum is weakening.
The worst-case scenario, seen when selling pressure is greatest with prices dropping and
increasing, is given PVR's weakest designation, 4.
Finally, even though prices are still moving down, begins to diminish as selling pressure abates. This price/volume relationship is assigned a PVR of 3, often alerting us to a potential buying opportunity ahead.
What do the modes mean?
1) Histogram Mode: This plots PVR along with helpful ranges. Be careful when PVR is trending at turn-around points.
2) MA Crossover Mode: This plots a slow/fast MA of PVR . Default is 5/10 . Buy is signalled when slow MA falls below fast MA. Sell is signalled when slow MA crosses up fast MA. There is a warning line at 2.5 that can be used for more confirmation.
3) Double Smoothed Crossover Mode: Same as MA crossover, but PVR is smoothed more. Warning line (2.5 level) is very useful in this mode. Use slow MA as the signal and fast MA of PVR for tracking the market.
This won't work for Forex and other instruments for which TradingView doesn't expose . Thanks to the new Text rendering feature of PlotShape(), I can actually let users know of that :) Good use-case, eh? I will post a sample chart below in the comments.
Feel free to use any part of this code in your indicators.
Stocks & V. 12:6 (235-239): Price-Volume Rank by Anthony J. Macek
Complete list of my indicators:
// // @author LazyBear // List of all my indicators: // https://docs.google.com/document/d/15AGCufJZ8CIUvwFJ9W-IKns88gkWOKBCvByMEvm5MLo/edit?usp=sharing // study("Price Volume Rank [LazyBear]", shorttitle="PVR_LB", overlay=false) showMA=input(true, title="Show MA Crossovers") ma1=input(5, title="Fast MA Length", defval=5),ma2=input(10, title="Slow MA Length", defval=10) dblSmoothing=input(false, title="Double Smoothing") pvr=iff(close>close and volume>volume,1, iff(close>close and volume<=volume,2, iff(close<=close and volume<=volume,3,4))) ux=pvr>3.0?pvr:na,lx=pvr<2.0?pvr:na u=plot(showMA?na:na(volume)?na:2.0, color=green, title="BullLine") l=plot(showMA?na:na(volume)?na:3.0, color=red, title="BearLine") fill(u,l,gray) mal=plot(showMA?na(volume)?na:2.5:na, color=gray, title="MACutoff") plot(showMA?na:na(volume)?na:pvr, style=histogram, histbase=2, color=pvr>3.0?red:pvr<2.0?green:gray, linewidth=2,transp=40, title="PVR") plot(showMA?na:na(volume)?na:pvr, style=circles, color=pvr>=3.0?red:pvr<=2.0?green:gray, linewidth=4, title="PVR Points") sma1=not showMA?na:dblSmoothing?sma(sma(pvr,ma1),ma1):sma(pvr,ma1), sma2=not showMA?na:dblSmoothing?sma(sma(pvr,ma2),ma2):sma(pvr,ma2) plot(showMA?na(volume)?na:sma1:na, style=linebr, color=red, linewidth=2, title="Fast MA") plot(showMA?na(volume)?na:sma2:na, style=linebr, color=green, linewidth=1, title="Slow MA") x=na(volume)?(nz(x)+0.4)%4.0:na plotshape(na(volume)?x:na, style=shape.circle, color=red, text="No volume", location=location.absolute, title="ErrorText")