Intraday Position average price calculations

Hello Team,

Similar to the clarification query requested for the holding price for delivery

But now in case of intraday

Buy 10 @ 100
Buy 10 @ 90
Buy 10 @ 80
Sell 10 @ 95

Ofcourse all of these will.be shown in position section

Q1 : does it get calculated as below based on weighted avg price and NOT FIFO

= overall buy postion as tot buy > tot sell
= Total buy amt - total sell amt / tot qty
( 100 × 10 + 10 x 90 + 10 x 80 ) - ( 10 x 95 ) / 20
= ( 2700 - 950 ) / 20
= 87.5

Postion avg price = 87.5 with qty = 20

Q2: ofcourse in case of the PNL when everything is sold off

Final PnL = Total sell - total buy - buy and sell charges

Regards,
Kartik

When you sell 1 quantity, the system calculates profit or loss in the backend using FIFO.However, in the positions tab the average buy price does not change.
The average price only changes when you buy more quantities, not when you sell.

Yes thats correct.

1 Like

@Swapneel_Dey

Just clarifying , so after all buy the avg price is 90 with qty 30

So when the sell happens the avg price remains the same as 90 but the qty is now reduced to 20 ( since 10.is sold )

Pls let know if my understanding is correct.

@mnkartik Yes thats correct.

1 Like

I have another scenario @Swapneel_Dey

If below are the txs where the last sell made it as SHORT position with qty10

Buy 10 @ 100
Buy 10 @ 90
Buy 10 @ 80
Sell 10 @ 95
Sell 10 @ 98
Sell 20 @ 105

Q: how is the avg price calculated

Q: how does fifo is applied to this. First two sells are clear but how abt the last sell where the qty is 20. Because now this being a short position how is the fifio applied

In this case 10 qty becomes a new short position, with the average around 105. If more quantities are sold at different prices, the average will keep adjusting. Once the position is closed (buy), the average doesn’t change further only the P&L gets realised.

Simply, 20 qty sold at 105 in this case, for 10 qty profit is booked, and the remaining 10 qty becomes a short position at 105.

1 Like

So basically when the sell happens first 10 would close the position and the calculations would be reset

For next 10 the avg price is again calculated but this time it’s going to use the sell trades due to the short positions

And hence the avg price = 105 , qty = 10 and short postion

Q :
As it’s short postion, when the new buy trade occurs like below

Buy 10 @ 100

In this case fifo is used but uses last sell trade to close the position

Correct

Thank you @Swapneel_Dey