Here's the calculation used in main.js line 77 applied to a very extreme unrealistic example. I simulated 253 days of return percentages from a uniform distribution between -5.5% and 5.6%, and then the actual total return percent, calculated in R
set.seed(2020)
n <- 253
daily_gain <- runif(n, -.055, .056)
total_gain <- sum(daily_gain)
avg <- total_gain/n
annualizedReturn <- (1 + avg)^n -1
annualizedReturn
# [1] 0.2933685
prod(1 + daily_gain) - 1
# [1] 0.1324846
Edit:In reality the actual numbers are likely to be not nearly as different as this example. I chose uniformly distributed returns with a wide range to make the reason against this calculation very obvious. Here's an example return distribution where there's hardly any difference. Normal returns with average of 0.085% and standard deviation of .05 i.e. daily_gain <- rnorm(n, .085/100, .05/100) gives
annualizedReturn
# 1] 0.2414539
prod(1 + daily_gain) - 1
# [1] 0.2414051
For good measure here's one in the middle where your returns are normally distributed with an average of 0.35% and a sd of .2%, but then you have on average 10 bad days a year where returns are 5 percentage points lower than that distribution i.e. daily_gain <- rnorm(n, .35/100, .2/100) - rbinom(n, 1, 10/n)*.05 gives annualizedReturn
# [1] 0.2712024
prod(1 + daily_gain) - 1
# [1] 0.2490317