TheRelative Volatility Index (RVI) is a technical indicator designed to measure the direction and magnitude of volatility. Unlike other volatility indicators that focus solely on the level of price fluctuations (such as Bollinger Bands or ATR), the RVI incorporates the trend direction, making it a valuable tool for identifying potential trade opportunities.
Developed in 1993 by Donald Dorsey, the RVI is often used in combination with trend-following indicators to confirm signals. It resembles the Relative Strength Index (RSI) but instead of measuring price momentum, it focuses onvolatility direction.
The RVI is calculated based on the standard deviation of price changes, smoothed over a predefined period. Here’s the step-by-step process:
Standard Deviation Calculation:
Directional Volatility Components:
Smoothing the RVI:
The formula for the RVI is:
Values range from 0 to 100, where higher values indicate stronger upward volatility, and lower values signal downward volatility.
The RVI can be customized using several key parameters:
The RVI is commonly used to confirm trend strength and identify potential reversals:
Trend Confirmation:
Overbought/Oversold Signals:
Divergences:
RVI + Moving Average:
RVI + Bollinger Bands:
Breakout Confirmation:
The RVI can be programmed inProRealTime’s ProBuilder language, ensuring flexibility in customization. The implementation follows these key steps:
The ProBuilder code follows these principles and allows easy parameter adjustments.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | //------------------------------------------------------// //PRC_RVI relative volatility Index //version = 0 //06.02.2025 //Iván González @ www.prorealcode.com //Sharing ProRealTime knowledge //------------------------------------------------------// // Inputs //------------------------------------------------------// stdevLength=10 stdevType=1//boolean variable 1 means Population smoothLength=14 obLevel=80 mdLevel=50 osLevel=20 highlightBreakouts=1//boolean variable maTypeInput=0 maLengthInput=14 useBB=1 bbMultInput=2 src=close //------------------------------------------------------// // Standard deviation calculation //------------------------------------------------------// //Type=1 Population else Sample ifstdevType=1then selectedStdev=STD[stdevLength](src) else dev=src-average[stdevLength](src) variance=summation[stdevLength](pow(dev,2))/(stdevLength-1) selectedStdev=sqrt(variance) endif //------------------------------------------------------// // RVI original version (1993) //------------------------------------------------------// up=(src>=src[1])*selectedStdev down=(src<src[1])*selectedStdev upsum=average[smoothLength,1](up) downsum=average[smoothLength,1](down) rvi=100*upsum/(upsum+downsum) //------------------------------------------------------// // Moving average //------------------------------------------------------// maRVI=average[maLengthInput,maTypeInput](rvi) ifuseBBthen bbUpperband=maRVI+std[maLengthInput](rvi)*bbMultInput bbLowerband=maRVI-std[maLengthInput](rvi)*bbMultInput endif //------------------------------------------------------// // Plot //------------------------------------------------------// //---Rvi color ifrvi>oblevelthen r=14 g=187 b=35 elsifrvi<oslevelthen r=255 g=0 b=0 else r=244 g=183 b=125 endif //---HighlightBreakouts ifrvi>oblevelandhighlightBreakoutsthen rob=0 gob=255 alphaob=40 else alphaob=0 endif ifrvi<oslevelandhighlightBreakoutsthen ros=255 gos=0 alphaos=40 else alphaos=0 endif colorbetween(100,oblevel,rob,gob,0,alphaob) colorbetween(0,oslevel,ros,gos,0,alphaos) //------------------------------------------------------// returnrvias"RVI"coloured(r,g,b)style(line,2),maRVIas"MA RVI"coloured("blue"),oblevelas"Overbought Level"coloured("black")style(dottedline),oslevelas"Oversold Level"coloured("black")style(dottedline),mdLevelas"MidLevel"coloured("black")style(dottedline),bbUpperbandas"BBUp"coloured("blue")style(dottedline),bbLowerbandas"BBDn"coloured("blue")style(dottedline) |
TheRelative Volatility Index (RVI) is a powerful tool that provides insight into thedirection of volatility, helping traders confirm trends and identify reversals. While it should not be used in isolation, combining it withmoving averages, Bollinger Bands, or other momentum indicators can enhance its effectiveness.
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 :Find other exclusive trading pro-tools on
PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials