Fetch Open Position and Type

I want to fetch total open position and thier type , like Buy/Sell .
Example : Short STraddle at 9:20 - BankNifty 35000CE sell / 35000 PE Sell
SL hit at 35000 CE.
SO ,Now
Fetch Open Positions - 35000 PE & Type Sell
Or Fetch Closed Position - 35000 CE & Type Sell