Kite Connect API: SELL OCO GTT rejected with "Invalid trigger data" when using MARKET stop-loss

rajatShah56
Hello Zerodha Team,

We are creating GTTs through the Kite Connect API using Python (`pykiteconnect` 5.x).

Our BUY single-leg GTTs are being created successfully. However, all seven SELL two-leg (OCO) GTT requests were rejected with:

`InputException: Invalid trigger data`

This occurred on 18 November 2026 at approximately 16:55 IST.

Example request for DHANUKA (NSE):

**GTT type:** two-leg

**Trigger values:**
- Stop-loss trigger: 828.45
- Target trigger: 969.85

**Orders:**

1. SELL, quantity 9, CNC, MARKET, price 828.45 (stop-loss)
2. SELL, quantity 9, CNC, LIMIT, price 969.85 (target)

The exact `last_price` submitted was not captured in our logs.

At the time of creation, the shares were not yet in holdings because their BUY GTTs had not triggered.

Could you please clarify:

1. Does Kite Connect API support MARKET orders in two-leg OCO GTTs?
2. Does the API support `market_protection` for GTT orders? If yes, what is the correct request field and accepted value?
3. Must the shares already be present in holdings before creating a SELL OCO GTT?
4. What are the possible causes of `Invalid trigger data` in this situation?
5. Is there any minimum required distance between `last_price` and the two trigger values?

The Kite web interface appears to support Market with Market Price Protection for GTTs. We would like to understand whether the same functionality is available through the API.

Thank you.
  • nagavenij
    We are getting this checked.
  • nagavenij

    1. The error occurred because a MARKET order was being used without Market Price Protection (MPP). As per the new Algo requirement, MARKET orders placed through the Kite Connect API must have market protection enabled.
    2. Yes, Market Orders with Market Price Protection are supported for GTT orders.
    3. Yes, since you are placing a CNC SELL GTT, the required shares must be available in your holdings for the GTT to be successfully triggered.
    4. The rejection is related to the MARKET order configuration. Please ensure that market protection is enabled when using MARKET orders.
    5. The trigger prices must satisfy the minimum price-difference requirements specified in the GTT Terms and Conditions.
  • rajatShah56
    Thanks for confirming that MARKET orders with MPP are supported for GTTs. After your reply, we updated our code to put "market_protection": -1 inside the MARKET stop-leg object in the orders array sent to POST /gtt/triggers. The SELL two-leg request for NSE SWSOLAR on 25 November 2026 at about 16:09 IST still returned InputException: Invalid trigger data.

    Based on the code used for that run, the intended stop leg was SELL, CNC, quantity 65, order_type: "MARKET", price: 142.15, and market_protection: -1. The target leg was SELL, CNC, quantity 65, order_type: "LIMIT", and price: 171.00. The stop and target triggers were 142.15 and 171.00. The exact body and submitted last_price were not captured.

    Could you share a working example request body for a two-leg CNC SELL GTT with a MARKET stop and a LIMIT target? Please confirm whether market_protection: -1 is accepted inside the MARKET leg and whether that leg’s price should be omitted, set to 0, or set to the stop trigger. Also, are sufficient holdings checked at GTT creation or only when it triggers?
  • rajatShah56
    Hi Zerodha team, following up with the exact details from a live request on 27 November 2026 at 16:37 IST. We sent a two-leg CNC SELL GTT for 1 share of NSE:SWSOLAR to POST /gtt/triggers.
    - last_price: 167.53
    - trigger_values: [142.15, 171.0]
    - Stop leg: MARKET, price: 0.0, market_protection: -1
    - Target leg: LIMIT, price: 171.0
    The API returned HTTP 400, InputException: Invalid trigger data., with data: null.

    Could you confirm which validation failed and share a working two-leg SELL GTT request with a MARKET stop and a LIMIT target? Please also clarify whether shares are required in holdings when the GTT is created or when it triggers. Our use case is to create the SELL GTT before the BUY order fills.
Sign In or Register to comment.