STRATEGY GUIDE · 7 MIN READ

Stop loss and trailing stop loss in automated trading: SL, SL-M, GTT and trailing stops in India

TopTradingBots editorial team · Published 20 Nov 2026 · Updated 20 Nov 2026 · Editorial policy

SHORT ANSWER

A stop loss is an order that exits a trade once price reaches the level you chose. On Indian exchanges you use an SL order (trigger plus limit price) or, where still allowed, an SL-M order (trigger only, executed at market). NSE has discontinued SL-M for options and BSE for all its segments. A trailing stop loss moves the trigger as price moves in your favour. Neither guarantees your exit price.

What a stop loss does in an automated strategy

A stop loss is an exit decided in advance. Zerodha’s help page on stoploss orders describes it as “a buy/sell order that automatically executes when the price reaches your predetermined risk level”. For a long position, the stop is a sell order below the market. For a short position, it is a buy order above the market.

In manual trading, a stop loss protects you from hesitation. In algo trading it does something more basic: it is often the only part of the strategy that limits the loss when the code, the data feed or your internet connection fails. A strategy that exits only when its own logic fires depends on that logic running. A stop order resting with the broker or exchange does not.

This page explains the order types available to Indian traders, where each one can fail, and how trailing stops work on broker APIs and crypto bots. It describes tools, not settings to copy. It is not investment advice.

SL and SL-M orders on Indian exchanges

Indian brokers offer two kinds of stop order. Zerodha’s help page sums them up as “SL order (Stoploss Limit) = Price + Trigger price” and “SL-M order (Stoploss Market) = Only trigger price”.

SL (stop loss limit) SL-M (stop loss market)
What you enter Trigger price and limit price Trigger price only
Sent to the exchange when triggered as A limit order at your price A market order
Main risk May stay unfilled if price jumps past your limit Fills at whatever price is available
Availability All segments Discontinued by NSE for options and by BSE in all segments

For a sell stop, Zerodha says the trigger price must be greater than or equal to the limit price. For a buy stop, the trigger must be less than or equal to the limit price.

Where SL-M no longer exists

Zerodha’s help page states that “NSE has discontinued the SL-M order type for options”. A separate Zerodha page says SL-M orders are blocked for all instruments on BSE, across equity, equity derivatives, currency derivatives and commodity derivatives, because the exchange has discontinued them. In both cases Zerodha suggests using an SL order instead, with the limit price set a little beyond the trigger.

For an options strategy this matters directly. You cannot assume a market exit. Your algo has to choose a limit price for every stop, and decide what to do if that stop does not fill.

Example: a long stop with an SL order

This is an example with round numbers, not a recommendation. You buy 100 shares at ₹100, a position of ₹10,000. You decide to exit if price falls to ₹95, so you place a sell SL order with a trigger of ₹95 and a limit of ₹94.90. Zerodha’s help page uses the same figures.

  • If price trades down through ₹95 in small steps, the order triggers and fills near ₹94.90 to ₹95. Your loss is about ₹500 plus charges.
  • If the stock opens at ₹90 after bad news, the order triggers, but ₹94.90 is now above the market. The sell limit stays open and the position is still running. Zerodha warns that in this case “your stoploss order remains open” and that this “could result in higher losses than anticipated”.

The second case is why an algo needs a rule for unfilled stops, such as re-pricing the order or exiting at a protected market price.

What broker APIs offer

If your algo trades through a broker API, the order types are the broker’s. Zerodha’s Kite Connect orders documentation lists four order types: MARKET, LIMIT, SL and SL-M. The trigger_price field is “the price at which an order should be triggered” for SL and SL-M orders. The same page describes a market_protection setting that converts market and SL-M orders into limit orders within a chosen band. It notes that execution remains subject to the exchange’s price ranges.

Retail algos on broker APIs also fall under SEBI’s retail algo framework. Our guide to SEBI’s algo trading rules explains what that means for your API key and for algos that send many orders per second.

GTT orders for positional trades

For holdings you keep for weeks or months, Indian brokers offer Good Till Triggered (GTT) orders. Zerodha’s GTT help page says a GTT “stays active for up to 365 days”.

  • Single trigger: when the last traded price reaches or crosses your trigger, Zerodha places “a limit order or market order with market protection” on the exchange.
  • OCO (one cancels the other): you set a stop loss trigger and a target trigger together. When one activates, “the other trigger is cancelled automatically”.

A GTT is a trigger held by the broker, not an order resting on the exchange. Zerodha notes that if the order triggers but does not execute, you must place a fresh GTT. Your algo should check for that.

Trailing stop loss: how it works

A trailing stop loss moves the stop as price moves in your favour and never moves it back. For a long position, the stop sits a set distance below the highest price since entry. When price falls back by that distance from the peak, the stop triggers.

Kraken’s help page on trailing stop orders gives a worked example. A long position of 1 BTC is opened at $20,000 with a 5% trailing sell stop.

Price path Highest price reached Stop triggers at
Price never rises $20,000 $19,000
Price rises to $22,000, then falls $22,000 $20,900

With a fixed $1,000 distance instead of 5%, Kraken says the stop in the second case triggers at $21,000. When triggered, Kraken submits a market order. So the trailing stop decides when you exit, but the exit price is whatever the market offers at that moment.

Trailing stops on Indian broker APIs

The Kite Connect order documentation does not mention a trailing stop order type. On such an API, a trailing stop is something your algo does, not something the broker holds:

  1. Place an SL order below the entry.
  2. Track the highest price since entry.
  3. When the high rises, modify the SL order’s trigger and limit upward.
  4. Never move them down.

Each modification is an order message, and it depends on your algo running. If the algo stops, the last SL order stays where it was. Check your broker’s limits on order modifications, and remember that SEBI’s framework treats algos above a set orders-per-second threshold differently.

Trailing stops in crypto bots

Crypto exchanges and bot platforms often offer trailing stops as a native order or bot setting. A DCA bot may use a trailing take profit that lets a winning deal run before closing it. A grid bot usually has a separate stop loss below the grid range. Read the bot’s documentation for one point: does the trailing stop rest on the exchange, or is it run by the bot’s servers? If it is run by the bot, it fails when the bot or its API connection fails.

On futures bots there is a second exit you do not control. With leverage, the exchange can liquidate a position before your stop is reached if the stop sits beyond the liquidation price. Our grid trading bots ranking compares the platforms; check each bot’s stop settings in its own documentation.

How tight should the stop be?

There is no correct distance, and any figure presented as one is a guess. The trade-offs are:

  • Too tight: normal price noise triggers the stop, and costs on each exit add up. In thinly traded options, a wide gap between bid and ask makes this worse.
  • Too wide: the stop rarely fires, but when it does the loss is large, and a trailing stop gives back more of the move.
  • Gaps: overnight news, results and expiry days can move price past any stop. An SL limit order may not fill. A market-type exit fills at a worse price.

A practical approach is to measure how far the instrument normally moves on the timeframe you trade, test several stop distances in a backtest that includes realistic costs, and size the position so that a gap through the stop is a loss you can carry. Our options trading bots ranking and our guide to algo trading software in India cover the tools that can run these tests.

Checklist before you automate a stop

  1. Order type. Is SL-M allowed for this instrument on this exchange, or do you need an SL order with a limit?
  2. Unfilled stops. What does your algo do if an SL order triggers but does not fill?
  3. Where the stop lives. Is it an order on the exchange, a broker trigger such as a GTT, or logic inside your algo or bot?
  4. Failure mode. If the algo, data feed or connection stops, which stop is still protecting the position?
  5. Leverage. On futures, is the stop well inside the liquidation price?
  6. Records. Does your log show every stop placed, modified, triggered and filled?

A stop loss limits how a strategy loses money. It does not make the strategy profitable.

FAQ

What is the difference between an SL and an SL-M order?

Zerodha's help page puts it simply: an SL order has a price and a trigger price, an SL-M order has only a trigger price. When triggered, the SL order goes to the exchange as a limit order and the SL-M order as a market order. The SL order can stay unfilled if price gaps past your limit.

Why can't I place an SL-M order in options?

Zerodha says NSE has discontinued the SL-M order type for options, and that BSE has discontinued SL-M orders in all its segments. Use an SL order with a limit price a little beyond the trigger instead, and accept that it may not fill in a fast move.

Does a broker API support trailing stop loss orders?

Zerodha's Kite Connect order documentation lists MARKET, LIMIT, SL and SL-M order types and does not mention a trailing stop order. An algo that trails a stop on such an API has to modify the SL order's trigger itself as price moves.

Does a stop loss guarantee my maximum loss?

No. A stop loss limit order can remain open if price jumps through your limit, and Zerodha warns this could result in higher losses than anticipated. A market-type stop exits, but at whatever price is available. Size positions so that a bad fill is survivable.

Sources

Not financial advice. Trading bots do not remove market risk.