It looks like you're new here. If you want to get involved, click one of these buttons!
kws = KiteTicker(api_key, access_token)
....
def on_order_update(ws, data):
logger.info(f"Ticker on_order_update data: {data}")
.....
kws.on_order_update = on_order_update
I am placing NRML order and buying 50 qty of some NIFTY CE.
regardless of how order was created.
https://kite.trade/forum/discussion/comment/23960/#Comment_23960
Now I will..
- place order via api and exit via api
- place order via api and exit from web dashboard
I'll see if on_order_update works, i restarted everythingEverything seems to be working fine now, I had websocket connected in the morning with different id, forgot about that.
Now
If you can tell me a little about my following queries, that'd be great.
- best way to know if I have an open position for 'xyzabc' tradingsymbol
- if I exit a position partially (i.e. sell some part of quantity), how should I handle that
About 2nd query, to my knowledge I'll still get order 'COMPLETE' status when partial exit order gets completed, so basically I should use on_order_update as an event to check if I have an open position for 'xyzabc' tradingsymbol, which is my 1st queryIf I should open another discussion for these, let me know, or you can refer me to another discussion if these have already been discussed somewhere.
2. No,you won't get 'COMPLETE' for partial fill. If your order is partially filled,you will get 'UPDATE' status with the current filled quantity. Only after the order is fully filled ,you will get 'COMPLETE' status.
On_order_update, postbacks should be used as events to fetch orderbook, positions etc. because sometimes they are asynchronous,so you might get confused,so it's always advised to use postback/on_order_update as events to fetch orderbook or positions to check the updated details of your orders/positions.