It looks like you're new here. If you want to get involved, click one of these buttons!
2022-08-08 09:17:11 bn917 [ENTRY 220808100101248::OPEN] PE NOT complete, sent MARKET order
2022-08-08 09:17:11 modifyOrder_strat fnc error: Order cannot be modified as it is being processed. Try later.
2022-08-08 09:17:16 bn917 [ENTRY 220808100101248::OPEN] PE NOT complete, sent MARKET order
2022-08-08 09:17:16 modifyOrder_strat fnc error: Order cannot be modified as it is being processed. Try later.
2022-08-08 09:17:22 bn917 [ENTRY 220808100101248::OPEN] PE NOT complete, sent MARKET order
2022-08-08 09:17:22 modifyOrder_strat fnc error: Order cannot be modified as it is being processed. Try later.
I had to manually modify it in kite-web to market order for the order to be placed. As you can see below, no action was received at your end. But I did send the mod order and got a response.
If you get 200 for order modify request then it means the modification request is placed at the OMS successfully. It doesn't mean order is modified. Once modify request is placed, there are series of checks that an order goes through and then only gets modified if everything is alright.
You will have to fetch orderbook and check the
status_message
field to know the reason if order is not modified.I capture the order status through the websocket onOrder function. In my above log, the status message 'OPEN' is the latest status message at the time. Looking at the log of the status message; It is a mirror of the action on kite-web order history.
after 10 secs of order placement (09:17:01), i sent auto order mod request (at, 09:17:11, 09:17:16, 09:17:22, 5 seconds apart) and did get valid response, but per your order system there was no modification request.
This has never happened before, so
Did you get 200 response for modify request you sent or did you get non-200 response?
thanks!
Sujith Sir asked if the response for your modify order request was 200 or non-200.
200 means the request was successfully placed with the OMS. In this the data field in the response is order_id.
https://kite.trade/docs/connect/v3/orders/#modifying-orders
Anything other than 200 means an exception.
In this,the data field in the response is the exception message.
You got error code 400 ,i.e InputException.
And the message was , 'Order can't be processed...'
You can read about KiteConnect exceptions here:
https://kite.trade/docs/connect/v3/exceptions/
https://github.com/zerodha/phpkiteconnect/blob/c5eaa092dbc7898c5894d0438d1c7ac24fa1102e/src/KiteConnect.php#L230
You can also get the error code directly from the exception.
Although,I know how to do it in python,but not in php.
I can just tell that there should be a 'code' attribute in the exception thrown by php client.
Read here about which code indicates which exception:
https://github.com/zerodha/phpkiteconnect/tree/master/src/Exception
Still,I can't understand one thing, @rakeshr Sir,
why is the code for InputException 500 in the php client??
https://github.com/zerodha/phpkiteconnect/blob/c5eaa092dbc7898c5894d0438d1c7ac24fa1102e/src/Exception/InputException.php#L18
As far as I understood from the documentation,400 should be the error code for InputException
https://kite.trade/docs/connect/v3/exceptions/#common-http-error-codes
and the same is shown in the python client:
https://github.com/zerodha/pykiteconnect/blob/e6fe14dd403d0af4ee56ce8aa862bbf7352e3795/kiteconnect/exceptions.py#L59
Thanks!!
In python, kiteconnect is installed via pip. if I wanted to do the same thing in python, ie, pipe the error messages to a file, how would i do it?
Thanks.
https://docs.python.org/3/howto/logging.html#logging-to-a-file
Your order_id is ...409 ,as can be seen in your log.
But,you are sending modify order request for order_id ...255,which must have been already executed .