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.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.