How to fetch only open positions status & value?

prithviraj29
position.get("net") return position grouped by product (BO) and instrumentToken (symbol).

At any point, all the following show same value when I do position.get("net") for the group: m2m, pnl, unrealised

My issue is, I have placed 2 BO orders for same Symbol. One at 10AM, exit at 11AM. 2nd order placed at 2pm.

Now at 2:30pm, I know my 1 BO is open, but the net position shows m2m, pnl, unrealised as net of both the orders combined. I'm no longer interested in the order placed earlier, but want to know the position status of the 2nd order ONLY. How do I get the m2m/pnl of the 2nd BO order only?
  • themohammedfaisal
    @prithviraj29,
    When you've traded intraday in the same scrip multiple times in a trading day using the same product type, and you open a new position in the same scrip, the buy-average for this will be calculated considering the total quantity traded that day.
    The quantity and buy average is netted into one.
    This is the normal behaviour.
  • itsram90
    basically you need to get list of your orders and your positions and using parent order id you can try to get you only active position.
    once you have above you can simply calculate it .
Sign In or Register to comment.