about cancelling amo order

profitbuddy
I placed amo order yesterday, today i cancel the order through " kite.cancel_order(variety="amo", order_id=order_id)" i checked order_id is correct but it give me error
" File "/Users/divyapatel/Documents/AAM/Personal Trading/Harish Sir/(29-12-2023) - Trading - YXP128 - 1.5 Crore/main_0930.py", line 93, in process_orders
kite.cancel_order(variety="amo", order_id=order_id) # change to amo
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/divyapatel/Documents/AAM/Personal Trading/Harish Sir/Gekko Trading Strategy - 750 - Hetal Madam/venv/lib/python3.11/site-packages/kiteconnect/connect.py", line 389, in cancel_order
return self._delete("order.cancel",
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/divyapatel/Documents/AAM/Personal Trading/Harish Sir/Gekko Trading Strategy - 750 - Hetal Madam/venv/lib/python3.11/site-packages/kiteconnect/connect.py", line 873, in _delete
return self._request(route, "DELETE", url_args=url_args, params=params, is_json=is_json)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/divyapatel/Documents/AAM/Personal Trading/Harish Sir/Gekko Trading Strategy - 750 - Hetal Madam/venv/lib/python3.11/site-packages/kiteconnect/connect.py", line 937, in _request
raise exp(data["message"], code=r.status_code)
kiteconnect.exceptions.NetworkException: request BXwQVjVdxrAaFo61OA6XTBnmRjarqyio timed out
"
after that i change variety = 'regular' then do the same then it executed and also in kite.order() gives one file that also mention variety = amo then how is this possible ?
  • sujith
    sujith edited January 10
    Once an order is sent to the exchange it becomes regular order. The fetch orders API will give you variety as amo because of a legacy issue on the OMS. But you will have to cancel with variety as regular.

    The logic we use on our front end apps is
    If an order is amo and you want to modify or cancel then make the order status to upper case and then check if it contains "AMO"(example: "status": "AMO REQUEST RECEIVED", "status": "MODIFY AMO REQUEST") if exists then it is still amo order or else it is a regular order.
This discussion has been closed.