Duplicate day data for equity stocks that have BO series as well

mb12
Using Zerodha Python APIs library, when we try to get data for NSE:CLEDUCATE stock for say 31-Oct-2023 to 05-Nov-2023, for some days we get double records with different traded volume. It appears to be giving data for BO series and EQ series separately without any category defining the difference. It's not clear why this behaviour has changed now when earlier it was being sent as a single record, never came across multiple records for same date using Zerodha APIs.

Secondly, even though in tickers we have separate ticker record for CLEDUCATE -BO, in this case even though the api call was made for CLEDUCATE, it is giving records for CLEDUCATE -BO as well?

Just sharing part of the code & output for reference, please note that the instrument token 5177089 is for CLEDUCATE & in instruments list we see a separate entry for CLEDUCATE-BO which has a different instrument token (4644097):

from_datetime = datetime.fromisoformat('2023-10-31 00:00:00+05:30')
to_datetime = datetime.fromisoformat('2023-11-05 00:00:00+05:30')
# historical data
data = kite.historical_data(instrument_token=5177089, from_date=from_datetime, to_date=to_datetime, interval='day')
logging.info(f"Data = \n{data}")

Output:

Data =
[{'date': datetime.datetime(2023, 10, 31, 0, 0, tzinfo=tzoffset(None, 19800)), 'open': 79.9, 'high': 82, 'low': 78.8, 'close': 79.6, 'volume': 275252}, {'date': datetime.datetime(2023, 11, 1, 0, 0, tzinfo=tzoffset(None, 19800)), 'open': 80.25, 'high': 80.25, 'low': 80.25, 'close': 80.25, 'volume': 550}, {'date': datetime.datetime(2023, 11, 1, 0, 0, tzinfo=tzoffset(None, 19800)), 'open': 80.7, 'high': 81, 'low': 78.9, 'close': 80.05, 'volume': 72258}, {'date': datetime.datetime(2023, 11, 2, 0, 0, tzinfo=tzoffset(None, 19800)), 'open': 81.5, 'high': 81.5, 'low': 81.5, 'close': 81.5, 'volume': 1504}, {'date': datetime.datetime(2023, 11, 2, 0, 0, tzinfo=tzoffset(None, 19800)), 'open': 80.15, 'high': 81.15, 'low': 80.05, 'close': 80.4, 'volume': 116792}, {'date': datetime.datetime(2023, 11, 3, 0, 0, tzinfo=tzoffset(None, 19800)), 'open': 82, 'high': 82, 'low': 82, 'close': 82, 'volume': 2282}, {'date': datetime.datetime(2023, 11, 3, 0, 0, tzinfo=tzoffset(None, 19800)), 'open': 80.1, 'high': 81.85, 'low': 79.65, 'close': 80.65, 'volume': 85381}]
Sign In or Register to comment.