OPEN-SOURCE SCRIPT
업데이트됨 52 Week High/Low (Current & Offset)

Title:
52 Week High/Low (Current & Offset)
Visibility: Open (recommended) or Protected
Category: Overlay / indicator
Companion script: 52 Week High/Low Offset Screener
----- Description (paste below; English first) -----
[A German description follows the English text.]
█ OVERVIEW
This indicator plots two 52-week ranges at once:
• Current 52-week high/low, including today’s price, as two horizontal lines.
• Historical 52-week high/low, lagged by a user-defined number of weeks, as a full history.
The current range always moves with price. After a sharp rally or sell-off that can make the live 52-week band less useful for context (for example dollar-cost averaging). The offset range shows where the 52-week high and low stood N weeks ago, before the latest move fully rewrote those extremes.
A distance label shows how far the close is from the nearer offset level, in percent of the current price. Positive = price is above that level, negative = below.
This is a positioning tool, not a buy or sell signal.
█ HOW IT WORKS
Current 52-week high/low
Calculated on the weekly timeframe over 52 weeks and combined with the developing week’s high/low on the chart timeframe, so today’s price is included.
Historical 52-week high/low (offset)
The same 52-week calculation, shifted by N weekly bars (default: 52). The offset is applied on the weekly timeframe, not in chart bars, so “52 weeks” remains 52 weeks on a daily chart.
Distance %
(close − offset level) / close × 100
The label is attached to whichever offset level is closer in price:
• Orange = nearer the offset high
• Teal = nearer the offset low
If the current 52-week high and the offset high print as the same price, they are merged into one label: “52W High = Offset”. The same logic applies independently to the low.
█ HOW TO USE
1. Add the script to a chart (daily is a typical timeframe).
2. Set Historical offset (weeks). Default is 52 (about one year); 13 ≈ one quarter, 4 ≈ one month.
3. Read price against the white historical path, not only against the green/red current lines.
4. Use the distance label and the table (Current vs −Nw) for a quick readout.
Reading for DCA-style context (not advice):
• Near the offset low, slightly negative or slightly positive → closer to the older low.
• Near the offset high, small negative → still below the older high, relatively expensive vs that band.
• Near the offset high, positive → price has left the older high.
█ SETTINGS
52-week setup
• Basis for 52-week values: Highs/Lows (default) or Close
• Historical offset (weeks)
Current 52W High/Low
• Horizontal lines, colors, width, style (solid / dashed / dotted), price labels
Historical 52W High/Low (Offset)
• History on/off, colors, fill, fill color
• In the Style tab, historical lines default to dashed and can be switched to solid or dotted
Info panel
• Table on/off, position, distance label
█ NOTES AND LIMITS
• 52 weeks means 52 weekly bars, not exactly 365 calendar days.
• The current 52-week high/low updates with the developing week.
• The offset uses closed weekly values (no lookahead inside the forming week).
• Companion screener: “52 Week High/Low Offset Screener” (add to Favorites, then Products → Screeners → Pine).
This script does not generate trading signals and is not investment advice.
--------------------------------------------------------------------------------
DEUTSCH
█ ÜBERBLICK
Der Indikator zeigt zwei 52-Wochen-Spannen gleichzeitig:
• Das aktuelle 52-Wochen-Hoch/-Tief inklusive heutigem Kurs, als zwei horizontale Linien.
• Das historische 52-Wochen-Hoch/-Tief, um eine wählbare Anzahl Wochen versetzt, als vollständigen Verlauf.
Die aktuelle Range wandert immer mit dem Kurs. Nach einer starken Rally oder einem Ausverkauf ist das live 52-Wochen-Band für den Kontext oft weniger nützlich (zum Beispiel beim Averagen / DCA). Die Offset-Range zeigt, wo Hoch und Tief vor N Wochen standen, bevor die jüngste Bewegung diese Extreme überschrieben hat.
Das Abstands-Label zeigt, wie weit der Schlusskurs vom näheren Offset-Niveau entfernt ist (in % vom aktuellen Kurs). Positiv = Kurs liegt darüber, negativ = darunter.
Das ist eine Lagehilfe, kein Kauf- oder Verkaufssignal.
█ BERECHNUNG
Aktuelles 52-Wochen-Hoch/-Tief
Berechnung auf dem Wochen-Timeframe über 52 Wochen, kombiniert mit dem laufenden Wochenhoch/-tief auf dem Chart-Timeframe, damit der heutige Kurs einbezogen wird.
Historisches 52-Wochen-Hoch/-Tief (Offset)
Dieselbe 52-Wochen-Berechnung, um N Wochenkerzen verschoben (Standard: 52). Der Versatz greift auf dem Wochen-Chart, nicht in Chart-Balken. „52 Wochen“ bleiben also auch auf dem Tageschart 52 Wochen.
Abstand %
(Schlusskurs − Offset-Niveau) / Schlusskurs × 100
Das Label hängt an dem Offset-Niveau, das preislich näher liegt:
• Orange = näher am Offset-Hoch
• Türkis = näher am Offset-Tief
Sind aktuelles 52W-Hoch und Offset-Hoch als derselbe Preis dargestellt, werden sie in einem Label zusammengefasst: „52W High = Offset“. Dieselbe Logik gilt unabhängig fürs Tief.
█ NUTZUNG
1. Skript auf einen Chart legen (Tageschart ist ein üblicher Timeframe).
2. Historical offset (weeks) einstellen. Standard ist 52 (ca. ein Jahr); 13 ≈ ein Quartal, 4 ≈ ein Monat.
3. Den Kurs gegen den weißen historischen Verlauf lesen, nicht nur gegen die grünen/roten aktuellen Linien.
4. Abstands-Label und Tabelle (Current vs. −Nw) für die schnelle Ablesung nutzen.
Lesart für DCA-Kontext (keine Empfehlung):
• Nah am Offset-Tief, leicht negativ oder leicht positiv → näher am älteren Tief.
• Nah am Offset-Hoch, leicht negativ → noch unter dem älteren Hoch, relativ teuer zu diesem Band.
• Nah am Offset-Hoch, positiv → der Kurs hat das ältere Hoch verlassen.
█ EINSTELLUNGEN
52-week setup
• Basis for 52-week values: Highs/Lows (Standard) oder Close
• Historical offset (weeks)
Current 52W High/Low
• Horizontale Linien, Farben, Stärke, Stil (solid / dashed / dotted), Preis-Labels
Historical 52W High/Low (Offset)
• Verlauf an/aus, Farben, Füllung, Füllfarbe
• Im Tab Style sind die historischen Linien standardmäßig gestrichelt und können auf durchgezogen oder gepunktet gestellt werden
Info panel
• Tabelle an/aus, Position, Abstands-Label
█ HINWEISE UND GRENZEN
• 52 Wochen bedeutet 52 Wochenkerzen, nicht exakt 365 Kalendertage.
• Das aktuelle 52-Wochen-Hoch/-Tief aktualisiert sich mit der laufenden Woche.
• Der Offset verwendet geschlossene Wochenwerte (kein Vorgriff innerhalb der entstehenden Woche).
• Begleit-Screener: „52 Week High/Low Offset Screener“ (zu den Favoriten, dann Products → Screeners → Pine).
Dieses Skript erzeugt keine Handelssignale und ist keine Anlageberatung.
52 Week High/Low (Current & Offset)
Visibility: Open (recommended) or Protected
Category: Overlay / indicator
Companion script: 52 Week High/Low Offset Screener
----- Description (paste below; English first) -----
[A German description follows the English text.]
█ OVERVIEW
This indicator plots two 52-week ranges at once:
• Current 52-week high/low, including today’s price, as two horizontal lines.
• Historical 52-week high/low, lagged by a user-defined number of weeks, as a full history.
The current range always moves with price. After a sharp rally or sell-off that can make the live 52-week band less useful for context (for example dollar-cost averaging). The offset range shows where the 52-week high and low stood N weeks ago, before the latest move fully rewrote those extremes.
A distance label shows how far the close is from the nearer offset level, in percent of the current price. Positive = price is above that level, negative = below.
This is a positioning tool, not a buy or sell signal.
█ HOW IT WORKS
Current 52-week high/low
Calculated on the weekly timeframe over 52 weeks and combined with the developing week’s high/low on the chart timeframe, so today’s price is included.
Historical 52-week high/low (offset)
The same 52-week calculation, shifted by N weekly bars (default: 52). The offset is applied on the weekly timeframe, not in chart bars, so “52 weeks” remains 52 weeks on a daily chart.
Distance %
(close − offset level) / close × 100
The label is attached to whichever offset level is closer in price:
• Orange = nearer the offset high
• Teal = nearer the offset low
If the current 52-week high and the offset high print as the same price, they are merged into one label: “52W High = Offset”. The same logic applies independently to the low.
█ HOW TO USE
1. Add the script to a chart (daily is a typical timeframe).
2. Set Historical offset (weeks). Default is 52 (about one year); 13 ≈ one quarter, 4 ≈ one month.
3. Read price against the white historical path, not only against the green/red current lines.
4. Use the distance label and the table (Current vs −Nw) for a quick readout.
Reading for DCA-style context (not advice):
• Near the offset low, slightly negative or slightly positive → closer to the older low.
• Near the offset high, small negative → still below the older high, relatively expensive vs that band.
• Near the offset high, positive → price has left the older high.
█ SETTINGS
52-week setup
• Basis for 52-week values: Highs/Lows (default) or Close
• Historical offset (weeks)
Current 52W High/Low
• Horizontal lines, colors, width, style (solid / dashed / dotted), price labels
Historical 52W High/Low (Offset)
• History on/off, colors, fill, fill color
• In the Style tab, historical lines default to dashed and can be switched to solid or dotted
Info panel
• Table on/off, position, distance label
█ NOTES AND LIMITS
• 52 weeks means 52 weekly bars, not exactly 365 calendar days.
• The current 52-week high/low updates with the developing week.
• The offset uses closed weekly values (no lookahead inside the forming week).
• Companion screener: “52 Week High/Low Offset Screener” (add to Favorites, then Products → Screeners → Pine).
This script does not generate trading signals and is not investment advice.
--------------------------------------------------------------------------------
DEUTSCH
█ ÜBERBLICK
Der Indikator zeigt zwei 52-Wochen-Spannen gleichzeitig:
• Das aktuelle 52-Wochen-Hoch/-Tief inklusive heutigem Kurs, als zwei horizontale Linien.
• Das historische 52-Wochen-Hoch/-Tief, um eine wählbare Anzahl Wochen versetzt, als vollständigen Verlauf.
Die aktuelle Range wandert immer mit dem Kurs. Nach einer starken Rally oder einem Ausverkauf ist das live 52-Wochen-Band für den Kontext oft weniger nützlich (zum Beispiel beim Averagen / DCA). Die Offset-Range zeigt, wo Hoch und Tief vor N Wochen standen, bevor die jüngste Bewegung diese Extreme überschrieben hat.
Das Abstands-Label zeigt, wie weit der Schlusskurs vom näheren Offset-Niveau entfernt ist (in % vom aktuellen Kurs). Positiv = Kurs liegt darüber, negativ = darunter.
Das ist eine Lagehilfe, kein Kauf- oder Verkaufssignal.
█ BERECHNUNG
Aktuelles 52-Wochen-Hoch/-Tief
Berechnung auf dem Wochen-Timeframe über 52 Wochen, kombiniert mit dem laufenden Wochenhoch/-tief auf dem Chart-Timeframe, damit der heutige Kurs einbezogen wird.
Historisches 52-Wochen-Hoch/-Tief (Offset)
Dieselbe 52-Wochen-Berechnung, um N Wochenkerzen verschoben (Standard: 52). Der Versatz greift auf dem Wochen-Chart, nicht in Chart-Balken. „52 Wochen“ bleiben also auch auf dem Tageschart 52 Wochen.
Abstand %
(Schlusskurs − Offset-Niveau) / Schlusskurs × 100
Das Label hängt an dem Offset-Niveau, das preislich näher liegt:
• Orange = näher am Offset-Hoch
• Türkis = näher am Offset-Tief
Sind aktuelles 52W-Hoch und Offset-Hoch als derselbe Preis dargestellt, werden sie in einem Label zusammengefasst: „52W High = Offset“. Dieselbe Logik gilt unabhängig fürs Tief.
█ NUTZUNG
1. Skript auf einen Chart legen (Tageschart ist ein üblicher Timeframe).
2. Historical offset (weeks) einstellen. Standard ist 52 (ca. ein Jahr); 13 ≈ ein Quartal, 4 ≈ ein Monat.
3. Den Kurs gegen den weißen historischen Verlauf lesen, nicht nur gegen die grünen/roten aktuellen Linien.
4. Abstands-Label und Tabelle (Current vs. −Nw) für die schnelle Ablesung nutzen.
Lesart für DCA-Kontext (keine Empfehlung):
• Nah am Offset-Tief, leicht negativ oder leicht positiv → näher am älteren Tief.
• Nah am Offset-Hoch, leicht negativ → noch unter dem älteren Hoch, relativ teuer zu diesem Band.
• Nah am Offset-Hoch, positiv → der Kurs hat das ältere Hoch verlassen.
█ EINSTELLUNGEN
52-week setup
• Basis for 52-week values: Highs/Lows (Standard) oder Close
• Historical offset (weeks)
Current 52W High/Low
• Horizontale Linien, Farben, Stärke, Stil (solid / dashed / dotted), Preis-Labels
Historical 52W High/Low (Offset)
• Verlauf an/aus, Farben, Füllung, Füllfarbe
• Im Tab Style sind die historischen Linien standardmäßig gestrichelt und können auf durchgezogen oder gepunktet gestellt werden
Info panel
• Tabelle an/aus, Position, Abstands-Label
█ HINWEISE UND GRENZEN
• 52 Wochen bedeutet 52 Wochenkerzen, nicht exakt 365 Kalendertage.
• Das aktuelle 52-Wochen-Hoch/-Tief aktualisiert sich mit der laufenden Woche.
• Der Offset verwendet geschlossene Wochenwerte (kein Vorgriff innerhalb der entstehenden Woche).
• Begleit-Screener: „52 Week High/Low Offset Screener“ (zu den Favoriten, dann Products → Screeners → Pine).
Dieses Skript erzeugt keine Handelssignale und ist keine Anlageberatung.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
