RVI – Relative Volatility Index
I have programmed one of the scarce indicators still missing in this wonderful workstation.
RVI is a basic tool to trade on volatility, a very profitable strategy over recent years.
REM RVI (Relative Volatility Index) is in fact a RSI
REM calculated on the standard deviation over the closing prices of 10 days
REM instead of being calculated over daily variations
REM RTLudo's "BuilderRSI" inspired me this code:
upward = (CLOSE > CLOSE[1]) * STD[10]
downward = (CLOSE < CLOSE[1]) * STD[10]
REM Calculating the average profits of upward days
REM and the average losses on downward days
upwardMA = wilderAverage[p](upward)
downwardMA = wilderAverage[p](downward)
REM RS is deducted
RV = upwardMA / downwardMA
REM And finally, the RSI
myRVI = 100 - 100 / (1 + RV)
RETURN myRVI AS"Relative Volatility Index"