The RVI is a modified form of the relative strength index (RSI). The original RSI calculation separates one-day net changes into positive closes and negative closes, then smoothes the data and normalizes the ratio on a scale of zero to 100 as the basis for the formula. The RVI uses the same basic formula but substitutes the 10-day standard deviation of the closing prices for either the up close or the down close. The goal is to create an indicator that measures the general direction of volatility. The volatility is being measured by the 10-days standard deviation of the closing prices.
You can change long to short in the Input Settings WARNING: - For purpose educate only - This script to change bars colors.