I’ve built a working equity backtesting engine in Python, but I’m struggling to model options backtesting due to expiry handling and dynamic option chains.
How do you correctly select expiries, map ATM strikes, and roll contracts in historical option backtests?
Any recommended data structures or standard approaches would be very helpful.
You may refer to the sample codes and implementation references available in our official documentation here:
The documentation covers option chains, expiry handling, strike selection, and related API usage, which should help you structure historical options backtesting logic.
If you face any challenges while using the APIs or need clarification on specific endpoints, please feel free to write to us at apihelp@dhan.co. Kindly share the endpoint being used along with the request and response structure so we can review it and assist you more effectively.