How to find average cost of buy and sell of stock

Hello everyone,

I would like to know my buy average cost and sell averagae cost. How I can find?

For example:

I start stock buy at 9:30 am …

  1. 5 stock at the price of 360 = 5*360 = 1800
  2. 4 stock at the price of 355.50 = 4*355.50 = 1422
  3. 1 stock at the price of 355 = 1*355 = 355

Now, total stock I have 10 at average price of 357.70 … 10*357.70 =3577.

Out of 10 i sell 5 at the price of 358 … 6*358= 2148

again, and I start buying

  1. 4 stock at the price of 354.50 = 4*354.50 =1418
  2. 2 stock at the price of 354 = 2*354= 708

Now my overall 16 stock average cost is 356.4375 … 16*356.4375=5703

My doubt is what is my actual profit.

Buy: 16356.4375 = 5703 Sell: 6358 = 2148

Buy: 6356.4375 =2138.625 Sell: 6358 = 2148 Profit: 2148 - 2138.625 = 9.375

or

first

  1. 5 stock at the price of 360 = 5*360 = 1800
  2. 1 stock at the price of 355.50 = 1*355.50 = 355.5

Buy average: 6359.25=2155.50 Sell: 6358 = 2148 profit: 2148 - 2155.50 = -7.5

Remaining 10 stock carried forward to delivery now i want to find out my actual profit so i can do.

So, I am in profit or loss at open position it showing profit but when am calculating it showing loss.

Totally confused can anyone help me out in this regards,

thanks
Abrar.

All trades are executed on a FIFO basis(First In First Out basis), which means the shares that are bought first are sold out first. Here, when you sell out 5 shares at 358, the first 5 shares bought at 360 are sold out. You take an intraday loss of Rs.10.

Shares left are:

4 stock at the price of 355.50 = 4355.50 = 1422
1 stock at the price of 355 = 1
355 = 355

plus you buy again,

4 stock at the price of 354.50 = 4354.50 =1418
2 stock at the price of 354 = 2
354= 708

You new average price is 354.82 for the 11 shares that are still present in your account and you’ve taken an intraday loss of Rs.10 for the 5 shares bought and sold.

Thank you for your reply…

Are you sure it is always FIFO? I recently noticed that in one stock my first lot was sold where as in the other one my last lot was sold. I guess it selects based on selling price higher/lower compared to first/last lot.
Was it a bug or is this the logic by which average is calculated?