OPEN-SOURCE SCRIPT
Updated Swing Points

An indicator that identifies Swing Points (highs and lows) and then determines highs and lows of those swings. Works on all timeframes.
This is not my invention. It is a generic concept that I picked up from the trading world.
First level swings are termed as Short term Highs and Short term Lows (STH and STL)
The second level swings are termed as Long term Highs and Long term Lows (ITH and ITL)
An STH is formed when the 2nd high is higher than the highs on either side.
An ITH is formed when the 2nd STH is higher than the STH on either side.
Likewise logic for lows.
An example, A bullish trend can be expected if an ITH level is taken out after a ITL is formed after the ITH.
Inside bars: Inside bars are ignored. They can be marked, turned off by default.
Also, a "X" is placed over a swing point if two consecutive swings form simultaneously. This is turned off by default.
This is not my invention. It is a generic concept that I picked up from the trading world.
First level swings are termed as Short term Highs and Short term Lows (STH and STL)
The second level swings are termed as Long term Highs and Long term Lows (ITH and ITL)
An STH is formed when the 2nd high is higher than the highs on either side.
An ITH is formed when the 2nd STH is higher than the STH on either side.
Likewise logic for lows.
An example, A bullish trend can be expected if an ITH level is taken out after a ITL is formed after the ITH.
Inside bars: Inside bars are ignored. They can be marked, turned off by default.
Also, a "X" is placed over a swing point if two consecutive swings form simultaneously. This is turned off by default.
Release Notes
- Fixed bug that missed marking a STH or STL right after an opposite one was discovered
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.