I also got the same today 2024-02-26 09:18:00,285 - INFO - zerodha: Going to modify order with params newPrice=94.6, newTriggerPrice=94.5, newQty=0, newOrderType=None - 63 2024-02-26 09:18:00,396 - INFO - zerodha Order modify failed: Invalid `quantity`. - 81
No the quantity will be None. This code worked till Friday!! orderId = kite.modify_order( variety=kite.VARIETY_REGULAR, order_id=order.orderId, quantity=orderModifyParams.newQty if orderModifyParams.newQty > 0 else None, price=orderModifyParams.newPrice if orderModifyParams.newPrice > 0 else None, trigger_price=orderModifyParams.newTriggerPrice if orderModifyParams.newTriggerPrice > 0 else None, order_type=orderModifyParams.newOrderType if orderModifyParams.newOrderType != None else None)
1. Any change should be notified on your documentation page and GitHub, so that users can make that change. 2. Sending quantity will cause an issue if part quantity is executed for a limit order while modifying the order.
Exactly, I agree @prabhatmittal20 . Kite Team just makes the changes overnight without any announcement. It would be great, If you notify the users at least 24 hours before making the changes. 1 week would be better, but 24 hours is at least required!
Last time they changed the requests limit per IP without any notification and It caused a lot of problems for me.
Kite Team just makes the changes overnight without any announcement. It would be great, If you notify the users at least 24 hours before making the changes. 1 week would be better, but 24 hours is at least required!
You're right that we're expected to give prior notice for breaking changes to the API. However, this wasn't supposed to be a breaking change. The current issue with order modifications is an unforeseen bug. Outside of that, this wasn't supposed to be a breaking change and hence no prior notice.
@Matti change was breaking from user perspective . Though it it was not a expected change and rather a bug, that is understable. Though you might need to beef up your testing team capacity
Sent quantity and things were fine. But if i send the same orderType it throws the error. Sending the order type as none now. Hope SL LIMIT to MARKET order conversion works fine @sujith 2024-02-26 13:27:36,890 - INFO - zerodha Order modify failed: Invalid order_type. - 81 2024-02-26 13:27:36,890 - ERROR - TradeManager: Failed to update SL for tradeID cf09091a-8513-4559-a95e-8cd9a202cbe9 orderId 240226502256281: Error => Invalid order_type. - 702 2024-02-26 13:27:38,077 - INFO - zerodha: Going to modify order with params newPrice=50.9, newTriggerPrice=50.8, newQty=75, newOrderType=SL_LIMIT - 63 2024-02-26 13:27:38,090 - INFO - rb1 Min PNL -7
2024-02-26 13:46:45,212 - INFO - zerodha: Going to modify order to MARKET - 85 2024-02-26 13:46:45,308 - INFO - zerodha Order modify to market failed: Invalid quantity. - 100 2024-02-26 13:46:45,308 - ERROR - TradeManager: Modify SL Order to market failed for tradeID 4d3ced0d-37db-4e4d-b7dd-5a1048a67d9d: Error => Invalid quantity. - 756
@santhanakrishnan25 send quantity when modifying order whether to change SLL price or changing the order type. While changing SLL price, you can send the order type as NONE and while squaring off the position change order type to MARKET.
Sending the last two additional parameters fixed the error for me while modifying stop loss orders. The parameters are set to whatever the original SL had.
Any idea why u started validating the quantity parameter which was optional to modify_order? These kind of sudden change will have major impact on all algos, why can't you publish the breakable changes in advance?
I also faced the same issue, all my trailing SLs failed and I incurred losses due to U turns in the market. The same code worked perfectly till Friday with quantity being sent as None, but today it failed! Zerodha needs to notify each user for any such changes proactively, and take responsibility of our losses because of such issues!
@sujith@rakeshr@sodha_rakesh , Pl confirm if the issue is resolved or still it is there. Or inform What kind of changes made at your end so that We can modify our programs.
2024-02-26 09:18:00,285 - INFO - zerodha: Going to modify order with params newPrice=94.6, newTriggerPrice=94.5, newQty=0, newOrderType=None - 63
2024-02-26 09:18:00,396 - INFO - zerodha Order modify failed: Invalid `quantity`. - 81
orderId = kite.modify_order(
variety=kite.VARIETY_REGULAR,
order_id=order.orderId,
quantity=orderModifyParams.newQty if orderModifyParams.newQty > 0 else None,
price=orderModifyParams.newPrice if orderModifyParams.newPrice > 0 else None,
trigger_price=orderModifyParams.newTriggerPrice if orderModifyParams.newTriggerPrice > 0 else None,
order_type=orderModifyParams.newOrderType if orderModifyParams.newOrderType != None else None)
1. Any change should be notified on your documentation page and GitHub, so that users can make that change.
2. Sending quantity will cause an issue if part quantity is executed for a limit order while modifying the order.
Last time they changed the requests limit per IP without any notification and It caused a lot of problems for me.
Quantity was optional parameter for Modify Error and was accepting 'None' but getting the 'Invalid Quantity Error' since morning
This is absolutely unacceptable to change something without due communication.
2024-02-26 13:27:36,890 - INFO - zerodha Order modify failed: Invalid order_type. - 81
2024-02-26 13:27:36,890 - ERROR - TradeManager: Failed to update SL for tradeID cf09091a-8513-4559-a95e-8cd9a202cbe9 orderId 240226502256281: Error => Invalid order_type. - 702
2024-02-26 13:27:38,077 - INFO - zerodha: Going to modify order with params newPrice=50.9, newTriggerPrice=50.8, newQty=75, newOrderType=SL_LIMIT - 63
2024-02-26 13:27:38,090 - INFO - rb1 Min PNL -7
2024-02-26 13:46:45,308 - INFO - zerodha Order modify to market failed: Invalid quantity. - 100
2024-02-26 13:46:45,308 - ERROR - TradeManager: Modify SL Order to market failed for tradeID 4d3ced0d-37db-4e4d-b7dd-5a1048a67d9d: Error => Invalid quantity. - 756
Damn issues are here as well @sujith @rakeshr
return self.modify_order(order.variety, order.kite_order_id, trigger_price=trigger_price, quantity=order.quantity, order_type=order.order_type)
These kind of sudden change will have major impact on all algos, why can't you publish the breakable changes in advance?
Hope, no changes required at client side,