How to get old expiry dates of banknifty and nifty for backtesting?
-
Hi,
I'm writing a banknifty strategy in python. In the running market I'm getting current expiry dates as well as future expiry dates from the below link -- https://margincalculator.angelbroking.com/OpenAPI_File/files/OpenAPIScripMaster.json
But I need the old expiry dates for backtesting which are already past.
For getting ltp I need to prepare the tradingsymbol (BANKNIFTY19JUN2450000PE) which consist of symbol, expiry date, strike price and CE/PE which will return me the token.Using token and tradingsymbol we can get the ltp from the API.
But unfortunately I couldn't find any solution to get the old expiry dates. Please help to sot out this problem.
Thank you.
-
-
@Moderator_3
Thank you for your reply.Got your point. But then how some algo platforms backtesting their strategies and providing the P&L and other reports? Is their any other way to do it? Please suggest. I'm completely new in this.
Thank you.
-
Hello @Mitrajit
As of now we are not providing the historical data of expired contract but for live contracts you can use the quote(Market Data API) or GetLtpData API
Regards,
SmartAPI Team