Exiting CNC order

zuser
How to exit CNC order via kiteConnect?
While using cancel_order or exit_order, I am getting the following error.

kiteconnect.exceptions.GeneralException: Route not found

I want to exit a stock(CNC) purchased on the same day.
  • sujith
    You can refer to this thread.
  • zuser
    That thread doesn't answer my question on how to exit a "CNC" order the same day! As mentioned cancel_order or exit_order apis are throwing the exception.
  • zuser
    kite.exit_order("cnc",191030001642988)

    The output is as below:
    DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.kite.trade
    DEBUG:urllib3.connectionpool:https://api.kite.trade:443 "POST /session/token HTTP/1.1" 200 None
    DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.kite.trade
    DEBUG:urllib3.connectionpool:https://api.kite.trade:443 "DELETE /orders/cnc/191030001642988?order_id=191030001642988&variety=cnc HTTP/1.1" 404 None
    Traceback (most recent call last):
    File "kite_utils.py", line 24, in
    kite.exit_order("cnc",191030001642988)
    File "build/bdist.macosx-10.6-x86_64/egg/kiteconnect/connect.py", line 358, in exit_order
    File "build/bdist.macosx-10.6-x86_64/egg/kiteconnect/connect.py", line 353, in cancel_order
    File "build/bdist.macosx-10.6-x86_64/egg/kiteconnect/connect.py", line 709, in _delete
    File "build/bdist.macosx-10.6-x86_64/egg/kiteconnect/connect.py", line 766, in _request
    kiteconnect.exceptions.GeneralException: Route not found
  • zuser
    zuser edited October 2019
    module 'kiteconnect.__version__' from '/anaconda2/lib/python2.7/site-packages/kiteconnect-3.7.3-py2.7.egg/kiteconnect/__version__.pyc'
  • rakeshr
    rakeshr edited October 2019
    @zuser
    Exit_order is used for exiting BO and CO orders. For exiting regular order, you need to place a fresh SELL order using place_order, with transaction_type as SELL and other param as required.
Sign In or Register to comment.