OPEN-SOURCE SCRIPT
N-Touch Trendline Breakout

I've created an indicator that identifies support and resistance levels based on pivots and tracks how many times price interacts with them before breaking out.
Here is how it works:
1. Pivot Identification: It looks for pivot highs (resistance) and pivot lows (support) to establish levels.
2. Touch Tracking: When the price comes within the Touch Tolerance % of an active level (but doesn't break and close past it), it registers a "touch" and displays the count as tiny text on the chart.
3. Breakout Detection: If the price breaks through the level (closing above resistance or below support), it checks the touch count. If the required number of touches (default is 3) has been met or exceeded, it triggers a "BO" (Breakout) label with an arrow.
You can customize the following settings in the indicator inputs:
1. Pivot Length: Adjusts how many bars are used to define a pivot. A higher value will find more significant long-term levels.
2. Required Touches: The minimum number of interactions required before a breakout signal is valid.
3. Touch Tolerance %: Defines how close the price must get to the level to be considered a touch.
-Initial Touches: The two pivot points used to create the trendline automatically count as the first 2 touches.
-Future Touches: As the trendline extends into the future, any time the price comes within the Touch Tolerance % of the line without breaking it, a new touch is registered and displayed as a small number on the chart.
-Breakout Detection: If the price breaks through the extended trendline (closing above resistance or below support), the script checks the touch count. If it meets or exceeds your Required Touches setting (default is 3, which means the 2 pivots + 1 additional touch), it signals a breakout.
Clean Touch Numbers: The number 3 (and any subsequent numbers) will only print once per actual swing touch, keeping your chart nice and clean.
Here is how it works:
1. Pivot Identification: It looks for pivot highs (resistance) and pivot lows (support) to establish levels.
2. Touch Tracking: When the price comes within the Touch Tolerance % of an active level (but doesn't break and close past it), it registers a "touch" and displays the count as tiny text on the chart.
3. Breakout Detection: If the price breaks through the level (closing above resistance or below support), it checks the touch count. If the required number of touches (default is 3) has been met or exceeded, it triggers a "BO" (Breakout) label with an arrow.
You can customize the following settings in the indicator inputs:
1. Pivot Length: Adjusts how many bars are used to define a pivot. A higher value will find more significant long-term levels.
2. Required Touches: The minimum number of interactions required before a breakout signal is valid.
3. Touch Tolerance %: Defines how close the price must get to the level to be considered a touch.
-Initial Touches: The two pivot points used to create the trendline automatically count as the first 2 touches.
-Future Touches: As the trendline extends into the future, any time the price comes within the Touch Tolerance % of the line without breaking it, a new touch is registered and displayed as a small number on the chart.
-Breakout Detection: If the price breaks through the extended trendline (closing above resistance or below support), the script checks the touch count. If it meets or exceeds your Required Touches setting (default is 3, which means the 2 pivots + 1 additional touch), it signals a breakout.
Clean Touch Numbers: The number 3 (and any subsequent numbers) will only print once per actual swing touch, keeping your chart nice and clean.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。