OHLC calculated issue from websocket ltpc data

Hi team,

i am using Market Data Feed websocket in ltpc mode and i can see the LTP but when i check the candle stick chart it shows different open and close prices in 10s chart.

Below is the websocket data

ltt: 2025-06-10T10:34:58+05:30 ltp: 130.25 ltq: 150 cp:184.25
ltt: 2025-06-10T10:34:58+05:30 ltp: 130.3 ltq: 150 cp:184.25
ltt: 2025-06-10T10:34:59+05:30 ltp: 130.75 ltq: 150 cp:184.25
ltt: 2025-06-10T10:35:00+05:30 ltp: 130.95 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:00+05:30 ltp: 130.95 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:00+05:30 ltp: 130.75 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:01+05:30 ltp: 130.35 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:01+05:30 ltp: 130.25 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:02+05:30 ltp: 130.45 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:03+05:30 ltp: 130.25 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:03+05:30 ltp: 130.0 ltq: 150 cp:184.25
ltt: 2025-06-10T10:35:03+05:30 ltp: 130.2 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:05+05:30 ltp: 130.05 ltq: 150 cp:184.25
ltt: 2025-06-10T10:35:05+05:30 ltp: 130.0 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:06+05:30 ltp: 130.1 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:06+05:30 ltp: 130.35 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:06+05:30 ltp: 130.35 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:08+05:30 ltp: 130.2 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:08+05:30 ltp: 130.15 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:09+05:30 ltp: 129.8 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:10+05:30 ltp: 129.85 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:10+05:30 ltp: 129.65 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:11+05:30 ltp: 129.7 ltq: 150 cp:184.25
ltt: 2025-06-10T10:35:12+05:30 ltp: 129.75 ltq: 225 cp:184.25
ltt: 2025-06-10T10:35:12+05:30 ltp: 129.6 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:13+05:30 ltp: 129.35 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:13+05:30 ltp: 129.6 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:14+05:30 ltp: 128.8 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:15+05:30 ltp: 129.0 ltq: 150 cp:184.25
ltt: 2025-06-10T10:35:15+05:30 ltp: 129.05 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:16+05:30 ltp: 129.55 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:16+05:30 ltp: 128.95 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:17+05:30 ltp: 129.05 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:18+05:30 ltp: 129.85 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:18+05:30 ltp: 129.45 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:19+05:30 ltp: 129.4 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:20+05:30 ltp: 129.3 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:20+05:30 ltp: 129.3 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:21+05:30 ltp: 129.6 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:21+05:30 ltp: 129.85 ltq: 150 cp:184.25
ltt: 2025-06-10T10:35:22+05:30 ltp: 129.6 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:23+05:30 ltp: 130.35 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:23+05:30 ltp: 129.7 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:24+05:30 ltp: 129.45 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:25+05:30 ltp: 127.6 ltq: 150 cp:184.25
ltt: 2025-06-10T10:35:25+05:30 ltp: 127.55 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:26+05:30 ltp: 127.6 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:27+05:30 ltp: 127.8 ltq: 150 cp:184.25
ltt: 2025-06-10T10:35:27+05:30 ltp: 128.25 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:28+05:30 ltp: 128.15 ltq: 225 cp:184.25
ltt: 2025-06-10T10:35:28+05:30 ltp: 127.8 ltq: 150 cp:184.25
ltt: 2025-06-10T10:35:29+05:30 ltp: 128.0 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:29+05:30 ltp: 127.5 ltq: 300 cp:184.25
ltt: 2025-06-10T10:35:30+05:30 ltp: 128.05 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:30+05:30 ltp: 128.05 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:31+05:30 ltp: 127.9 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:32+05:30 ltp: 128.3 ltq: 150 cp:184.25
ltt: 2025-06-10T10:35:32+05:30 ltp: 128.1 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:32+05:30 ltp: 127.45 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:33+05:30 ltp: 127.9 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:34+05:30 ltp: 127.85 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:35+05:30 ltp: 128.25 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:35+05:30 ltp: 128.6 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:36+05:30 ltp: 128.6 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:36+05:30 ltp: 128.3 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:36+05:30 ltp: 128.3 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:38+05:30 ltp: 127.9 ltq: 150 cp:184.25
ltt: 2025-06-10T10:35:38+05:30 ltp: 128.0 ltq: 150 cp:184.25
ltt: 2025-06-10T10:35:39+05:30 ltp: 127.8 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:40+05:30 ltp: 128.15 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:40+05:30 ltp: 128.45 ltq: 75 cp:184.25
ltt: 2025-06-10T10:35:41+05:30 ltp: 128.45 ltq: 150 cp:184.25
ltt: 2025-06-10T10:35:42+05:30 ltp: 129.9 ltq: 150 cp:184.25
ltt: 2025-06-10T10:35:42+05:30 ltp: 129.75 ltq: 150 cp:184.25

and below is the candle stick image they are not matching

so, who is the open, close, high, and low calculated?

I thought

  • Open = First ltp in the time window.
  • High = Max ltp in the time window.
  • Low = Min ltp in the time window.
  • Close = Last ltp in the time window.
    is it not?
1 Like

@Pradeep_Jaiswar could you please help

its been 5 days now and no response yet @Upstox

Hi @BENSON_XAVIER The data received through WebSocket may not match the chart data exactly. This is because the WebSocket delivers sampled market data , which is optimized for lower bandwidth and faster transmission. In contrast, chart data is built using full market data feeds —either from Tick-by-Tick (TBT) or Snapshot sources—which capture every price and volume update more comprehensively. As a result, minor differences in price points, timestamps, or candle formation can occur between the two sources.

1 Like

Which means websocket is not accurate right. Is there any other way I can get more accurate data. My setup requires 10 second candle stick. Now how will I calculate it without accurate data. Could you please give some suggestions

@BENSON_XAVIER Currently, there is no support for seconds-level intervals in the Historical Candle Data V3. However, we will check with the relevant team to explore the possibility of adding support for it in the future.

Thanks for your feedback

Hi @BENSON_XAVIER

The data on websockets is accurate. While streaming TBT data, a lot of packets in the queue are usually missed, unless you’re on a 400MBPS stable bandwidth.
The previous candle info is always at full TBT accuracy that would match the charts. We do not support seconds timeframe at the moment.

However, 10 seconds candles can be easily formed at your end, but yes would have small discrepancies through the packets being missed from the socket.

2 Likes