PUTrequest to /gtt/triggers/ fails occasionally

Occasionally, is the keyword here.. that implies that all the parameters are correct, but the request still fails, if I stop the script and run again.. I still see the same behavior.

Here is an example:

DEBUG:urllib3.connectionpool:https://api.kite.trade:443 "PUT /gtt/triggers/88393840 HTTP/1.1" 400 93
Trigger already met.
At this point trigger was @ 186 and I was trying to change it to @ 178. At this time LTP was 136.6

Can you please explain further about this error?
  • sujith
    It means the condition you are trying to modify is already been met. Are you sending correct LTP while modify GTT?
  • pranavwagh
    Yes, I'm using the LTP from the the existing gtt .. something like .. last_price=gtt["condition"]["last_price"]. Which is absolutely correct (like I gave above).
    Also, since I also tried to run the code post market, you can even see that LTP is correct right now, it's the LTP of "NIFTY 3rd w MAR 16700 CE"
    SRIJAN edited February 2022
    The last_price in gtt is the last_price at the time of order placement,not realtime. You have to send current ltp. Try with the actual ltp.
  • pranavwagh
    pranavwagh edited February 2022
    I've just tested your suggestion, and it seems to work fine. Thanks! You guys are awesome! I have one more question, but I'll ask that in appropriate discussion thread..
This discussion has been closed.