• Produkte
  • Community
  • Märkte
  • Broker
  • Mehr
Auf geht's
  • Indikatoren und Strategien
  • /Ytdreturns

Ytdreturns

YTD % / Visible Range % TableAUTHOR: Brandon Gum DATE: 2026-01-03 // PURPOSE: // Calculates price-range metrics based on the *currently visible* // portion of the chart. Intended for table-based UI display where // values must be stable and evaluated only on the last bar. // // Originally based on Jeff Sun's ADR price data table. // // METRICS RETURNED: // - Visible High // - Visible Low // - Visible % Range = (Visible High - Visible Low) / Visible Low // - Visible ATRs = (Visible High - Visible Low) / ATR // // IMPLEMENTATION NOTES: // - Logic executes ONLY on barstate.islast to avoid state corruption. // - Visible range is recomputed atomically using a backward loop // bounded by chart.left_visible_bar_time. // - Avoids var-based accumulation and bar-by-bar resets, which are // unreliable when visible window changes. // - ATR is evaluated at the current bar (not averaged over range). // // ASSUMPTIONS / LIMITATIONS: // - Uses chart-visible time boundaries supplied by TradingView. // - Loop upper bound must be sufficiently large to cover max // expected visible bars. // - Intended for display purposes, not signal generation. // // SIDE EFFECTS: // - None. No plots, no drawings, no state persistence.
Pine Script® Indikator
von gumbtg

Die ausgewählten Marktdaten werden von ICE Data Services bereitgestellt.Die ausgewählten Referenzdaten werden von FactSet. Copyright © 2026 FactSet Research Systems Inc.Copyright © 2026, American Bankers Association bereitgestellt. Die CUSIP-Datenbank wird von FactSet Research Systems Inc. bereitgestellt. Alle Rechte vorbehalten.Die SEC-Einreichungen und sonstigen Dokumente werden von Quartr bereitgestellt.© 2026 TradingView, Inc.

Mehr als ein Produkt
  • Supercharts
Screener
  • Aktien
  • ETFs
  • Anleihen
  • Krypto-Coins
  • CEX-Paare
  • DEX-Paare
  • Pine
Heatmaps
  • Aktien
  • ETFs
  • Krypto
Kalender
  • Ökonomie
  • Earnings
  • Dividenden
Weitere Produkte
  • Renditekurven
  • Optionen
  • Nachrichtenstrom
  • Pine Script®
Apps
  • Mobile
  • Desktop
Community
  • Soziales Netzwerk
  • Wall of Love
  • Einem Freund empfehlen
  • Hausregeln
  • Moderatoren
Ideen
  • Trading
  • Ausbildung
  • Editors' Picks
Pine Script
  • Indikatoren & Strategien
  • Wizards
  • Freelancer
Tools & Abonnements
  • Features
  • Preise
  • Marktdaten
  • Abonnements verschenken
Trading
  • Übersicht
  • Broker
Sonderangebote
  • Futures der CME Group
  • Eurex-Termingeschäfte
  • US-Aktienbündel
Über das Unternehmen
  • Wer wir sind
  • Weltraummission
  • Blog
  • Karrieren
  • Media Kit
Merch
  • TradingView-Store
  • Tarotkarten für Trader
  • Der C63 TradeTime
Richtlinien & Sicherheit
  • Nutzungsbedingungen
  • Haftungsausschluss
  • Datenschutzrichtlinie
  • Cookies-Richtlinien
  • Zugänglichkeitserklärung
  • Sicherheitstipps
  • Bug-Bounty-Programm
  • Statusseite
Geschäftslösungen
  • Widgets
  • Charting-Bibliotheken
  • Lightweight Charts™
  • Fortschrittliche Charts
  • Trading-Plattform
Wachstumsmöglichkeiten
  • Werbung
  • Brokerage Integration
  • Partnerprogramm
  • Ausbildungsprogramm
Community
  • Soziales Netzwerk
  • Wall of Love
  • Einem Freund empfehlen
  • Hausregeln
  • Moderatoren
Ideen
  • Trading
  • Ausbildung
  • Editors' Picks
Pine Script
  • Indikatoren & Strategien
  • Wizards
  • Freelancer
Geschäftslösungen
  • Widgets
  • Charting-Bibliotheken
  • Lightweight Charts™
  • Fortschrittliche Charts
  • Trading-Plattform
Wachstumsmöglichkeiten
  • Werbung
  • Brokerage Integration
  • Partnerprogramm
  • Ausbildungsprogramm
Look FirstLook First