Platform: Node.js Kite Connect API Version: 3.0 Instrument Data Endpoint: kc.getInstruments("NFO") Error Encountered:Nearest Expiry: 2025-01-30 No CE instrument found for Strike: 0, Expiry: 2025-01-30 No PE instrument found for Strike: 0, Expiry: 2025-01-30 Could not find both CE and PE instruments for ATM Strike: 0 Skipping logging due to missing data. Steps to Reproduce the Issue Fetch the latest Nifty50 spot price using kc.getLTP(["NSE:NIFTY 50"]). Calculate the ATM strike price by rounding the spot price to the nearest 50. Fetch all instruments in the NFO segment using kc.getInstruments("NFO"). Filter the instruments for CE and PE options for the calculated ATM strike price and the nearest expiry. Fetch LTP data for the filtered instruments using kc.getLTP(). Challenges Faced Strike Price Issue: The ATM strike price is being calculated correctly, but the script fails to find matching CE and PE instruments for the calculated strike. Expiry Issue: The kc.getInstruments("NFO") method does not return instruments matching the nearest expiry, despite logging multiple entries for the correct expiry. Missing LTP Data: Sometimes, the kc.getLTP(["NSE:NIFTY 50"]) call fails, returning LTP data unavailable for NIFTY 50. Specific Questions Instrument Mismatch: Could there be a delay in updating option instruments in the API, or are there known issues with fetching Nifty50 options data? Expiry Parsing: Is there a specific format or filter that needs to be applied to kc.getInstruments("NFO") to ensure accurate data retrieval? Data Completeness: Are there limitations in fetching all available instruments for the current expiry? Logs for Debugging Below are the relevant debug logs captured during script execution:
text CopyEdit Nifty Spot Price: 23160 ATM Strike Price: 23150 Nearest Expiry: 2025-01-30 Fetched Expiry Dates: [2025-01-30, 2025-02-27, 2025-03-27, ...] No CE instrument found for Strike: 23150, Expiry: 2025-01-30 No PE instrument found for Strike: 23150, Expiry: 2025-01-30 Additionally, I can share a complete JSON dump of the instruments fetched via kc.getInstruments("NFO") upon request.
Request for Assistance I kindly request your assistance in resolving the following:
Confirm whether there are any known issues with the API when fetching Nifty50 CE/PE instruments for ATM strikes. Validate if the expiry data provided by kc.getInstruments("NFO") is accurate and up-to-date. Provide any guidance or best practices to avoid such issues in the future.