TradingView Chart Time Looks Wrong? Check the Timestamp Before the Feed

TickDB Research ·

If the time on your TradingView chart disagrees with a Pine label or an API candle, first check whether both values describe the same bar boundary at the same instant. When the Unix timestamps match but the displayed strings do not, the discrepancy is display formatting. When the timestamps differ, changing the chart timezone won't reconcile them.

Start with one completed intraday bar

Use a standard time-based chart and make the symbol (including the venue), interval, and regular versus extended session match your export. Pick a completed bar so its closing boundary is known. Record both the opening and closing timestamps rather than comparing a chart label to a provider field named only time.

TradingView's chart timezone formats the axis. Pine's calendar variables normally use the exchange timezone, available as syminfo.timezone. Pine cannot read the user's chart timezone as a script setting. Pine's time and time_close variables give the bar's opening and closing Unix timestamps in milliseconds. Those numbers represent instants; changing how the chart displays them doesn't move the bar.

Print one opening timestamp in two zones

Add this Pine v6 diagnostic to a standard intraday chart. It uses the last confirmed historical bar so you can compare a completed interval. To compare with your axis, set the input to the same IANA timezone you chose on the chart. That input is independent of the chart's timezone selector.

//@version=6
indicator("Bar timestamp check", overlay = true)
string compareZone = input.string("America/New_York", "Comparison timezone")
string fmt = "yyyy-MM-dd HH:mm:ss"
if barstate.islastconfirmedhistory
    string utcOpen = str.format_time(time, fmt, "UTC")
    string exchangeOpen = str.format_time(time, fmt, syminfo.timezone)
    string localOpen = str.format_time(time, fmt, compareZone)
    string utcClose = na(time_close) ? "unknown" : str.format_time(time_close, fmt, "UTC")
    string report = "Open epoch ms: " + str.tostring(time) +
      "\nOpen UTC: " + utcOpen +
      "\nOpen " + syminfo.timezone + ": " + exchangeOpen +
      "\nOpen " + compareZone + ": " + localOpen +
      "\nClose UTC: " + utcClose
    label.new(bar_index, high, report)

As a synthetic check, 2026-11-16 14:30 UTC is 09:30 in New York and 22:30 in Hong Kong. The three clock readings differ, but the underlying opening timestamp is the same: 1794839400000 milliseconds. Compare normalized timestamps before comparing any date strings.

One synthetic bar opening rendered in New York, UTC, and Hong Kong.

One timestamp, three clock readings; synthetic example.

Decide what the mismatch means

ObservationCheck next
Same epoch, different readable timeDisplay timezone or format. Use a named timezone so daylight-saving changes don't require a fixed offset.
Export has ten digits and Pine has thirteenRead the export schema. A present-day Unix timestamp in seconds becomes milliseconds by multiplying by 1,000, but never guess the unit for production from length alone.
Difference is one intervalCompare opening versus closing semantics first. If those agree, check how the provider builds the interval and whether a session boundary shortened it.
First or last bars do not line upCompare venue, session settings, interval construction and provider coverage. Missing or differently aggregated data is possible but not established by a timestamp mismatch alone.
Calendar date changes after conversionCompare instants separately from the exchange's trading-day label. An overnight session can start on the previous local date.

For overnight sessions, time_tradingday can help identify the trading-day date on applicable chart timeframes. It is not the bar's opening timestamp. The TradingView Pine FAQ gives an example where an overnight bar opens on the previous calendar day; it also explains why daily chart labels can use a trading date rather than simply displaying the open instant. Don't apply this intraday diagnostic unchanged to daily labels or assume an active non-time-based bar has a known closing time.

If you're comparing a TickDB export with a Pine value, apply the same check as for any provider: capture the venue, session, timestamp unit and boundary semantics from that specific endpoint before concluding anything from the axis. The useful artifact for a bug report is one reproducible bar with its UTC opening and closing instants and the expected session, not a screenshot of two clocks.

Related articles

Forex WebSocket API in Python: Is EURUSD Still Updating?

For Python developers building a forex quote monitor, this guide uses TickDB to subscribe to EURUSD and save each quote with its data timestamp and local receipt time. A bounded script writes raw messages, a quote CSV and a run summary. Quote counts, receipt gaps and changes in data timestamps help distinguish an open connection from continuing quote updates. The recorded 30-second observation received 38 EURUSD messages. The same code lets you inspect a new sample in your own environment.

TickDB Research ·

Integrating a Forex Real-Time Market Data API: How to Avoid Displaying Stale Quotes After a WebSocket Reconnection

After integrating real-time market data into a forex dashboard, exchange-rate monitor, or price alert, when should the page resume showing that it is “updating normally” once the connection is restored? This article is aimed at developers responsible for these features. Using TickDB’s actual EUR/USD subscription as an example, it walks through the full process of connecting, subscribing, deliberately disconnecting, and reconnecting, and explains how quote timestamps, heartbeats, and page status work together to keep teams from being misled by stale data. Product managers and technical colleagues can use the recovery sequence and acceptance checklist in the article to jointly review the page behavior.

TickDB Research ·

Forex Tick Data API: Live Quotes, Historical Downloads, and Access Costs

For quant teams choosing an FX data supplier, a working live feed answers only part of the purchasing question. Research may need historical bid and ask updates, while a dashboard may need current quotes and charts. This guide explains how to distinguish quotes, trades, and bars, check historical access, and compare costs against a specific job. It includes a dated EUR/USD quote sample, three actual TickDB historical queries, and a supplier questionnaire you can copy into an enquiry.

TickDB Research ·

How to Choose a Real-Time Market Data API: Verify Coverage First, Then Test Latency and Cost

When integrating stock, foreign exchange, futures, index, or cryptocurrency quotes, how do you determine whether a real-time market data API is suitable for your project? First, turn your asset classes, fields, and business use cases into a requirements matrix. Then validate REST queries and WebSocket streams separately, and finally decide whether to purchase based on sampling, reconnection tests, and license verification. Receiving quotes does not mean that tick-by-tick data, a complete order book, or backfillable history is available. The difference between receipt time and source time is meaningful only after the time definitions are clear and clocks are synchronized.

TickDB Research ·