# How to calculate portfolio change percentage in periods with buy events?

Im having problems figuring out how to calculate my portfolio profit/loss percentage over longer periods, where buy/sell events are involved.

Example:

• Day 01: I buy shares for \$100K
• Day 30: Valuation is now at \$95K
• Day 31: I buy shares for an additional \$50K (Total valuation: \$145K)
• Day 60: Valuation is now at \$160K

On day 60, I want to calculate my profit/loss change in percentage in the period from Day 30 to Day 60 (inclusive of both day 30 and 60).

My initial idea was to say:

``````// Calculate result on specific days
Day30Result = \$95K - \$100K = -\$5K
Day60Result = \$160K - \$150K = \$10K

// Calculate result in period
PeriodResult = Day60Result - Day30Result = \$15K

// Calculate period change in percentage
PeriodChange = (PeriodResult / \$95K) * 100 = 15.79%
``````

Which does somehow seems resonable, but when you compare it to the overall profit/loss percentage where we get:

((totalValuation - totalCosts) / totalCosts) * 100 = 6.67%

Which seems as an extreme difference to me... So are my calculation correct? Or am i wrong in comparing the period result to the total value of the portfolio at the start of said period?

A common approach is to use time-weighted returns where you calculate the return of each time period between external cash flows, then compound them. In your case it would be:

Period 1 (day 1-30):

``````Return 1 = 95/100 = 0.95 (5% loss)
``````

Period 2 (day 31-60)

``````Return 2 = 160/145 = 1.1034 (10.34% gain)
``````

Total return:

``````Return 1 * Return 2 = 0.95 * 1.1034 = 1.0483 (4.83% gain)
``````
• Ahh I see. It might have been unclear from my question, but day 30 was inclusive in this test example: Day 30->60 (I'll edit question) - So how would i use this method to calculate this specific period? It seems unclear since splitting the full period up in multiple periods resutls in period 1 (day 30-30) and period 2 (day 31-60) and how would you calculate day 30 to 30? Aug 28, 2019 at 21:22
• You'd have to know the starting value on day 30 to calculate the return for day 30. You'd then compound that with the return for days 31-60 (using \$145 as your base amount). Aug 28, 2019 at 21:25
• This would get brutal if you invest every month!! Aug 28, 2019 at 21:47