how to place target order of SL order.

nivasdhina
Hi, I am into Options trading, and I have achieved placing orders through API and I am clueless on how to place the target order or SL order for the executed order.
  • ComT
    You can use GTT order for target and SL. or use Limit order
  • Anbalagan
    I too have the same question. Once "Options Call Buy" is successfully executed, I want to exit as soon as my target is reached. So what is the API to exit from the position?

    I couldn't find the answer anywhere, even there is no documentation available.
  • SRIJAN
    SRIJAN edited November 9
    @Anbalagan use 'if' condition to set your target condition. like
    if "your target condition":
    kite.place_order(params)
    Or if your target is fixed , place limit order for target as soon as your trade is executed.
  • rakeshr
    if "your target condition":
    kite.place_order(params)
    Or if your target is fixed , place limit order for target as soon as your trade is executed.
    Yes, or you can also use GTT OCO order to place both SL and target order for the same.
  • SRIJAN
    Yes,thank you. :)
  • nivasdhina
    order.placeTargetOrder(kiteConnect,completeOrderId, orderPrice,tradingSymbol);

    This is the function i used to exit the position.
  • sujith
    Exit is only for cover order. You will have to place a regular order with opposite transaction type.
  • Anbalagan
    Thanks Sujith, It would be great if you give me a small code snippet for the same.
  • Imran
    Imran edited November 13
    hi @Anbalagan
    see this link .. https://kite.trade/docs/pykiteconnect/v3/#kiteconnect.KiteConnect.place_order

    use this to make a order with opposite transaction type.
  • Anbalagan
    @Imran, Please read the question before providing answers and suggestions. Don't post anything just for namesake. I have gone through all the API documentation and its corresponding python implementations.

    @Sujit,
    What I need is just a sample code snippet for Options Call Buy and how to sell the same.

    I just want to understand how to differentiate between below through API:
    1. exiting "Call Buy Option".
    2. "Call Sell Option"
  • SRIJAN
    Please show some respect anbalagan to Imran sir. The answer Imran sir gave is the only way or you have to use gtt oco order as told by Rakesh Sir.
  • sujith
    @Anbalagan,
    Kite Connect only exposes place order API. Kite Connect doesn't differentiate between entry, exit order, target or stoploss order. It has to be tagged or maintained at your end.
  • Sandeep_Prakash
    I do it by changing the orderType to Market order and then calling modifyOrder api.

    orderParams.orderType = Constants.ORDER_TYPE_MARKET;
    kiteConnect.modifyOrder(orderId, orderParams, Constants.VARIETY_REGULAR);
  • nivasdhina
    This has to be well documented by kite. This simple work took me a lot of hours to crack. @Anbalagan you can send the orderId to the target order method and execute it.
Sign In or Register to comment.