BO market order supported via Python API or website?

krishnakant
Hi,

Is it possible to place market Bracket Order through API or website?

I currently see only LIMIT and SL option on website. If I put 0 in place of price, would it be treated as a market order?

In case a BO market order is only restricted through the website, can one place it via the API? If yes, what would be the order parameters?

Thanks.
  • sujith
    Kite Connect doesn't support bracket order with entry type market. You will have to use limit order with price above LTP to buy at the market.
  • krishnakant
    krishnakant edited August 2018
    @sujith, thanks for clarification. I have the following query.

    As you mentioned that a market order execution can be mocked by placing a limit order above LTP, will the target will be calculated upon the executed price or the order price?

    For example,

    Consider a stock (say ABC), current LTP is 100. I want to buy the stock at market price when the LTP reaches 101 with a target of 2 and stoploss of 5. So, I place a SL Bracket Order with a price 104 (as I want buy at market and also assuming 104 is well above LTP at the time when the trigger is hit), trigger price 101, stoploss 5, and target 2.

    Now, when the trigger is hit (LTP reaches 101), my order gets executed at 101.3 (as it was market order and this was the best offer/ask price), will my target now be 106 (104+2) or 103.3 (101.3+2) and stop loss be 99 or 96.3?

    Thanks.
  • sujith
    The target and stop-loss are placed based on executed price.
  • krishnakant
    Great. Thanks!
  • krishnakant
    Another follow-up question - In case I wish to buy/sell multiple quantities using the above method (market order mocking), will target/stop loss be now calculated based on the "average" executed price?
  • sujith
    It is not based on average price, it is based on executed price since there will be two leg orders placed by the system for each trade.
  • krishnakant
    @sujith
    Do you mean that the initial BO order will be split up into multiple legged orders?

    For example - I placed an order to buy 2 quantities, and they got executed at different prices. So, there are two target orders and two SL orders for each of the quantity?

    Also, a follow up question in case of partial fill. Will the initial BO order continue to be OPEN in case I could buy only 1 quantity at the LIMIT price I mentioned in my initial order and I achieved my target for the said quantity. For example - I place a SL BO order to buy 2 quantity of ABC at trigger price 100 and LIMIT 100, stoploss - 5 and target 2. The stock moved up fast and I could only buy 1 as there were no offers/asks at 100. So, there is a partial fill of only 1 quantity. The stock moves up to 102 and my target is achieved. Now, will the system book this profit and cancel the partial open BO order of remaining one quantity? or will that still be open and I'll have to personally cancel that?

    Thanks
  • sujith
    sujith edited September 2018
    For example - I placed an order to buy 2 quantities, and they got executed at different prices. So, there are two target orders and two SL orders for each of the quantity?
    Yes, there will be two leg orders for each trade in case of bracket orders.

    Even after the target is booked, parent order will be still open. You will have to send a cancel request with parent order id.

    PS: If you are writing a strategy around bracket order, go through this article.
  • krishnakant
    @sujith

    I placed an Bracket order today to buy LUPIN18SEPFUT (see order details below) with a target of 0.7

    Quantity 700 / 700
    Price 928.6
    Avg. price 928.5 (Executed price)
    Trigger price 928.45
    Order type LIMIT
    Product BO
    Validity DAY

    The order got executed at 928.5. Now, the target price should have been 929.2 but it was placed and executed at 929.15 (based on the trigger price 928.45+0.7). Didn't you mention that the target and stop-loss are based on executed price. Please look into this. This has happened for all BO orders placed during this week.

    Thanks,
  • rakeshr
    @krishnakant
    We are checking on this with our OMS.We will post updates here.
  • krishnakant
    krishnakant edited September 2018
    @sujith @rakeshr
    Another issue with BO orders -

    I placed a BO order for AXISBANK Sept futures today. Both the target and stop loss legs got executed. I have attached a screenshot of the target order history. It does show that a cancel signal was sent but was not cancelled and instead got executed/completed few seconds later. This resulted in an open position which I had to hedge using an opposite MIS order.

    After the stop loss had been hit, there were 11 seconds to cancel the target leg. How could this have been not cancelled?

    This is very unreliable. Please look into this matter asap.


  • rakeshr
    @krishnakant
    Can you write here to Zerodha, addressing to RMS team.
  • krishnakant
    @rakeshr

    I have already contacted them. They have said that the system would square off the BO position at 3:20. However, I still have the position open. How is this possible? Why did the system could not square off the BO one?

    Thanks.


  • rakeshr
    rakeshr edited September 2018
    @krishnakant
    Above scenario is called Self-Trading,go through this thread to know in depth about it.
    You need to contact RMS on this number,immediately when Self-trade happens, they will do the necessary.
Sign In or Register to comment.