Welcome to the first lesson of your journey to building an automated trading bot! We're starting with the absolute fundamentals to ensure the systems you design are built on a solid foundation.
This lesson addresses the first learning outcome of our course: "Describe the structure of NSE equity and derivatives segments." We'll explore the two primary markets where trading occurs on the National Stock Exchange (NSE). Understanding this distinction is critical because the type of instrument you trade—a stock or a derivative—fundamentally changes your bot's architecture, data requirements, and risk management logic.
Let's begin by establishing the landscape of the NSE.
The Two Major Trading Arenas
At its core, the NSE provides a marketplace for two broad categories of financial instruments: those representing direct ownership (Equity) and those representing contractual rights and obligations based on an underlying asset (Derivatives).
The diagram below provides a clean visual overview of the main segments of the NSE. We will focus on the Equity and Equity Derivatives segments.

To understand the fundamental difference between these two, it's helpful to think of them in terms of owning an asset versus holding a contract on that asset.
Trading in the Cash Segment of the Equity Market
This article from Ace Money provides a clear, beginner-friendly analogy to distinguish between the cash (equity) and derivatives markets.
Please read the section titled 'The Two Main Segments of the Stock Market'. Pay close attention to the analogy comparing the cash market to owning property and the derivatives market to signing a contract for that property.
As the article highlights, the distinction is crucial:
- Equity (Cash) Segment: You buy or sell actual shares of a company. You pay the full value, and you become a part-owner. It's straightforward ownership.
- Derivatives Segment: You buy or sell contracts whose value is derived from an underlying asset (like a stock or an index). You are not trading the asset itself but rather an agreement about its future price.
Given your background in system architecture, you can think of this like the difference between owning a physical server versus using a cloud provider's API.
- Equity: Owning the server. You have direct ownership, responsibility, and rights to the hardware itself.
- Derivatives: A contract with AWS (e.g., a reserved instance). You don't own the physical machine, but you have a contractual right to use its compute power under specific terms, for a specific duration, and at a pre-agreed price. The value of this contract is derived from the underlying utility of the server.
A Closer Look at the Equity (Cash) Segment
Let's solidify our understanding of the Equity segment, as this is where many automated strategies begin. When your bot buys a stock in this segment, it is acquiring a tangible piece of a company.
Trading in the Cash Segment of the Equity Market
Let's return to the Ace Money article to understand the mechanics of the Equity segment.
Read the introductory paragraphs defining a stock and the section explaining how trading works in the cash segment (starts with 'In the cash segment, you buy and sell shares...'). Note the points about the demat account, dividends, and the absence of expiry dates.
The key characteristics of trading in the Equity segment are:
- Direct Ownership: You own the shares, which are held in your Demat account.
- Full Value Payment: You must pay the full transaction value (e.g., 10 shares of INFOSYS at ₹1,500 each costs you ₹15,000 plus charges).
- Corporate Actions: As a shareholder, you are entitled to benefits like dividends.
- No Expiry: The shares you own do not expire. You can hold them indefinitely.
From an engineering perspective, a bot trading in this segment needs a state management system that primarily tracks the quantity of shares held and their average purchase price.
Demystifying the Derivatives Segment
Now, let's turn to the Derivatives segment. While your initial strategies will likely focus on equities, understanding derivatives is essential for long-term growth as a quantitative trader. These instruments are powerful but also introduce more complexity.
The two main types of derivatives traded on the NSE are Futures and Options.
Frequently Asked Questions on Derivatives Trading At NSE
This FAQ document from the NSE provides precise definitions for derivatives, futures, and options. It's a bit more formal but offers the technical clarity we need.
Read question 1 ('What are derivatives?') and question 6 ('What are various types of derivative instruments traded at NSE?'). Focus on the definitions of Futures and Options, and the distinction between a 'right' and an 'obligation'.
Let's break down the core concepts from the reading:
-
Futures Contract: An agreement to buy or sell an asset at a predetermined future date and price. It is an obligation for both the buyer and the seller. If you buy a futures contract, you are obligated to buy the underlying asset at the agreed-upon price on the expiry date (or settle the price difference in cash).
-
Options Contract: This contract gives the buyer the right, but not the obligation, to buy (a Call option) or sell (a Put option) an asset at a specific price on or before a future date.
- If you buy a Call option, you have the option to buy the stock at the agreed price. You will only exercise this right if it's profitable (i.e., if the market price is higher than your agreed price).
- If you buy a Put option, you have the option to sell the stock at the agreed price. You will only exercise this if the market price is lower.
To make this concrete, the NSE allows trading of derivatives on major indices (like the Nifty 50) and many individual stocks.
Test your understanding!
Your bot's strategy generates a "buy" signal for the NIFTY 50 index, which is currently trading at 23,500.
- If the bot is designed to trade in the Equity segment, what would it typically buy to follow the signal?
- If the bot buys a NIFTY 50 Futures contract, what has it entered into?
- If the bot buys a NIFTY 50 Call Option with a strike price of 23,600, what right has it acquired?
Show answer
- In the Equity segment, you cannot buy an index directly. The bot would need to buy the shares of the companies that make up the NIFTY 50, typically through an Exchange Traded Fund (ETF) like "NIFTYBEES" that tracks the index. It would acquire units of this ETF, representing ownership in a basket of stocks.
- By buying a Futures contract, the bot has entered into an obligation to buy the NIFTY 50 index at a pre-agreed price on a future expiry date. In practice, on the NSE, these are cash-settled, meaning the profit or loss from the price difference is exchanged, not the actual stocks.
- By buying a Call Option, the bot has acquired the right, but not the obligation, to buy the NIFTY 50 index at 23,600 on or before the option's expiry date. It would only exercise this right if the NIFTY 50 moves above 23,600, making the trade profitable.
Practical Implications for Your Broker Account
This distinction between segments isn't just theoretical. It has a direct, practical impact on how you set up your trading account. Your chosen broker, Angel One, requires you to explicitly activate the derivatives segment, often referred to as "F&O" (Futures and Options).

This separation is by design. Trading derivatives involves leverage and more complex risk profiles, so brokers and regulators ensure that traders consciously opt-in. For your bot, this means that before you can even think about placing a derivative trade, you need to ensure the F&O segment is enabled programmatically and via your account settings.
Conclusion
In this lesson, we've established the foundational structure of the NSE's trading markets.
Key Takeaways:
- The NSE is primarily divided into the Equity (Cash) Segment and the Equity Derivatives Segment.
- Equity trading involves buying and selling actual shares, conferring direct ownership. It's simpler, with no expiry dates.
- Derivatives trading involves contracts (Futures and Options) whose value is based on an underlying asset.
- Futures are an obligation to transact in the future.
- Options provide the right, but not the obligation, to do so.
- From an engineering standpoint, these segments require different bot architectures, state management logic, and risk controls. The choice of segment is a fundamental design decision.
Preview of the Next Lesson:
Now that you understand the two main arenas, we'll zoom in on the Equity segment. In the next lesson, we will explore the different ways a trade can be settled: "Explain the difference between delivery, intraday, and margin trading." This will clarify how you can hold positions and what obligations you have at the end of the trading day.