OPEN-SOURCE SCRIPT
Auto Trendlines with Break Alerts

Identify the two most recent significant swing highs and swing lows based on a customizable pivot length.
Draw trendlines extending from these points.
Provide an optional visual signal (a small diamond on the chart) and a alertcondition for sound/push notifications when a trendline is broken.
Configure: Once the indicator is on your chart, you can click on the gear icon (⚙️) next to its name to adjust the settings. You will see a checkbox to enable/disable alerts and a slider to change the pivot length.
Configuring Alerts in TradingView
The alertcondition lines in the code allow you to set up official TradingView alerts for sound and push notifications.
Create an Alert: Click the clock icon (⏰) on the right-side toolbar of your TradingView chart.
Set the Condition: In the "Condition" field, select the name of the indicator: "Auto Trendlines with Break Alerts".
Choose the Alert Type: A second dropdown will appear. Select either "High Trendline Broken" or "Low Trendline Broken" to specify which break you want to be alerted for.
Select Notification Options: In the "Notifications" section, you can check the boxes for "Play sound," "Send email," "Send push notification," etc.
Create the Alert: Click "Create" to save your alert.
Draw trendlines extending from these points.
Provide an optional visual signal (a small diamond on the chart) and a alertcondition for sound/push notifications when a trendline is broken.
Configure: Once the indicator is on your chart, you can click on the gear icon (⚙️) next to its name to adjust the settings. You will see a checkbox to enable/disable alerts and a slider to change the pivot length.
Configuring Alerts in TradingView
The alertcondition lines in the code allow you to set up official TradingView alerts for sound and push notifications.
Create an Alert: Click the clock icon (⏰) on the right-side toolbar of your TradingView chart.
Set the Condition: In the "Condition" field, select the name of the indicator: "Auto Trendlines with Break Alerts".
Choose the Alert Type: A second dropdown will appear. Select either "High Trendline Broken" or "Low Trendline Broken" to specify which break you want to be alerted for.
Select Notification Options: In the "Notifications" section, you can check the boxes for "Play sound," "Send email," "Send push notification," etc.
Create the Alert: Click "Create" to save your alert.
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。