how to get synchronous postback or convert to synchronous

Kamalv
@sujith @rakeshr @SRIJAN @kiteconnect
My target order quantity depends on entry order quantity. Since order can execute partially and response is asynchronous it is hard to place/modify target order quantity.
For example:
filled_quantity = 5 => i will place target quantity with 5
filled_quantity = 10 => i will modify target quantity with 10
filled_quantity = 20 => i will modify target quantity with 20

but if postback is
filled_quantity = 10 => i will place target quantity with 10
filled_quantity = 20 => i will modify target quantity with 20
filled_quantity = 5 => i will modify target quantity with 5 (but by this time target might have executed more than 5)
This is a known thing, you might have thought/discussed about this, I tried to search with keywords but could not find solution. Can you suggest me how to deal with this ?
  • SRIJAN
    SRIJAN edited January 17
    Use orderbook for synchronous order updates.
    Or, you can use if statements. Like, let's say you put order for 100 quantity. And the first postback says the filled quantity is 50,second says 30. You can use if statement to check if the 2nd postback filled quantity is less than initial one,or any postback for a specific order has filled quantity less than the previous ones. If yes,then just ignore that postback,beacuse this is not possible that first the filled quantity is 50,and then it's 30. Filled quantity will always be in increasing manner.
  • Kamalv
    thanks for the response @SRIJAN is "Positions" also synchronous? (https://kite.trade/docs/connect/v3/portfolio/#positions )
Sign In or Register to comment.