Why has the value of historical candles on the chart changed after a refresh or opening a new chart?
When a chart is opened, live candles are formed on the user's computer or mobile using the ticks or prices streamed from Zerodha's end. Historical candles or the pre-existing candles on the chart are stored at Zerodha's end using the market data received from exchanges. The data used to form candles on the user's device could be a subset of the actual data received by Zerodha. This can happen due to variations in internet speed and uptime, resulting in the user receiving fewer ticks. Consequently, the candles plotted on the user's device may slightly differ from the candles saved at Zerodha's end for historical data. When the user refreshes the chart or opens a new one, Zerodha streams the historical candles, replacing the previously plotted candles from the time the chart was opened. This can lead to slight differences in how the chart appears upon refreshing or reopening the same chart.
To ensure accuracy, Zerodha adjusts the opening price of the day at around 9:20 AM, as the market opening can experience a surge in ticks, causing potential discrepancies. The opening price is adjusted using the actual open price published by the exchanges, which is the pre-market opening price of 9:07 AM for stocks and the actual opening price seen in the market depth for F&O instruments. As a result, when the historical candles are recalculated and refreshed on the chart, they reflect the actual opening price published by the exchanges, not the opening price captured by the candles on the user's end.