0

I would like to calculate the average weighted price of an asset based on purchase orders.

I thought it would be total cost / total amount.

But looking at the following sequence:

operation units price total units total cost average price
BUY 1 1\$ 1 1\$ 1\$
BUY 100 2\$ 101 201\$ ~2\$
SELL 100 1\$ 1 101 \$ 101\$

And the average price is 101$ which makes absolutely no sense... Looks like I am missing something very basic here.

X.Y: Eventually I am trying to calculate Unrealized P&L for a trade position.

  • The final average? yo buy 101 units for a Total Cost of 201. Then you sell 100 units with an income of 100. Result: you are left with 1 unit and you have spent 201-100=101. Thus, the average cost of the unit left is 101. – Mauro ALLEGRANZA Jan 25 '22 at 13:26
  • Is exactly what happens in trading stock: if you buy at high prive and sell at low price you have a net loss. – Mauro ALLEGRANZA Jan 25 '22 at 13:27

0 Answers0