OPEN-SOURCE SCRIPT
Auto Trend Lines

Auto Trend Lines automatically draws ascending and descending trend lines using confirmed swing lows and highs.
The indicator evaluates the number of touches, checks for historical price violations, and selects suitable candidates. Ascending lines connect higher lows, while descending lines connect lower highs. Broken and outdated lines are removed.
Available settings include:
- Swing detection period.
- Price source: High/Low or Close.
- Lookback length and permitted price deviation from a line.
- Minimum number of touches.
- Maximum number of lines in each direction.
- Optional display of weak trend lines.
- Line color, width, style, and extension to the right.
Swing points are confirmed with a delay determined by the Pivot Period setting. A line may start at an earlier candle, but it only appears after the required points have been confirmed. The set of displayed lines may change as new data becomes available.
This indicator is designed for visual analysis of price structure. It does not generate trading signals or guarantee that price will react to the plotted levels.
An independent implementation of automatic trend line detection.
The indicator evaluates the number of touches, checks for historical price violations, and selects suitable candidates. Ascending lines connect higher lows, while descending lines connect lower highs. Broken and outdated lines are removed.
Available settings include:
- Swing detection period.
- Price source: High/Low or Close.
- Lookback length and permitted price deviation from a line.
- Minimum number of touches.
- Maximum number of lines in each direction.
- Optional display of weak trend lines.
- Line color, width, style, and extension to the right.
Swing points are confirmed with a delay determined by the Pivot Period setting. A line may start at an earlier candle, but it only appears after the required points have been confirmed. The set of displayed lines may change as new data becomes available.
This indicator is designed for visual analysis of price structure. It does not generate trading signals or guarantee that price will react to the plotted levels.
An independent implementation of automatic trend line detection.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.