I am new here and have been trying to build a strategy based on option writing. But I need help with coding where i can exit from my open positions. Let's say I've sold a call option, so which function should I use to exit this particular position. If someone can provide a sample code that would be really helpful.
hi @zweyn - If you have sold an call option that is a sell order and you would have used kite.place_order with transaction type as SELL. If you want to exit that position then you need to buy the same contract with either MARKET or LIMIT price. Kindly ensure to put the contract name and quantity correctly otherwise you will BUY a different or additional quantity of the CALL option.