Skip to main content

Welcome to a Grasp lesson

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

Lesson 2

Trading Types: Delivery, Intraday, and Margin

Recommended resources

Hello! Welcome back to our course on building your automated trading bot.

In our first lesson, we established the "what" of trading by distinguishing between the Equity and Derivatives segments on the NSE. Now, we'll focus on the "how"—specifically, how a trade is held and financed. This lesson addresses our second learning outcome: to explain the difference between delivery, intraday, and margin trading.

Understanding this is absolutely critical from an engineering perspective. Your bot will need to specify the product type for every order it places. Choosing the wrong type can lead to your positions being automatically closed against your strategy's logic or missing out on intended leverage. This choice is a core parameter that dictates the lifecycle of every trade your bot executes.

The Fundamental Distinction: Holding Period

The first question any trader—or trading algorithm—must answer before placing a buy order is: "How long do I intend to hold this position?" The answer broadly splits trades into two categories:

  1. Delivery Trading: You intend to hold the shares for more than one trading day. This could be for a few days (swing trading) or many years (investing).
  2. Intraday Trading: You intend to buy and sell the security within the same trading day, closing your position before the market shuts.

This choice has significant implications for risk, capital requirements, and the analytical approach used.

The image below provides a high-level summary of the differences between these two styles.

Intraday Trades vs Delivery Trades: A Quick Comparison
This table contrasts the core characteristics of Intraday and Delivery trading, highlighting differences in time horizon, objectives, risk, and analytical focus. Source: HDFC Sky.

As you can see, intraday trading is about capitalizing on short-term volatility, while delivery trading is typically based on a longer-term view of the asset's value.


Broker-Specific Product Types: CNC & MIS

When you place an order through a broker like Angel One, you don't just say "I want to do an intraday trade." Instead, you select a specific product type that tells the broker's system how to handle your order. For equity trading, the two most important product types are CNC and MIS.

Let's dive into what these mean, using a resource from your chosen broker, Angel One.

What Does CNC, MIS and NRML Mean in the Share Market?

This article from Angel One's knowledge center is the best place to learn the terminology they use. It will explain exactly what CNC and MIS mean in the context of their platform.

Please read the sections 'What is CNC in Trading?' and 'What is MIS in Trading?'. Focus on the purpose of each, the availability of leverage, and the rules about holding periods.

Let's distill the key points from that reading, framing them in the context of building your bot:

Delivery Trading with CNC (Cash and Carry)

  • Purpose: To buy shares and hold them overnight or longer. The shares are "delivered" to your Demat account, making you a shareholder.
  • Capital: You must pay the full value of the transaction. For example, to buy 100 shares of a stock priced at ₹150, you need ₹15,000 in your account.
  • Leverage: None. You cannot borrow funds from the broker for a CNC trade.
  • Holding Period: Indefinite. You can hold the shares for as long as you wish.
  • For your bot: You will use the CNC product type (often labeled as DELIVERY in APIs) when your strategy is designed to hold positions for several days, weeks, or months (e.g., a swing trading strategy).

A crucial nuance: If you place a CNC order and sell it on the same day, the trade is treated as an intraday trade for the calculation of taxes and fees. However, you did not use any leverage.

Intraday Trading with MIS (Margin Intraday Square-Off)

  • Purpose: To enter and exit a position on the same day. You are speculating on daily price movements without taking ownership of the shares.
  • Capital: You only need to put up a fraction of the total trade value, known as margin.
  • Leverage: The broker lends you the remaining amount, allowing you to take a larger position than your capital would normally allow. This is a key feature of intraday trading.
  • Holding Period: Strictly less than one trading day. The "Square-Off" part of the name is critical: you must close your position before the market closes. If you don't, the broker's risk management system will automatically close it for you at a predetermined time (e.g., 3:15 PM).
  • For your bot: You will use the MIS product type (labeled as INTRADAY in APIs) for strategies designed to capture profits within a single day (e.g., scalping, opening range breakouts). Your bot must have logic to close all MIS positions before the auto-square-off time to maintain control over its exits.

Understanding Margin and Leverage

The term "margin trading" can be a source of confusion because it's used in a couple of different ways. Let's clarify them.

  1. Intraday Margin (Leverage): This is the margin associated with MIS orders that we just discussed. It's a short-term, interest-free loan from the broker that magnifies your buying power for the day. If a broker offers 5x leverage, you can control ₹50,000 worth of stock with only ₹10,000 of your own capital. This amplifies both potential profits and potential losses.

  2. Margin Trading Facility (MTF): This is a separate product where you can buy shares for delivery (i.e., hold them overnight) using funds borrowed from your broker. Unlike intraday leverage, you typically have to pay interest on the borrowed amount.

Let's read a quick definition to solidify this second type of margin.

Types Of Orders in Stock Market - Intraday Trading

The following article gives a clear definition of a 'Margin Order' that is distinct from the automatic leverage you get with an intraday MIS order.

Please read just the section titled 'Margin Order'. Notice how it describes borrowing funds for delivery-based trades using a specialized mechanism.

For your initial bot, you should focus exclusively on the CNC vs. MIS distinction. MTF adds complexity (like interest calculations and margin calls) that is best avoided until your core system is robust and profitable.


A Quick Note on Derivatives: The NRML Order

The first article you read also mentioned NRML (Normal) orders. To connect back to our previous lesson, NRML is the product type used for holding Futures & Options (F&O) positions overnight.

  • MIS is for intraday trading in both Equity and F&O segments.
  • CNC is for taking delivery in the Equity segment.
  • NRML is for taking positional (overnight) trades in the F&O segment.

The tables in the Angel One article provide an excellent summary of these distinctions.

What Does CNC, MIS and NRML Mean in the Share Market?

To consolidate your understanding, let's review the comparison tables provided by Angel One. They offer a concise summary that's easy to reference.

Review the two tables: 'CNC vs MIS Orders' and 'MIS vs NRML Orders'. These tables are great cheat sheets for the key differences.

From a system design perspective, you can think of CNC, MIS, and NRML as enumerations for a productType parameter. The logic in your bot that generates a trading signal must also determine the intended holding period, which in turn dictates which productType to use in the order placement API call.

Test your understanding!

Imagine your bot is running two different strategies. For each scenario, identify the correct product type (CNC or MIS) to use and explain why.

  1. Strategy A is a "Golden Crossover" strategy. It buys a stock when its 50-day moving average crosses above the 200-day moving average and plans to hold it for several weeks or months. What product type should it use?

  2. Strategy B is an "Opening Range Breakout" strategy. It buys a stock if it moves above its high of the first 15 minutes of trading and aims to sell it for a small profit by the afternoon. What product type should it use? What is the key risk your bot's code must manage with this product type?

Show answer
  1. Strategy A must use CNC (Delivery). The strategy's intent is to hold the position overnight for an extended period. Using MIS would result in the position being force-closed by the broker at the end of the day, completely defeating the strategy's purpose.

  2. Strategy B should use MIS (Intraday). The strategy is designed to profit from price movements within a single day. Using MIS provides leverage, which can increase the return on the small price movement. The key risk to manage is the auto-square-off. The bot's code must ensure it places a corresponding sell order before the broker's cut-off time. If the bot crashes or fails to exit the position, it loses control, and the broker will exit at whatever the market price is at the square-off time.


Conclusion

We've now clarified the crucial differences between delivery, intraday, and margin trading, and mapped them to the practical product types you'll use when coding your bot.

Key Takeaways:

  • Delivery (CNC): For holding positions longer than one day. Requires full payment and offers no leverage. The shares are held in your Demat account.
  • Intraday (MIS): For positions opened and closed on the same day. Utilizes broker-provided leverage (margin) but comes with a mandatory auto-square-off if not closed manually.
  • Margin Trading: Can refer to the leverage used in MIS trades or a separate facility (MTF) for borrowing funds to hold delivery positions.
  • System Design: The choice between CNC and MIS is a fundamental parameter for every order. It must be dictated by your strategy's time horizon and implemented correctly in your bot's order placement logic.

Preview of the Next Lesson:

The concept of an "intraday" trade is defined by the market's opening and closing times. To correctly manage MIS positions and avoid auto-square-off, your bot needs to be aware of the market's schedule. In our next lesson, we will identify the pre-market, regular trading, and post-market session timings, giving your bot the temporal awareness it needs to operate effectively.