OPEN-SOURCE SCRIPT

Relative Strength Volatility Variable Bands [DW]

Updated
This is an experimental adaptive trend following study inspired by Giorgos Siligardos's Reverse Engineering RSI and Tushar S. Chande's Variable Moving Average.

In this study, reverse engineered RSI levels are calculated and used to generate a volatility index for VMA calculation.

First, price levels are calculated for when RSI will equal 70 and 30. The difference between the levels is taken and normalized to create the volatility index.

Next, an initial VMA is calculated using the created volatility index. The moving average is an exponential calculation that adjusts the sampling length as volatility changes.

Then, upper and lower VMAs are calculated by taking a VMA of prices above and below the initial VMA. The midline is produced by taking the median of the upper and lower VMAs.

Lastly, the band levels are calculated by multiplying the distance from the midline to the upper and lower VMAs by 1, 2, 3, 4, and 5.

Bar colors are included. They're based on the midline trend and price action relative to the upper and lower VMAs.
Release Notes
Updates:

-> Migrated to v4.
-> Stability Fix: Added correction for NaN values to stabilize initial states.
-> Reorganized script structure
-> Updated style theme.
adaptivebandsexperimentalMoving AveragesTrend AnalysistrendfollowingvmaVolatility
DonovanWall
Wizard
For my full list of premium tools, check the blog:
wallanalytics.com/

Reach out on Telegram:
t.me/DonovanWall

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Disclaimer