This tool is the swing high swing low indicator. A swing high/low is a technical pattern that describes a local peak or trough on a chart. By connecting these peaks and troughs, we can determine the general direction the asset is trading. This indicator can be used on all time frames and in any market.
To use it, declare how many candles are needed to determine a swing level. By default, the indicator is set to two candles. This means that a candle must have two candles to the right AND left (totaling 5 consecutive candles) to be considered a swing level. If the middle candle has the highest high of the 5 consecutive candles, it will be classified as a Swing High. If the middle candle has the lowest low, it will be a Swing Low. Otherwise, it will be ignored.
Once a swing number is declared, the indicator will look for a starting swing high and swing low. The asset will trade inside the range established by the swing high/low lines. When the lines are parallel, it is considered a form of consolidation. You will likely see a lot of whipsaw action or chart patterns like bullflags or head-shoulders. Wait patiently for a break of this consolidation. The indicator will identify the new swing levels when the asset breaks out of this range.
Depending on the direction of the break, it will turn green for an uptrend or red for a downtrend. You should look to take long positions when the lines are green and short when the lines are red. You can use old swing levels as support or resistance in the future. The longer the line, the greater the likelihood that it will be support or resistance. This can help you identify potential entries.
The goal of this script is to make it easier to determine trends. Sometimes, we take the wrong trade because we don't understand which way the market is trending and what levels are important. This indicator is meant to take the guesswork out and make the trade easy and emotionless. This indicator works well on its own, but I suggest pairing it with another to add an extra confirmation before taking a trade. Happy Trading!
**Please note: Assets that have traded parabolically (steep inclines or declines) will have wide ranges that may not be broken. (see GME 2021)**