chart namespace
Overview
Section titled “Overview”The chart namespace exposes metadata about the current chart, such as symbol, resolution, timezone, and instrument properties. Use these helpers to adapt logic or UI based on the user’s chart configuration.
Common helpers
Section titled “Common helpers”chart.symbol→ Symbol string (EXCHANGE:TICKER).chart.interval→ Chart resolution ("1","5","60","D","1W", etc.).chart.time_zone→ IANA timezone string for the chart.chart.pointvalue→ Currency value of one price point for the instrument.chart.is_seconds→truewhen the chart uses second-based resolution.chart.is_nonaligned→truewhen the chart is non-time-aligned (e.g., range, Renko).
Example
Section titled “Example”//@version=5indicator("Chart metadata", overlay=false)label.new(bar_index, close, text = "Symbol: " + chart.symbol + "\nInterval: " + chart.interval + "\nTimezone: " + chart.time_zone + "\nPoint value: " + str.tostring(chart.pointvalue), style=label.style_label_left, textcolor=color.white, bgcolor=color.new(color.blue, 70))
isRangeChart = chart.is_nonalignedbgcolor(isRangeChart ? color.new(color.orange, 90) : na)