1. When we place an order for future instrument, we have to actually specify the number of quantities to trade in the regular order API quantity field e.g. in case of NIFTY16MAYFUT, we have to specify 75 as the quantity instead of 1. Is it ever possible that out of total quantity only partial is filled in case of futures (which will be in fraction of lots then) e.g. if we place order quantity as 75, is it possible only 72 are getting filled and rest 3 are not filled for NIFTY16MAYFUT?
2. When we query for an order, we get two fields 'filled_quantity' and 'quantity'. imagine a situation where placed quantity is 5 and filled quantity is 3, I want to cancel the the rest unfilled 2 quantities. How do we do that? Do we have to fire the DELETE API for that order id (if so what will happen to the filled quantities in that order id)?
3. If we place a SL LIMIT order specifying both limit 'price' as well as 'trigger_price' and then listen in the postback webhook. When the order gets initiated we will get a notification in the postback for the order id. But what happens when the stop loss SL is triggered for that order, do we get the notification in the postback webhook with the same order id?
1. When we place an order for future instrument, we have to actually specify the number of quantities to trade in the regular order API quantity field e.g. in case of NIFTY16MAYFUT, we have to specify 75 as the quantity instead of 1. Is it ever possible that out of total quantity only partial is filled in case of futures (which will be in fraction of lots then) e.g. if we place order quantity as 75, is it possible only 72 are getting filled and rest 3 are not filled for NIFTY16MAYFUT?
Its not possible to get partial lot size filled.
2. When we query for an order, we get two fields 'filled_quantity' and 'quantity'. imagine a situation where placed quantity is 5 and filled quantity is 3, I want to cancel the the rest unfilled 2 quantities. How do we do that? Do we have to fire the DELETE API for that order id (if so what will happen to the filled quantities in that order id)?
Its a special type of order called fill and kill which is not supported by our OMS currently. You can use IOC but orders will be cancelled if not fully filled but won't go as pending order.
3. If we place a SL LIMIT order specifying both limit 'price' as well as 'trigger_price' and then listen in the postback webhook. When the order gets initiated we will get a notification in the postback for the order id. But what happens when the stop loss SL is triggered for that order, do we get the notification in the postback webhook with the same order id?
Currently we only send post back for the following order statuses "COMPLETE", "CANCELLED" and "REJECTED". In future we will send for other statuses also.
@vivek for point 3) what will be the behaviour in webhook data in case of CO(cover order) scenario. First trade is executed, we get notification in postback webhook. When given stop loss price in CO is hit, what data will reach in postback webhook? what will be the order id that time?
regarding the 2nd question ..i regularly encounter same situation during manual intra day trading. order will be pending with partially filled quantity. my solution for this--- is to edit the original order and set quantity as filled quantity, then order turns complete. you can try the same trick here.. also my suggestion is when you do algo trading better try to put market order ..rather than putting limit order and making the system so complex and bug prone. when you decide to enter why put limit ...? actually algo market orders what takes the stock price up most of the times.
@sampath_topc thanks a lot...that idea helped a lot, thank you.. regarding the order type, I initially tried with market order, but the price I get in market order is pretty high/low compared to the price at which algo generated the signals in case of buy/sell, which in turn affects the profit... that is why turned into limit prices... ...ya it has turned into too complex with limit order management...
fill and kill
which is not supported by our OMS currently. You can useIOC
but orders will be cancelled if not fully filled but won't go as pending order. Currently we only send post back for the following order statuses "COMPLETE", "CANCELLED" and "REJECTED". In future we will send for other statuses also.