OPEN-SOURCE SCRIPT

Auto Trendlines with Break Alerts

1 935
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.

免责声明

这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。