Profit loss for unrealised positions

Can you help me with sample code or way to get profit loss for unrealized position in options trading. Currently, APIs pnl giving the consolidated one. Just to elaborate, if entry/exit in few positions in the morning, if again entry in second half, its giving me consolidated sum. While, I want to have view on currently open positions profit loss only.

@ADHISH_3879233 This information is currently not available through the Positions API. We’ve shared your feedback with the relevant team. Thank you.

Thanks Anand. I can understand that right now, this information is not up-front available. I just want help from ubstox if can help me with pointer to fields and conditions which can help to calculate require information.