Live data from websockets and historical-candle data is not matching for 1 minute

I have fetched live data from websockets for 1 minute and download 1 minute data from
https://api-v2.upstox.com/historical-candle/NSE_EQ|INE095A01012/1minute/2023-10-30/2023-10-01/
only open price is matching other price like high , low and close price is not matching.

Please someone help on this .

Thanks

Thank you for contacting us. In the WebSocket, we offer live one-minute candles for the current timestamp, as well as for the previous one-minute timestamp. The following day, we construct the one-minute historical candle using the same data points.

To better investigate this, could you please provide the data you are comparing, displayed side by side? This will allow us to precisely identify the issue if necessary.

Hi

this data [“NSE_EQ|INE095A01012”] from this link
https://api-v2.upstox.com/historical-candle/intraday/NSE_EQ|INE095A01012/1minute/

timestamp open high low close volume
10/31/2023 9:15 1457 1457.95 1452.95 1455.05 21247
10/31/2023 9:16 1455.4 1459.8 1455.05 1458.45 15571
10/31/2023 9:17 1458.35 1458.35 1455.65 1456.15 7129
10/31/2023 9:18 1456.15 1456.7 1455.8 1456.4 2082
10/31/2023 9:19 1456.15 1456.8 1455.8 1456.5 3377
10/31/2023 9:20 1456.5 1456.7 1454.05 1454.7 11119
10/31/2023 9:21 1454.75 1455.9 1454.4 1454.65 2702

live data for [“NSE_EQ|INE095A01012”] from webscokets

{‘interval’: ‘I1’, ‘open’: 1455.4, ‘high’: 1455.5, ‘low’: 1455.05, ‘close’: 1455.05, ‘volume’: 1503, ‘ts’: ‘2023-10-31 09:16:00’}
{‘interval’: ‘I1’, ‘open’: 1458.35, ‘high’: 1458.35, ‘low’: 1458.35, ‘close’: 1458.35, ‘volume’: 4, ‘ts’: ‘2023-10-31 09:17:00’}
{‘interval’: ‘I1’, ‘open’: 1456.15, ‘high’: 1456.15, ‘low’: 1456.15, ‘close’: 1456.15, ‘volume’: 13, ‘ts’: ‘2023-10-31 09:18:00’}
{‘interval’: ‘I1’, ‘open’: 1456.15, ‘high’: 1456.15, ‘low’: 1455.95, ‘close’: 1455.95, ‘volume’: 282, ‘ts’: ‘2023-10-31 09:19:00’}
{‘interval’: ‘I1’, ‘open’: 1456.5, ‘high’: 1456.5, ‘low’: 1456.5, ‘close’: 1456.5, ‘volume’: 150, ‘ts’: ‘2023-10-31 09:20:00’}
{‘interval’: ‘I1’, ‘open’: 1454.75, ‘high’: 1454.75, ‘low’: 1454.75, ‘close’: 1454.75, ‘volume’: 31, ‘ts’: ‘2023-10-31 09:21:00’}

this is the example. you can see it is not matching

Thanks

@rahul

Upon manually reviewing the data in response to your concern, we’ve confirmed that the data appears to be correct.

I suspect there might be an issue with the way you’re parsing the data. Could you please attempt the parsing once more and let us know what you find? If the problem persists, feel free to share your websocket implementation with us so we can take a closer look.

Thank you!

Hi @shanmu

I have checked my code and i found there is a problem in my code.
I will work on my code changes.

Thank you

1 Like