OPEN-SOURCE SCRIPT
Swing High/Low Lines

This indicator automatically detects swing highs and swing lows on the chart and draws horizontal lines from those points with the following behavior:
Detects Swings: Uses ta.pivothigh() and ta.pivotlow() to find significant turning points based on a configurable number of bars to the left and right.
Draws Horizontal Lines: When a swing high or low is confirmed, it draws a horizontal line starting from the actual swing bar and extending to the right.
Extends Until Hit: The line continues extending to the right as long as price has not revisited that level.
Ends When Price Hits It: As soon as price touches or breaks the level again (using wick or close — your choice), the extending line is deleted and replaced with a fixed horizontal line segment that ends exactly at the bar where price first revisited it.
Visual Differentiation: Active (unbroken) lines are solid and bright. Broken lines turn dashed and faded so you can easily see which levels have already been tested.
Optional Markers: You can toggle on/off triangle markers and labels at the swing points.
In Simple Terms:
This script finds important highs and lows, draws lines from them that keep going right until price comes back and touches them, at which point the line stops extending and becomes a fixed historical level.
Detects Swings: Uses ta.pivothigh() and ta.pivotlow() to find significant turning points based on a configurable number of bars to the left and right.
Draws Horizontal Lines: When a swing high or low is confirmed, it draws a horizontal line starting from the actual swing bar and extending to the right.
Extends Until Hit: The line continues extending to the right as long as price has not revisited that level.
Ends When Price Hits It: As soon as price touches or breaks the level again (using wick or close — your choice), the extending line is deleted and replaced with a fixed horizontal line segment that ends exactly at the bar where price first revisited it.
Visual Differentiation: Active (unbroken) lines are solid and bright. Broken lines turn dashed and faded so you can easily see which levels have already been tested.
Optional Markers: You can toggle on/off triangle markers and labels at the swing points.
In Simple Terms:
This script finds important highs and lows, draws lines from them that keep going right until price comes back and touches them, at which point the line stops extending and becomes a fixed historical level.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının mimarı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının mimarı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.