Stop loss and Take Profit

pnsudesh
Hi I am trying to place fno positions using kite connect Java api client. I am able to place the order for an options contract at a specified limit price. However, I need to understand how the sl/tp parameters can be passed to the order data so that the trade is either booked for profit or a sl is triggered. How can I pass the sl/tp values in that sense? placeorder's orderparams does seem to use stoploss attribute but I cannot see that (i.e sl value) on the kite web. can you help me on that please?

Also, is there a method available to fetch the margin for a specific trading symbol? i.e the value displayed on the kite web. Thanks.
  • tonystark
    While placing order you can specify order type as `Constants. ORDER_TYPE_SL` and give trigger price and price.

    Margins for order is not available as part of KiteConnect at the moment.
  • pnsudesh
    I thought SL orders are applicable only on intraday trades. I am using NRML trades(positional). Do you think it can still be used for my use case?

    Thanks on margin query. I think Zerodha need to consider this for future api releases.
  • ganeshv02
    hi @pnsudesh - For your case, you can use bracket order instead of normal order. BO has has price, trigger price, stop loss points and target points. Also it can help to trail your stoploss. This will be just one order and everything is taken care by zerodha. This reduces lot of coding on the algo side. Read about bracket orders here - https://support.zerodha.com/category/trading-and-markets/margin-leverage-and-product-and-order-types/articles/what-are-bracket-orders-and-how-to-use-them.

    However please note zerodha keeps blocking bracket and cover order quite often when the market is volatile. I don't think there is an automated way to check if the BO is blocked for a given day. This is the reason I am not using bracket order instead I place a normal buy order. Once the normal buy order is executed I place target order with whatever price I want. After that, I keep monitoring the target order status and the last traded price. If the last traded price falls below my stoploss price I modify the target order with the stoploss price.
  • pnsudesh
    @ganeshv02 Thanks. I will have a look at these steps.
  • sujith
    @pnsudesh,
    You can refer to this thread.
Sign In or Register to comment.