{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreif2ujh6idkcuwrrn472kjzfrcmfiuzexxwbv7r6f4kyfxjqlzj5tm",
"uri": "at://did:plc:25rdn5elo5izoxrmtis34zuk/app.bsky.feed.post/3mpqw56rbzok2"
},
"coverImage": {
"$type": "blob",
"ref": {
"$link": "bafkreigk2h5cv4ephsooct3gx3koxczeptph6xz6ecben5ylo5vg2spyry"
},
"mimeType": "image/webp",
"size": 76242
},
"path": "/aionanalytics/why-pandasmarketcalendars-fails-for-indian-markets-and-what-to-use-instead-2m75",
"publishedAt": "2026-07-03T15:46:05.000Z",
"site": "https://dev.to",
"tags": [
"python",
"fintech",
"india",
"opensource",
"AION Analytics (India)",
"dashboard.aiondashboard.site/open-source/indian-market-calendar"
],
"textContent": "Indian algo traders and quant developers hit the same wall: they reach for `pandas_market_calendars`, set up `XNSE`, and get back answers that are silently wrong for three segments that matter most in India.\n\nHere is what breaks and what to use instead.\n\n## The three failure cases\n\n### 1. MCX evening sessions\n\nMCX commodity markets (crude oil, natural gas, gold, silver) run until 23:30 IST. `pandas_market_calendars` has no MCX calendar. Any check after 15:30 returns a wrong answer.\n\n\n\n # pandas_market_calendars — no MCX at all\n # mcal.get_calendar(\"MCX\") → KeyError\n\n # aion-indian-market-calendar — works correctly\n from aion_indian_market_calendar import IndiaMarketCalendar\n from datetime import datetime\n from zoneinfo import ZoneInfo\n\n cal = IndiaMarketCalendar.bundled(2026)\n tz = ZoneInfo(\"Asia/Kolkata\")\n cal.is_market_open(\"MCX\", datetime(2026, 6, 18, 20, 0, tzinfo=tz)) # True\n\n\n### 2. NSE Currency Derivatives (CDS) — wrong hours, wrong holidays\n\nUSDINR, EURINR, GBPINR, JPYINR futures and options trade on NSE CDS from 09:00 to **17:00 IST** — 90 minutes longer than NSE equity. CDS also has a separate holiday calendar.\n\n`pandas_market_calendars` has no CDS calendar. Using XNSE gives you wrong close times and potentially wrong holiday answers for any currency derivative workflow.\n\n\n\n from aion_indian_market_calendar import IndiaMarketCalendar\n cal = IndiaMarketCalendar.bundled(2026)\n\n # These resolve correctly to their respective segments\n cal.is_market_open(\"USDINR\", at) # NSE_CURRENCY_DERIVATIVES: closes 17:00\n cal.is_market_open(\"NSE\", at) # NSE_EQUITY: closes 15:30\n cal.is_market_open(\"MCX\", at) # MCX: closes 23:30\n\n\n### 3. Muhurat trading (Diwali special session)\n\nOn Diwali, NSE runs a one-hour equity session in the evening. `pandas_market_calendars` marks this day as a holiday. Schedulers that rely on it will skip execution entirely.\n\n\n\n cal = IndiaMarketCalendar.bundled(2026)\n events = cal.events_on(\"2026-11-08\", exchange=\"NSE\")\n # Returns the Muhurat trading session event with timing metadata\n\n\n## Install\n\n\n pip install aion-indian-market-calendar\n\n\nMIT license. No API key. Fully offline once installed.\n\n## What this package is (and is not)\n\n`aion-indian-market-calendar` is a standalone MIT-licensed Python package for Indian exchange session and holiday checks. It is not an API, it does not require authentication, and it does not make network requests at runtime.\n\nThe package is maintained by AION Analytics (India) — an India-native market infrastructure firm. Full documentation at dashboard.aiondashboard.site/open-source/indian-market-calendar.\n\n_AION Analytics (India) is distinct from Aion Analytics LLC (US) and AION Labs (Israel, biotech)._",
"title": "Why pandas_market_calendars Fails for Indian Markets (and what to use instead)"
}