The indicator works well in a trending market but can give false signals when a market is trading in a range.
It uses the ATR ( ) as part of its calculation which takes into account the of the market.
The ATR is adjusted using the multiplier setting which determines how sensitive the indicator is.
At the same time we have another condition of how many candles in the past we want to take in order to get the min and the max values to build the trend.
If you have any questions, let me know in private chat !
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 a publication is governed by House Rules. You can favorite it to use it on a chart.
Discord group: https://discord.gg/hudcJvcCAq
Telegram group: https://t.me/atrader_life