APIs are broken ... Unable to place any orders. Error sounds ambiguous. Order id is generated and returned and certainly not passed. So order id passing mechanism changed or something basic changed around naming convention of order id.
This was working perfectly till Friday ... and nothing changed from my side. Not a one time exception and is happening for every order placed via python client.
Hmm ... @vinodhec - you discovered it really early ... I checked with CANCEL order by first placing a order via KiteWeb and then CANCEL via Python Client. This also returns existing order_id on successful CANCEL but it seems to be working fine. So only placing new order seems to be the issue.
yes , cancelling orders works fine .... issue only with punching orders .... can anyone at zerodha please confirm that atleast they are looking at the issue .
File "C:\Users\iconic\Anaconda3\lib\site-packages\kiteconnect-3.7.4-py3.6.egg\kiteconnect\connect.py", line 326, in place_order return self._post("order.place", params)["order_id"]
File "C:\Users\iconic\Anaconda3\lib\site-packages\kiteconnect-3.7.4-py3.6.egg\kiteconnect\connect.py", line 701, in _post return self._request(route, "POST", params)
File "C:\Users\iconic\Anaconda3\lib\site-packages\kiteconnect-3.7.4-py3.6.egg\kiteconnect\connect.py", line 766, in _request raise exp(data["message"], code=r.status_code)
It was always the lower case, we have mentioned it in the documentation. Ideally, you should be using enums like this.
It was working till last week because we were using Nginx till last week and we moved to HAProxy. In Nginx, it modifies the URL to lower case by default. The behavior is different on HAProxy.
Can you please share the order payload?
try:
order_id = kite.place_order(exchange=exchange,
variety=variety,
tradingsymbol=tradingsymbol,
transaction_type=transaction_type,
quantity=quantity,
price=price,
product=product,
order_type=order_type)
print(bcolors.OKGR + "ORDER PLACED. ORDER: %s" % (order_id) + bcolors.ENDC)
except Exception as e:
print(bcolors.FAIL + "ORDER FAILED. ERROR: %s" % (e.message) + bcolors.ENDC)
Can you please share the exact params you are passing?
File "", line 12, in
trailing_stoploss=2)
File "C:\Users\iconic\Anaconda3\lib\site-packages\kiteconnect-3.7.4-py3.6.egg\kiteconnect\connect.py", line 326, in place_order
return self._post("order.place", params)["order_id"]
File "C:\Users\iconic\Anaconda3\lib\site-packages\kiteconnect-3.7.4-py3.6.egg\kiteconnect\connect.py", line 701, in _post
return self._request(route, "POST", params)
File "C:\Users\iconic\Anaconda3\lib\site-packages\kiteconnect-3.7.4-py3.6.egg\kiteconnect\connect.py", line 766, in _request
raise exp(data["message"], code=r.status_code)
InputException: Invalid `order_id`.
Can you run in debug mode and paste the whole stack trace here?
variety='REGULAR',
tradingsymbol='INDUSINDBK19JAN1620CE',
transaction_type='SELL',
quantity='300',
price='4.65',
product='MIS',
order_type='LIMIT')
$ python --version
Python 2.7.9
It was working till last week because we were using Nginx till last week and we moved to HAProxy.
In Nginx, it modifies the URL to lower case by default. The behavior is different on HAProxy.