PROTECTED SOURCE SCRIPT
ATH Line with Date (Editable)

Overview:
This indicator draws a continuous horizontal line at the instrument’s All-Time High (ATH) and annotates it with a label that shows the date the ATH was set in dd-mmm-yyyy format. The label is fully configurable (text prefix, side, position, colors, vertical offset), and you can optionally append the ATH price formatted as $ 1.234,56. Built for Pine Script™ v6 and works on any symbol or timeframe.
How it works
• Maintains a running maximum of high.
• Detects the bar where the current ATH occurred and extracts its date.
• Renders a horizontal line extended both sides at the ATH level.
• Places an optional label on the last bar or on the ATH bar.
• Triggers an optional alert when a new ATH is printed.
Inputs
• Line color / width / style – customize the ATH line appearance.
• Show label – toggle label on/off.
• Label text (prefix) – default ATH ►.
• Label text color / background – visual customization for the tag.
• Label side – left or right-anchored label.
• X location – Last bar or ATH bar.
• Label vertical offset (%) – moves the label above/below the line.
• Show price – appends the ATH price in the format $ 1.234,56
Notes & behavior:
• Repainting: The ATH level is stable until a higher high appears. When a new ATH is set, the line and date update accordingly—this is expected behavior.
• The ATH is computed from the chart’s current timeframe/history. If the symbol has limited history on your chart, the ATH reflects only the available data.
• No external libraries; no user data is collected.
Alerts:
• Includes New ATH alert condition. Fire it to be notified when price sets a new all-time high.
Tips:
• Use Last bar placement to keep the label visible at the right edge while scrolling.
• If the label overlaps candles or drawings, add a small positive vertical offset.
Version:
• Pine Script™ v6. Indicator only; no trading signals or orders.
Disclaimer:
For educational purposes only. This script does not constitute financial advice or a recommendation to buy or sell any security. Always do your own research and manage risk appropriately.
This indicator draws a continuous horizontal line at the instrument’s All-Time High (ATH) and annotates it with a label that shows the date the ATH was set in dd-mmm-yyyy format. The label is fully configurable (text prefix, side, position, colors, vertical offset), and you can optionally append the ATH price formatted as $ 1.234,56. Built for Pine Script™ v6 and works on any symbol or timeframe.
How it works
• Maintains a running maximum of high.
• Detects the bar where the current ATH occurred and extracts its date.
• Renders a horizontal line extended both sides at the ATH level.
• Places an optional label on the last bar or on the ATH bar.
• Triggers an optional alert when a new ATH is printed.
Inputs
• Line color / width / style – customize the ATH line appearance.
• Show label – toggle label on/off.
• Label text (prefix) – default ATH ►.
• Label text color / background – visual customization for the tag.
• Label side – left or right-anchored label.
• X location – Last bar or ATH bar.
• Label vertical offset (%) – moves the label above/below the line.
• Show price – appends the ATH price in the format $ 1.234,56
Notes & behavior:
• Repainting: The ATH level is stable until a higher high appears. When a new ATH is set, the line and date update accordingly—this is expected behavior.
• The ATH is computed from the chart’s current timeframe/history. If the symbol has limited history on your chart, the ATH reflects only the available data.
• No external libraries; no user data is collected.
Alerts:
• Includes New ATH alert condition. Fire it to be notified when price sets a new all-time high.
Tips:
• Use Last bar placement to keep the label visible at the right edge while scrolling.
• If the label overlaps candles or drawings, add a small positive vertical offset.
Version:
• Pine Script™ v6. Indicator only; no trading signals or orders.
Disclaimer:
For educational purposes only. This script does not constitute financial advice or a recommendation to buy or sell any security. Always do your own research and manage risk appropriately.
보호된 스크립트입니다
이 스크립트는 비공개 소스로 게시됩니다. 하지만 제한 없이 자유롭게 사용할 수 있습니다 — 여기에서 자세히 알아보기.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.
보호된 스크립트입니다
이 스크립트는 비공개 소스로 게시됩니다. 하지만 제한 없이 자유롭게 사용할 수 있습니다 — 여기에서 자세히 알아보기.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.