Say I have the tradingsymbol: RELIANCE26JANFUT (instrument token: 12798210) from the current snapshot of instruments. If I got historical data with continuous=True for this instrument token for the dates: start_date = "2025-01-01" ; end_date = "2025-05-31", why do I get OHLCV data past JAN expiry date?
Since I am getting historical data it's getting data for RELIANCE25JANFUT (not RELIANCE26JANFUT) which definitely expires in Jan, but I see valid data past JAN, why is that?
Additionally, when I get historical data for instruments: 1. RELIANCE26JANFUT (instrument token: 12798210) 2. RELIANCE26FEBFUT (instrument token: 15221762)
For the specific date: "2025-02-18"(==start_date==end_date), interval="day" and continuous=True, the OHLCV data is not the same.
To understand the continuous=True parameter in more detail, refer to the official documentation.
Please note that the OHLC values will not be identical to those of individual futures contracts. Continuous futures charts aggregate historical data across contracts by categorizing them into current, near, and far months. When fetching historical data for the current month, data from all historically current-month contracts is combined. Similarly, fetching data for the near month aggregates data from all historically near-month contracts, and the same logic applies to the far month.
Since I was using Jan 2026 Futures' instrument token to retrieve data for the futures pricing in Jan 2025, I used continuous=True, which I did refer to the linked documentation prior to this thread.
I guess my question now is how is the OHLCV data combined after Jan 2025's expiry date? Also, in instruments I see that the Jan 2026 futures expire 2026-01-27. Shouldn't Futures expire on the last Thursday of the month?
1. RELIANCE26JANFUT (instrument token: 12798210)
2. RELIANCE26FEBFUT (instrument token: 15221762)
For the specific date: "2025-02-18"(==start_date==end_date), interval="day" and continuous=True, the OHLCV data is not the same.
Please note that the OHLC values will not be identical to those of individual futures contracts. Continuous futures charts aggregate historical data across contracts by categorizing them into current, near, and far months.
When fetching historical data for the current month, data from all historically current-month contracts is combined. Similarly, fetching data for the near month aggregates data from all historically near-month contracts, and the same logic applies to the far month.
I guess my question now is how is the OHLCV data combined after Jan 2025's expiry date? Also, in instruments I see that the Jan 2026 futures expire 2026-01-27. Shouldn't Futures expire on the last Thursday of the month?
To provide more context for my confusion.
Instrument token mapping: Here, I am getting data for the three above instruments for the same date in Feb: When I print them in that order, I get:
Why do they all disagree?
Now for the same 3 instruments for a date in March: And I print them in that same order, I get:
Both Jan and Feb should have expired here, but they both return different data. Why?
There are no API endpoints available to fetch information on expired historical contracts. This data can be obtained directly from the NSE website.
You may refer to this link for more information on how continuous data works.