OPEN-SOURCE SCRIPT
Recent Swing High/Low Lines With Stats Table

Swing-Based Volatility
This indicator measures volatility using the distance between recent swing highs and swing lows rather than fixed averages like ATR. Each swing captures a meaningful shift in market control, making this a structure-aware view of volatility.
The tool calculates and plots the average swing range over time, highlighting when the market is expanding (wide swings, high volatility) or contracting (tight swings, low volatility). These phases can help traders identify breakout potential, adjust stop-loss or profit targets, and align position sizing with current market conditions.
This indicator measures volatility using the distance between recent swing highs and swing lows rather than fixed averages like ATR. Each swing captures a meaningful shift in market control, making this a structure-aware view of volatility.
The tool calculates and plots the average swing range over time, highlighting when the market is expanding (wide swings, high volatility) or contracting (tight swings, low volatility). These phases can help traders identify breakout potential, adjust stop-loss or profit targets, and align position sizing with current market conditions.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.