Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 3

Understanding Market Session Timings

Recommended resources

Hello! Welcome back to the course.

In our last lesson, we covered the critical difference between CNC (delivery) and MIS (intraday) trades, establishing that MIS positions have a strict time limit. This brings us directly to today's topic, which is fundamental to your bot's operational logic. For an automated system to trade effectively, it must be "time-aware." It needs a precise internal clock that understands the market's schedule to know when it can place orders, what kinds of orders are allowed, and when it must exit positions to avoid penalties.

This lesson directly addresses the learning outcome: to identify pre-market, regular trading, and post-market session timings. We will dissect the NSE trading day into its core components, focusing on the rules and opportunities within each phase. This knowledge is not just theory; it's a prerequisite for designing the state machine that will govern your bot's behavior.

The Structure of the Trading Day

The Indian stock market doesn't just switch on at 9:15 AM and off at 3:30 PM. The entire trading day is a structured process divided into distinct sessions, each with a specific purpose. For your bot, understanding this structure is equivalent to knowing the different runlevels or states of an operating system.

The trading day is broadly divided into three main parts:

  1. Pre-Market Session (9:00 AM - 9:15 AM): A 15-minute window for price discovery before the market opens for continuous trading.
  2. Regular Trading Session (9:15 AM - 3:30 PM): The primary session where most trading activity occurs.
  3. Post-Market Session (3:30 PM - 4:00 PM): A session for administrative tasks and limited trading at a fixed price.

Let's explore each of these in detail.


1. Pre-Market Session (9:00 AM - 9:15 AM)

The purpose of the pre-market session is to stabilize the market at the opening by determining a fair opening price based on overnight news, events, and early demand/supply. This helps absorb the volatility that might otherwise occur if trading began abruptly.

For an algorithmic trader, this session is important because the opening price it generates can be a key input for strategies that trade in the first few minutes of the regular session.

The pre-market session itself is divided into three smaller phases.

Share Market Timings for BSE and NSE in India

To start, let's get a clear, official definition of the session timings from your broker, Angel One. This article provides a concise breakdown.

Please read the section titled 'Share market timings for BSE and NSE', focusing on the three sub-sessions of the pre-open period: the order entry session, the order matching session, and the buffer period.

Based on that reading and supplementing it with the official NSE definition, here is the breakdown:

Pre Open Session Timings
A visual breakdown of the three phases of the Pre-Open Session. Source: TrueData.
  • Phase 1: Order Entry (9:00 AM - ~9:08 AM)

    • During this period, you can place, modify, and cancel buy/sell orders.
    • Crucially, no trades are executed yet. The system simply collects all the orders.
    • The NSE states this period has a random closure between the 7th and 8th minute (i.e., between 9:07 and 9:08 AM) to prevent people from trying to game the closing seconds.
    • For your bot: Your bot could place LIMIT or MARKET orders during this window based on pre-night analysis. These orders would be queued for the price discovery phase.
  • Phase 2: Order Matching & Price Discovery (~9:08 AM - 9:12 AM)

    • Order placement/modification is frozen.
    • The exchange's engine now calculates the equilibrium price—the price at which the maximum number of shares can be traded. This price becomes the official opening price for the day.
    • This process is essentially a call auction. All the buy and sell orders are aggregated to find the single price that best satisfies both sides of the market.

    To understand the logic behind this calculation, which is quite algorithmic in nature, the following video provides an excellent explanation with a clear numerical example.

PRE-OPEN MARKET Explained - Trading from 9AM to 9:07AM!

This video by P R Sundar explains the price discovery mechanism used in the pre-market session. The mathematical example will help solidify your understanding of how the opening price is determined.

Watch the segment from 02:54 to 10:13. Focus on how the cumulative demand and supply are calculated at each price level and how the exchange identifies the equilibrium price where the maximum tradable quantity occurs.

*   **For your bot:** While your bot won't perform this calculation, knowing it happens is key. Any `MARKET` orders placed in the pre-open session will be executed at this discovered equilibrium price.
  • Phase 3: Buffer Period (9:12 AM - 9:15 AM)
    • This is a quiet period that ensures a smooth transition to the regular trading session.
    • Any outstanding, unexecuted orders from the pre-market session are automatically moved to the regular session's order book, retaining their original time priority.

2. Regular Trading Session (9:15 AM - 3:30 PM)

This is the main event.

  • Timings: 9:15 AM to 3:30 PM.
  • Function: Continuous, bilateral matching of orders. When a buy order price meets a sell order price, a trade is executed. This is the session where all order types (MARKET, LIMIT, STOP-LOSS, etc.) are fully active and where your intraday strategies will primarily operate.
  • Key detail: The official closing price of a stock is not the price of the last trade at 3:30 PM. It is the weighted average price of all trades that occurred in the last 30 minutes, from 3:00 PM to 3:30 PM. This is important for end-of-day analysis and settlement.

3. Post-Market Session (3:30 PM - 4:00 PM)

Just as the market has a structured opening, it also has a structured closing. This session is often a source of confusion and can cause errors in a trading bot if its logic isn't precise.

The session is split into two parts. The following video provides a live demonstration of how it works and, more importantly, what doesn't work.

What is Post Market Session? | With 🔴Live Post Market Trading

This video from VRDNation gives a practical walkthrough of the post-market session, including live demonstrations of placing orders. Pay close attention to which orders get accepted and which get rejected.

Watch from 01:35 to 09:44. Focus on the two parts of the session and the specific rules for trading between 3:40 PM and 4:00 PM (e.g., order types, segment). The live examples of rejected orders are particularly insightful from an engineering perspective.

Let's summarize the key rules shown in the video:

  • Phase 1: Closing Session (3:30 PM - ~3:40 PM)

    • No trading is allowed.
    • This period is used by the exchange for administrative tasks, including calculating and disseminating the official closing price (based on the 3:00-3:30 PM weighted average).
  • Phase 2: Post-Market Trading (3:40 PM - 4:00 PM)

    • Trading resumes, but with very strict rules:
      • Orders are executed only at the day's closing price.
      • You can only place Market orders. LIMIT orders are rejected.
      • You can only place Delivery (CNC) orders. INTRADAY (MIS) orders are rejected.
      • This session is only for the Equity (Cash) segment, not for Futures & Options.
    • The primary purpose was to allow traders to correct mistakes or react to late-breaking news. However, as the video mentions, liquidity is often extremely low, making it impractical for most active trading.

For your bot: The post-market session is an important edge case. If your bot generates a signal at 3:45 PM, it cannot simply fire off its standard MIS order. The order placement logic must contain state-aware rules: if time >= 15:40 and time <= 16:00, then product_type must be 'DELIVERY' and order_type must be 'MARKET'.

Test your understanding!

Your trading bot's clock reads 3:47 PM. Your strategy identifies a strong 'buy' signal for Reliance Industries. Your code attempts to place an intraday (MIS) limit order to buy 10 shares at ₹2,850.00. What will happen to this order and why?

Show answer

The order will be rejected by the exchange. During the post-market trading session (3:40 PM - 4:00 PM), only market orders for delivery (CNC) are accepted. Both the product type (MIS) and the order type (LIMIT) are invalid for this session.


Summary: A Bot's Guide to the Trading Day

To consolidate this, here is a timeline of the NSE trading day from the perspective of an automated system.

Time Window Session Name Permissible Bot Actions Key Considerations
9:00 - ~9:08 AM Pre-Market (Order Entry) Place, modify, cancel LIMIT and MARKET orders. No execution occurs. Orders are queued.
~9:08 - 9:12 AM Pre-Market (Matching) No actions. Opening price is determined. Pre-market orders are executed at this price.
9:12 - 9:15 AM Pre-Market (Buffer) No actions. Transition to regular market. Unexecuted orders are moved to the normal order book.
9:15 - 3:30 PM Regular Trading All actions: Place/modify/cancel all order types (MARKET, LIMIT, SL, etc.) for all products (MIS, CNC). This is the primary operating window for your bot. Auto-square off for MIS happens here.
3:30 - ~3:40 PM Closing Session No trading actions. Closing price is calculated.
3:40 - 4:00 PM Post-Market Place MARKET orders for CNC/DELIVERY only. Orders execute only at the closing price. Very low liquidity.
4:00 PM - 9:00 AM After Market Place After Market Orders (AMOs). Orders are queued and sent to the exchange at the next market open (9:00 AM).

Conclusion

You now have a detailed map of the NSE trading day. This is a crucial piece of the puzzle for building a robust trading bot. An algorithm that doesn't respect these time-based rules will inevitably fail.

Key Takeaways:

  • The trading day is not monolithic; it's a sequence of sessions (Pre-Market, Regular, Post-Market), each with unique rules.
  • Pre-Market (9:00-9:15 AM) is a call auction to determine a stable opening price.
  • Regular Trading (9:15 AM-3:30 PM) is the main arena for continuous trading where your intraday strategies will execute.
  • Post-Market (3:40-4:00 PM) allows for limited trading at the closing price but is highly restrictive (delivery market orders only).
  • Your bot's architecture must include a "state" that reflects the current market session to ensure it only attempts valid actions, preventing rejections and maintaining control.

Preview of the Next Lesson:

Now that we know when we can trade, the next step is to understand how we communicate our intent to the market. In the next lesson, we will explore the different order types: market, limit, stop-loss, and bracket orders. This will give you the vocabulary needed to instruct your bot on exactly how to enter and exit its positions.