MyAlgoGuru Help
Education Glossary Open the app
Help/Reference/Market Data

Trading Calendar & Market Sessions

The authoritative source for trading days, holidays and session timings per exchange — every module checks it before assuming the market is open.

Where you will find this

Trading calendar & sessions.

Purpose

Each exchange keeps its own calendar of trading days, holidays and session windows (pre-open, regular, post-close, special sessions like Muhurat). Live Market Data, the terminal, strategies and order management all defer to it to decide whether trading is currently permitted.

The Trading Calendar & Market Sessions module maintains the official trading calendar and market session information for all supported exchanges.

It provides a central reference for determining trading days, market sessions, holidays and exchange operating hours.

The module serves as the authoritative source for market availability across the platform.

Objectives

The module will:

  • Maintain exchange trading calendars.
  • Define trading sessions for supported exchanges.
  • Identify trading and non-trading days.
  • Support exchange holidays.
  • Support special trading sessions.
  • Provide market session information to dependent business modules.
  • Maintain historical calendar information.

Functional Scope

The module includes:

  1. Exchange Calendars
  2. Trading Days
  3. Holidays
  4. Market Sessions
  5. Session Status
  6. Special Trading Sessions
  7. Trading Time Validation
  8. Calendar Synchronisation
  9. Calendar History

Trading Calendar Model

Every supported exchange will maintain an independent trading calendar.

Each calendar will define:

  • Trading Days
  • Holidays
  • Trading Sessions
  • Special Sessions

Calendar information is maintained independently for every exchange.

Supported Exchanges

The module will support trading calendars for all supported exchanges.

Examples include:

  • NSE
  • BSE
  • MCX

The design remains extensible for additional exchanges.

Trading Days

The platform will identify trading days for every supported exchange.

Each calendar day is classified as one of:

  • Trading Day
  • Holiday
  • Weekend
  • Special Trading Day

Trading day information is available throughout the platform.

Market Sessions

Every exchange will maintain one or more market sessions.

Typical sessions include:

  • Pre-Open
  • Regular Trading
  • Post-Close
  • After Market
  • Auction Session

The platform remains extensible for exchange-specific session definitions.

Trading Hours

Every market session will define:

  • Session Start Time
  • Session End Time

Trading hours is maintained independently for each exchange.

Session Status

The platform will determine the operational status of every exchange.

Typical statuses include:

  • Closed
  • Pre-Open
  • Open
  • Closing
  • After Market
  • Holiday

Session status is continuously available to all business modules.

Holiday Management

The platform will maintain official exchange holidays.

Holiday information includes:

  1. Holiday Date
  2. Exchange
  3. Holiday Description

Holiday history is preserved.

Special Trading Sessions

The platform will support exceptional trading sessions including, where applicable:

  • Muhurat Trading
  • Extended Trading
  • Emergency Sessions
  • Exchange Announcements

Special sessions will override standard trading schedules where applicable.

Trading Time Validation

The module will determine whether trading activity is permitted for a given exchange at a given time.

Trading time validation is available to:

  • Manual Trading
  • Strategy Execution
  • Webhook Processing
  • Scheduler
  • Order Management

Calendar Synchronisation

The platform will support periodic synchronisation of trading calendar information from authorised sources.

Synchronisation will detect:

  • New Holidays
  • Calendar Changes
  • Session Changes
  • Exchange Schedule Updates

Historical Calendar

Historical calendar information is preserved.

Historical information may include:

  • Trading Days
  • Holidays
  • Session Timings
  • Special Sessions

Historical records remains immutable.

Business Rules

  • Every supported exchange will maintain an independent trading calendar.
  • Every exchange will maintain one or more trading sessions.
  • Trading activity will occur only during valid trading sessions unless explicitly permitted.
  • Holiday information is preserved historically.
  • Special trading sessions will override standard schedules where applicable.
  • Calendar information is the authoritative source for market availability.
  • Historical calendar records will never be deleted.

Audit Requirements

The platform will maintain an audit trail for trading calendar activities.

Audit events includes:

  • Calendar Creation
  • Holiday Addition
  • Holiday Modification
  • Session Changes
  • Special Session Creation
  • Calendar Synchronisation

Audit records remains immutable.

Out of Scope

The following are outside the scope of this module:

  • Live Market Prices
  • Order Execution
  • Strategy Logic
  • Historical Price Data
  • Portfolio Management

These responsibilities belong to their respective business modules.

Sessions are per segment, not per exchange

  • Equity, F&O and commodities trade different windows, so one clock for the whole exchange would be wrong for at least one of them.
  • Special sessions — a Union Budget held on a Saturday, for instance — come from a looked-up table of dates. They are never derived from a weekday rule or an assumption about which day of which month it falls on, because those rules do not hold.

The weekly expiry change

The set of weekly index expiries changed: from a date in late 2024, each exchange carries one weekly index expiry rather than one per index. Two consequences are worth knowing when looking at anything historical.

  • The question "which expiry was in force" spans two different regimes depending on the date, so a single rule cannot answer it across a long period.
  • A backtest whose period straddles the change says so, because an expiry tenor that stopped existing cannot simply be assumed forward.