Modify GTT return exception while modifying GTT more than Once

vishalgyadav
Hi, I am trying to modify a GTT multiple times, It work for the first time, but does not work after the first modification

Trading Symbol : BANKNIFTY25SEP53800CE
Placing Order : {product=MIS, quantity=35, trigger_price=965.0, price=970.0, tradingsymbol=BANKNIFTY25SEP53800CE, exchange=NFO, validity=DAY, transaction_type=BUY, gtt_params=[[1,-5],[1,5]], order_type=SL, disclosed_quantity=0, market_protection=0.0}
Order Update: 250908100492210 Status: TRIGGER PENDING
Order Response : {"data":{"order_id":"250908100492210"},"status":"success"}
Trading Symbol : NIFTY2590924800CE
Placing Order : {product=MIS, quantity=75, trigger_price=78.0, price=80.0, tradingsymbol=NIFTY2590924800CE, exchange=NFO, validity=DAY, transaction_type=BUY, gtt_params=[[1,-5],[1,5]], order_type=SL, disclosed_quantity=0, market_protection=0.0}
Order Update: 250908100492498 Status: TRIGGER PENDING
Order Response : {"data":{"order_id":"250908100492498"},"status":"success"}
Order Update: 250908100492210 Status: OPEN
Order Update: 250908100492210 Status: COMPLETE
formattedExpiry: 25SEP
fullTradingSymbol: BANKNIFTY25SEP53800CE
token: com.zerodhatech.models.Instrument@3979558c
Placing GTT : {condition={"instrument_token":13984514,"tradingsymbol":"BANKNIFTY25SEP53800CE","trigger_values":[921,1019],"exchange":"NFO","last_price":966}, orders=[{"product":"MIS","quantity":35,"price":921,"tradingsymbol":"BANKNIFTY25SEP53800CE","exchange":"NFO","transaction_type":"SELL","order_type":"LIMIT"},{"product":"MIS","quantity":35,"price":1019,"tradingsymbol":"BANKNIFTY25SEP53800CE","exchange":"NFO","transaction_type":"SELL","order_type":"LIMIT"}], type=two-leg}
tokenList: [13984514]
gtt id: 286598420
GTT Placed: null

Order Update: 250908100492498 Status: OPEN
Order Update: 250908100492498 Status: COMPLETE
formattedExpiry: 25909
fullTradingSymbol: NIFTY2590924800CE
token: com.zerodhatech.models.Instrument@170cc9e
Placing GTT : {condition={"instrument_token":10388738,"tradingsymbol":"NIFTY2590924800CE","trigger_values":[70,90],"exchange":"NFO","last_price":78.15}, orders=[{"product":"MIS","quantity":75,"price":70,"tradingsymbol":"NIFTY2590924800CE","exchange":"NFO","transaction_type":"SELL","order_type":"LIMIT"},{"product":"MIS","quantity":75,"price":90,"tradingsymbol":"NIFTY2590924800CE","exchange":"NFO","transaction_type":"SELL","order_type":"LIMIT"}], type=two-leg}
tokenList: [10388738, 13984514]
gtt id: 286599291
GTT Placed: null

Inside percentage based trail
newStop Loss: 970.0 newTarget: 1030.0
Modify GTT Request : {condition={"instrument_token":13984514,"tradingsymbol":"BANKNIFTY25SEP53800CE","trigger_values":[970,1030],"exchange":"NFO","last_price":985.4}, orders=[{"product":"MIS","quantity":35,"price":970,"tradingsymbol":"BANKNIFTY25SEP53800CE","exchange":"NFO","transaction_type":"SELL","order_type":"SL"},{"product":"MIS","quantity":35,"price":1030,"tradingsymbol":"BANKNIFTY25SEP53800CE","exchange":"NFO","transaction_type":"SELL","order_type":"LIMIT"}], type=two-leg}
Modify GTT Response : {"data":{"trigger_id":286598420},"status":"success"}
Time : 11:14:11 After Modify GTT Stop Loss: 970.0 Target Price: 1030.0
gtt id: 286598420

Inside percentage based trail
newStop Loss: 80.0 newTarget: 91.0
Modify GTT Request : {condition={"instrument_token":10388738,"tradingsymbol":"NIFTY2590924800CE","trigger_values":[80,91],"exchange":"NFO","last_price":82.8}, orders=[{"product":"MIS","quantity":75,"price":80,"tradingsymbol":"NIFTY2590924800CE","exchange":"NFO","transaction_type":"SELL","order_type":"SL"},{"product":"MIS","quantity":75,"price":91,"tradingsymbol":"NIFTY2590924800CE","exchange":"NFO","transaction_type":"SELL","order_type":"LIMIT"}], type=two-leg}
Modify GTT Response : {"data":{"trigger_id":286599291},"status":"success"}
Time : 11:15:17 After Modify GTT Stop Loss: 80.0 Target Price: 91.0
gtt id: 286599291

GTT ID: 286599291 Status: triggered

Inside Fixed based trail
Modify GTT Request : {condition={"instrument_token":13984514,"tradingsymbol":"BANKNIFTY25SEP53800CE","trigger_values":[1025,1035],"exchange":"NFO","last_price":1027.25}, orders=[{"product":"MIS","quantity":35,"price":1025,"tradingsymbol":"BANKNIFTY25SEP53800CE","exchange":"NFO","transaction_type":"SELL","order_type":"SL"},{"product":"MIS","quantity":35,"price":1035,"tradingsymbol":"BANKNIFTY25SEP53800CE","exchange":"NFO","transaction_type":"SELL","order_type":"LIMIT"}], type=two-leg}
Modify Kite Exception GTT Request : {condition={"instrument_token":13984514,"tradingsymbol":"BANKNIFTY25SEP53800CE","trigger_values":[1025,1035],"exchange":"NFO","last_price":1027.25}, orders=[{"product":"MIS","quantity":35,"price":1025,"tradingsymbol":"BANKNIFTY25SEP53800CE","exchange":"NFO","transaction_type":"SELL","order_type":"SL"},{"product":"MIS","quantity":35,"price":1035,"tradingsymbol":"BANKNIFTY25SEP53800CE","exchange":"NFO","transaction_type":"SELL","order_type":"LIMIT"}], type=two-leg}
Error in Kite Exception modifying GTT order: null retrying

Inside Fixed based trail
Modify GTT Request : {condition={"instrument_token":13984514,"tradingsymbol":"BANKNIFTY25SEP53800CE","trigger_values":[1030,1040],"exchange":"NFO","last_price":1032.2}, orders=[{"product":"MIS","quantity":35,"price":1030,"tradingsymbol":"BANKNIFTY25SEP53800CE","exchange":"NFO","transaction_type":"SELL","order_type":"SL"},{"product":"MIS","quantity":35,"price":1040,"tradingsymbol":"BANKNIFTY25SEP53800CE","exchange":"NFO","transaction_type":"SELL","order_type":"LIMIT"}], type=two-leg}
Modify Kite Exception GTT Request : {condition={"instrument_token":13984514,"tradingsymbol":"BANKNIFTY25SEP53800CE","trigger_values":[1030,1040],"exchange":"NFO","last_price":1032.2}, orders=[{"product":"MIS","quantity":35,"price":1030,"tradingsymbol":"BANKNIFTY25SEP53800CE","exchange":"NFO","transaction_type":"SELL","order_type":"SL"},{"product":"MIS","quantity":35,"price":1040,"tradingsymbol":"BANKNIFTY25SEP53800CE","exchange":"NFO","transaction_type":"SELL","order_type":"LIMIT"}], type=two-leg}
Error in Kite Exception modifying GTT order: null retrying

GTT already placed. Skipping.
GTT ID: 286598420 Status: triggered
Order Update: 250908100606803 Status: COMPLETE

  • Nivas
    You need to either enable debug logs for javakiteconnect or print the KiteException message and check the reason.
  • vishalgyadav
    vishalgyadav edited September 11
    Modify GTT Request : {condition={"instrument_token":13986050,"tradingsymbol":"BANKNIFTY25SEP54200CE","trigger_values":[925,977],"exchange":"NFO","last_price":923.25}, orders=[{"product":"MIS","quantity":35,"price":925,"tradingsymbol":"BANKNIFTY25SEP54200CE","exchange":"NFO","transaction_type":"SELL","order_type":"SL"},{"product":"MIS","quantity":35,"price":977,"tradingsymbol":"BANKNIFTY25SEP54200CE","exchange":"NFO","transaction_type":"SELL","order_type":"LIMIT"}], type=two-leg}
    2025-09-11 12:13:27 DEBUG [ReadingThread] okhttp3.internal.http2.Http2 - >> 0x000001b9 32 HEADERS END_HEADERS
    2025-09-11 12:13:27 DEBUG [ReadingThread] okhttp3.internal.http2.Http2 - >> 0x000001b9 676 DATA END_STREAM
    2025-09-11 12:13:27 DEBUG [OkHttp api.kite.trade] okhttp3.internal.http2.Http2 - Modify Kite Exception GTT Request : {condition={"instrument_token":13986050,"tradingsymbol":"BANKNIFTY25SEP54200CE","trigger_values":[925,977],"exchange":"NFO","last_price":923.25}, orders=[{"product":"MIS","quantity":35,"price":925,"tradingsymbol":"BANKNIFTY25SEP54200CE","exchange":"NFO","transaction_type":"SELL","order_type":"SL"},{"product":"MIS","quantity":35,"price":977,"tradingsymbol":"BANKNIFTY25SEP54200CE","exchange":"NFO","transaction_type":"SELL","order_type":"LIMIT"}], type=two-leg}
    Error in Kite Exception modifying GTT order: null retrying
    2025-09-11 12:13:27 DEBUG [ReadingThread] okhttp3.internal.http2.Http2 - >> 0x000001bb 32 HEADERS END_HEADERS
    2025-09-11 12:13:27 DEBUG [ReadingThread] okhttp3.internal.http2.Http2 - >> 0x000001bb 676 DATA END_STREAM
    2025-09-11 12:13:27 DEBUG [OkHttp api.kite.trade] okhttp3.internal.http2.Http2 - << 0x000001bb 136 HEADERS END_HEADERS
    2025-09-11 12:13:27 DEBUG [OkHttp api.kite.trade] okhttp3.internal.http2.Http2 - << 0x000001bb 158 DATA
    2025-09-11 12:13:27 DEBUG [OkHttp api.kite.trade] okhttp3.internal.http2.Http2 - << 0x000001bb 0 DATA END_STREAM
    2025-09-11 12:13:27 DEBUG [ReadingThread] o.internal.concurrent.TaskRunner - Q10002 scheduled after 0 µs: OkHttp ConnectionPool
    2025-09-11 12:13:27 DEBUG [OkHttp TaskRunner] o.internal.concurrent.TaskRunner - Q10002 starting : OkHttp ConnectionPool
    2025-09-11 12:13:27 DEBUG [OkHttp ConnectionPool] o.internal.concurrent.TaskRunner - Q10002 run again after 300 s : OkHttp ConnectionPool
    2025-09-11 12:13:27 DEBUG [OkHttp TaskRunner] o.internal.concurrent.TaskRunner - Q10002 finished run in 58 µs: OkHttp ConnectionPool
    2025-09-11 12:13:28 DEBUG [ReadingThread] okhttp3.internal.http2.Http2 - >> 0x000000e7 26 HEADERS END_STREAM|END_HEADERS
    2025-09-11 12:13:28 DEBUG [OkHttp api.kite.trade] okhttp3.internal.http2.Http2 -
  • sujith
    You don't need to modify code. You can just enable debug logs as shown in this sample code.
  • vishalgyadav
    This is blocking my next set of execution
  • Nivas
    The input exception represents missing required fields, bad values for parameters, etc. You may refer to the documentation, sample code, and make the API request with the correct parameters.

    To resolve the issue, you might consider enabling debug logs for JavaKiteConnect or printing the KiteException message to understand the reason behind it.
  • vishalgyadav
    Hi, can you please help with this, as it has stopped my testing, and my subscription is about to end
  • Nivas
    Kite Connect is an execution platform. I am afraid we can't provide support for writing code. However, you might consider enabling debug logs for JavaKiteConnect or printing the KiteException message to understand the reason behind it.

    Please note that the input exception represents missing required fields, bad values for parameters, etc. You may refer to the documentation, sample code, and make the API request with the correct parameters.
Sign In or Register to comment.