Exit position

jeevansevar
hi @sujith , i have placed NFO order using API now how do i exit it grammatically, i mean which API need to be called to exit current position i have an order_id for that order
Tagged:
  • rakeshr
    @jeevansevar
    There are no special API calls for exiting instruments from positions. The way to do it is to place an opposite BUY or SELL order depending on whether the position is a long or a short.Go through this documentation.
  • jeevansevar
    ok got it, Thanks for info
  • jeevansevar
    but it will be good if they introduce ExitPosition API based on order id pram
  • rishiswethan
    @rakeshr

    What about
    kite.exit_order()
  • jeevansevar
    hi Rakesh, i did not see such method in kite library
  • rishiswethan
    @jeevansevar
    This is for python, I noticed this when using pycharm in autocomplete, I've not tested it
  • rakeshr
    rakeshr edited August 2019
    @rishiswethan @jeevansevar
    exit_order method is used only for exiting BO/CO order not for positions, you can go through this documentation.
  • sourirajan
    sourirajan edited December 2020
    "Exit position" and "exit all position", must be present in api , because now it involves 1 request to get position and 1 request to close it, so extra turn around time. If exit option is provided it will take only half the time. Also the api will be faster if exit is taken care from server side, pls implement it. In Kite website also there is exit option right, instead of buy / sell to close position, because that is the logical thing.
  • sujith
    @sourirajan,
    Kite trade has to still place order on OMS for exiting a position. Error management becomes difficult and Kite Connect has always been simple and modular APIs, we want to keep it absolutely an execution platform.

    Kite web just abstracts the same thing, it places orders in a loop to exit all positions. You can do the same at your end.
    You can just place orders in a loop once and fetch positions after that to check.
  • JohnKurian
    I am new to Kite Connect. Since exiting positions is a separate order to be placed, does it need additional margins? For eg. I have a NFO BUY leg in my positions, if I have to place a SELL order to exit that position do I need additional margins ?. Can anyone help pls
  • sujith
    You don't need additional margins to close an open position. AFAIK
  • JohnKurian
    @sujith - Thanks for the info.
  • Wattnex_trade
    Wattnex_trade edited December 2022
    Thanks for the info
  • vishwas
    If anyone interested in Exit positions API. I have created my own. Contact me if anyone needs it. 8904841407
Sign In or Register to comment.