Exit Long and Exit Short Algo code


I am new to Zerodha and trying to understand PI tool. While I find code for both Buy & Sell algo trades, I don’t find any for Exit Long & Exit Short, these would be key to exit a particular position.

Can someone help in this?



The backtest option does have the buy script, sell script, Exit long script, and Exit short script option. However when you convert this to an expert advisor you only get 2 options - Buy and sell script.