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.
Script protegido
Esse script é publicada como código fechado. No entanto, você pode usar ele livremente e sem nenhuma limitação – saiba mais aqui.
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.
Script protegido
Esse script é publicada como código fechado. No entanto, você pode usar ele livremente e sem nenhuma limitação – saiba mais aqui.
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.