General error while doing BO using python

Deva
Deva edited January 2018 in Python client
Hi Team,

I am getting this frustrating error while doing python BO.. I am feeling this is an error from your side.. please advice.

This is my order
# Place an order
try:
order_id = kite.order_place(tradingsymbol=entry["symbol"],
exchange="NSE",
transaction_type="BUY",
quantity=qty,
price=quote["last_price"],
stoploss_value=trigger,
squareoff_value=target,
trailing_stoploss=1,
order_type="LIMIT",
validity="DAY",
product="MIS",
variety="BO")
print("Order placed. ID is", order_id)
except Exception as e:
print("Order placement failed", e.message)
----------------- ERROR ----------------------
We are buying 16 qty of IDBI
Traceback (most recent call last):
File "main.py", line 71, in place_buy_order
variety="BO")
File "/usr/local/lib/python3.6/site-packages/kiteconnect/__init__.py", line 320, in order_place
return self._post("orders.place", params)["order_id"]
File "/usr/local/lib/python3.6/site-packages/kiteconnect/__init__.py", line 597, in _post
return self._request(route, "POST", params)
File "/usr/local/lib/python3.6/site-packages/kiteconnect/__init__.py", line 684, in _request
raise(exp(data["message"], code=r.status_code))
kiteconnect.exceptions.GeneralException: Route not found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "main.py", line 119, in
place_buy_order()
File "main.py", line 74, in place_buy_order
print("Order placement failed", e.message)
AttributeError: 'GeneralException' object has no attribute 'message'



Tagged:
  • Deva
    Please provide an early help as the API subscription is not of any use to me without getting this working in market hours.
  • tonystark
    Variety is "bo" (lower case) for bracket orders.
  • Deva
    thank you.. it is working now.. imho the documentation is all around the place.. especially for important items like these.. if they were collated in either the github or the api page it would be more awesome!!.. thanks for the help!!
  • tonystark
    We are working on it. We will be releasing the new APIs, documentation and client libraries in a week.
This discussion has been closed.