I am using Java KiteConnect library to calculate the Day PnL. I am using KiteTicker to get the LTP and able to calculate correctly the PnL of Open positions and get the real time PnL.
Please suggest the formula to calculate Day PnL which should include both Open positions PnL and closed positions PnL.