mickeystanford_alumni
Board Regular
- Joined
- May 11, 2022
- Messages
- 129
- Office Version
- 2021
- Platform
- Windows
- MacOS
Hi, I am trying building a portfolio PNL where I calculate the daily pnl and weighted average.
I am struggling to find a formula which allows me to by just plugging the new trades in a row, calculates the daily PNL and the weighted avg.
The issue here is that for 1 trade is easy to build, but once you start mixing up new trades in different days, then it all becomes extremely messy.
Is there any idea on how i could achieve something clean but easy to automate and calculate the daily return and weighted average as if I were creating my own brokerage/portfolio account?
Basically the sheet looks like:
Starting A1:
As an example of day 1:
New trade (position in shares): +100
Total Position: +100
Purchase/sell price: 50$
Current Live Price: 51$
Daily PNL: +100$
Weighted average: ??
Total PNL: +100
Day 2
New trade (position in shares): +350
Total Position: +350
Purchase/sell price: 51$ (only for the new trades)
Current Live Price: 52$
Daily PNL: +250$ (proxy, as here the daily PNL would calculate the total position * (closing price - current live price)
Weighted average: ??
Total PNL: +350$ (proxy)
Thanks in advance.
I am struggling to find a formula which allows me to by just plugging the new trades in a row, calculates the daily PNL and the weighted avg.
The issue here is that for 1 trade is easy to build, but once you start mixing up new trades in different days, then it all becomes extremely messy.
Is there any idea on how i could achieve something clean but easy to automate and calculate the daily return and weighted average as if I were creating my own brokerage/portfolio account?
Basically the sheet looks like:
Starting A1:
As an example of day 1:
New trade (position in shares): +100
Total Position: +100
Purchase/sell price: 50$
Current Live Price: 51$
Daily PNL: +100$
Weighted average: ??
Total PNL: +100
Day 2
New trade (position in shares): +350
Total Position: +350
Purchase/sell price: 51$ (only for the new trades)
Current Live Price: 52$
Daily PNL: +250$ (proxy, as here the daily PNL would calculate the total position * (closing price - current live price)
Weighted average: ??
Total PNL: +350$ (proxy)
Thanks in advance.