@KumarKuldipDas I am in Kolkata but I have extensive experience in the kind of data driven strategy testing that you need. Please feel free to reach out to me at [email protected]. Thanks.
There might be a simpler but more robust way to do this. Download historical data for NIFTY 50 index for the last 2 days till today. Run after market open. If the last date = today, then the market is open, else market is closed.