Hello, During the day if i opened and closed the position on one Symbol (e.g IDBI). Suppose i again open a position in IDBI, how do i get pnl of this latest trade.
Following is the IDBI net position which i get, (note that day position gives the same Json)
This will again give me the same pnl which is already in the json object of postion. A simple filed in pos would have sufficed. Now there is such a big overhead of coding to find out the pnl of last trade. I need to assume that the orders list i receive is in sequence. Hoping that is true assumption.
A consolidated position is something we get from the OMS. That's the way it was designed. I am afraid we can't change that. In the above method, you can find the P&L of a particular order.
If I had taken one position and closed it in loss of 1K And I ented again, There should be some factor like unrealised should give me ZERO 0 (just now I opened position)
So, That I can easily know the new active PNL.
So, PNL means total PNL Unrealised means : New PNL
Why can't u implement in this way, Everybody will be happy.
I want to find the pnl on the position highlighted above. I dont find any way to identify it based on the json object for day or net.
You find the difference between the product of the average price and quantity of BUY and SELL order.
P&L = (average_price*quantity) of entry order - (average_price*quantity) of exit order.
A simple filed in pos would have sufficed. Now there is such a big overhead of coding to find out the pnl of last trade.
I need to assume that the orders list i receive is in sequence. Hoping that is true assumption.
In the above method, you can find the P&L of a particular order.
If I had taken one position and closed it in loss of 1K
And I ented again, There should be some factor like unrealised should give me ZERO 0 (just now I opened position)
So, That I can easily know the new active PNL.
So, PNL means total PNL
Unrealised means : New PNL
Why can't u implement in this way,
Everybody will be happy.
Unnecessarily 3 parameters for same value now