totalYearsOfTrading is an int. Fractions should be allowed to make these stats accurate.
int totalYearsOfTrading = stats.getInt("TotalDataYears");
It is misleading because it also uses:
int totalYearsOfTrading = stats.getInt("TotalDataYears");
So you get the same Annual % Return for the same return on, say 2 years as, say 2.4 years.