OPEN-SOURCE SCRIPT
Cập nhật 52-Week High Diamond

Marks every bar that made a new 52-week high with a small diamond above the wick. The most recent 52-week high is highlighted in full color so it stands out at a glance. All prior highs display at reduced opacity to keep the chart clean without losing the historical context.
Useful for quickly identifying where a stock has been making new highs, how frequently it's been doing so, and how far back the most recent high occurred — all without cluttering your chart.
Settings
Useful for quickly identifying where a stock has been making new highs, how frequently it's been doing so, and how far back the most recent high occurred — all without cluttering your chart.
Settings
- Toggle all historical 52-week high diamonds on/off
- Toggle the most recent 52-week high diamond on/off
- Custom color picker
- Adjustable vertical offset
Phát hành các Ghi chú
Added configurable value label size and color override option. Reduced bubble size. Removed unused background color inputs.Phát hành các Ghi chú
52WH indicator updated — now handles newer stocksQuick fix for anyone who ran into issues with stocks that have been trading for less than a year: the indicator was failing because it couldn't look back 252 bars.
It now detects how many bars are available and falls back to all-time high when the full 52-week window doesn't exist yet. Those bars will show ◆ ATH instead of the standard diamond so you can tell the difference at a glance.
Everything else works the same. Drop it in and let me know if you run into anything.
Phát hành các Ghi chú
Two fixes in this update:Newer stocks (less than 52 weeks of history): instead of failing, the indicator now falls back to all-time high and labels those bars ◆ ATH so you can tell the difference at a glance.
Older stocks (long trading history): fixed a label placement error caused by early bar indices being too far from the current bar. Labels now use timestamps instead of bar indices internally, which resolves it cleanly.
Everything else works the same.
Phát hành các Ghi chú
Bug fix for older charts with tons of history.Phát hành các Ghi chú
Added ability to set a horizontal line at the most recent 52-week high. It's off by default.Phát hành các Ghi chú
Added all-time high detection. When enabled, the diamond marking the all-time high prints in pink instead of the standard green. An optional "ATH" label can also be displayed at that level.New settings under the All-Time High group:
- Highlight All-Time High — enables pink diamond on the single all-time high bar (on by default)
- ATH Diamond Color — customizable, defaults to #e91e63
- Show ATH Label — adds a pink "ATH" badge at the all-time high level (off by default)
Phát hành các Ghi chú
Fixed error showing on charts with less than 52 weeks of data. Phát hành các Ghi chú
Updated to work better on multiple timeframes.Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.