I have 10 stocks in my holding and now I am placing a limit order to sell 1 stock. after this I am continuously monitoring this order with his order id. Now some condition happens and I want to modify the existing sell order. below is the code I am calling when ever I want to modify my order. For this function I am passing price, quantity and order id.
When ever I invoke this function I am getting below error. Please let me know if any one come across this kind of issue.
DEBUG:urllib3.connectionpool:https://api.kite.trade:443 "PUT /orders/VARIETY_REGULAR/201111202205904 HTTP/1.1" 404 None Traceback (most recent call last): File "C:/Algo_project/MultiThread.py", line 319, in Sell_OrderRecords[1] = modify_ordr(price, Sell_OrderRecords[0], 1) File "C:/Algo_project/MultiThread.py", line 202, in modify_ordr price=price) File "C:\Users\Avinash\AppData\Local\Programs\Python\Python36\lib\site-packages\kiteconnect\connect.py", line 366, in modify_order return self._put("order.modify", params)["order_id"] File "C:\Users\Avinash\AppData\Local\Programs\Python\Python36\lib\site-packages\kiteconnect\connect.py", line 825, in _put return self._request(route, "PUT", params) File "C:\Users\Avinash\AppData\Local\Programs\Python\Python36\lib\site-packages\kiteconnect\connect.py", line 886, in _request raise exp(data["message"], code=r.status_code) kiteconnect.exceptions.GeneralException: Route not found
I don't know why it cause this error for sure, it can't find the right route maybe because you're not providing all the information of your order, Incase if you have a trigger price you must include the trigger price also.
Are you sure you use this function in your script? because the above function is returning ordr_id parameter of your function instead of returning the order_id_r which returns the modified order's id
#######################
take a look at this you might get an idea This is my methods used for Limit buying and modifying my limit buying orders works fine for me
@AvinashKrishnappa, You seem to be sending a wrong variety value. You are sending a constant name as mentioned in the example, the value is lower case regular
I don't know why it cause this error for sure, it can't find the right route maybe because you're not providing all the information of your order, Incase if you have a trigger price you must include the trigger price also. Are you sure you use this function in your script?
because the above function is returning ordr_id parameter of your function
instead of returning the order_id_r which returns the modified order's id
#######################
take a look at this you might get an idea
This is my methods used for Limit buying and modifying my limit buying orders
works fine for me
Modifying an order via a python script is just like you're modifying your order manually on KITE web app
So take a close look at how you modify your order on KITE web app and do make it a function on your script that's it.
I hope this helps.
You seem to be sending a wrong variety value. You are sending a constant name as mentioned in the example, the value is lower case regular