• Prodotti
  • Comunità
  • Mercati
  • Broker
  • Altro
Inizia
  • Indicatori e strategie
  • /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.
Indicatore Pine Script®
di gumbtg

Dati di mercato selezionati forniti da ICE Data Services. Dati di riferimento selezionati forniti da FactSet. Copyright © 2026 FactSet Research Systems Inc.Copyright © 2026, American Bankers Association. Database CUSIP fornito da FactSet Research Systems Inc. Tutti i diritti riservati. Documenti depositati presso la SEC e altri documenti forniti da Quartr.© 2026 TradingView, Inc.

Più che un semplice prodotto
  • Grafici
Screener
  • Azioni
  • ETF
  • Obbligazioni
  • Singole cripto
  • Coppie CEX
  • Coppie DEX
  • Pine
Heatmap
  • Azioni
  • ETF
  • Cripto
Calendari
  • Economico
  • Utili
  • Dividendi
Altri prodotti
  • Curve di rendimento
  • Opzioni
  • Notiziario
  • Pine Script®
Applicazioni
  • Smartphone
  • Desktop
Comunità
  • Social network
  • Muro social
  • Invita un amico
  • Regolamento
  • Moderatori
Idee
  • Trading
  • Formazione
  • Selezione editoriale
Pine Script
  • Indicatori e strategie
  • Maestri
  • Freelancer
Strumenti e abbonamenti
  • Caratteristiche
  • Costi
  • Dati di mercato
  • Regala abbonamenti
Trading
  • Panoramica
  • Broker
Offerte speciali
  • Futures CME Group
  • Futures Eurex
  • Bundle azioni USA
Informazioni sulla società
  • Chi siamo
  • Missione spaziale
  • Blog
  • Carriere
  • Kit multimediale
Merchandising
  • TradingView Shop
  • I tarocchi per i trader
  • C63 TradeTime
Politiche e sicurezza
  • Condizioni d'uso
  • Declinazione di responsabilità
  • Normativa sulla privacy
  • Politica sui cookies
  • Dichiarazione di accessibilità
  • Consigli per la sicurezza
  • Programma bug bounty
  • Pagina di stato
Soluzioni per le aziende
  • Widget
  • Librerie grafiche
  • Lightweight Charts™
  • Grafici avanzati
  • Piattaforma di trading
Opportunità di crescita
  • Pubblicità
  • Integrazione broker
  • Programma affiliazione
  • Programma di formazione
Comunità
  • Social network
  • Muro social
  • Invita un amico
  • Regolamento
  • Moderatori
Idee
  • Trading
  • Formazione
  • Selezione editoriale
Pine Script
  • Indicatori e strategie
  • Maestri
  • Freelancer
Soluzioni per le aziende
  • Widget
  • Librerie grafiche
  • Lightweight Charts™
  • Grafici avanzati
  • Piattaforma di trading
Opportunità di crescita
  • Pubblicità
  • Integrazione broker
  • Programma affiliazione
  • Programma di formazione
Look FirstLook First