With the following variables
s = loan amount
r = monthly loan rate
n = number of months
d = monthly payment
the standard loan equation is
s = 900000
n = 12
d = 84000
(d - d (r + 1)^-n)/r - s = 0
Note, this cannot be manipulated to an expression for r.
You can use a solver in your program. E.g. Math.NET Root finding
RealRoots.OfFunction(r => (d - d *...
The term commonly used for "holding period return" is "cumulative return".
The issue is that you're comparing two different formulas for return and mistaking them for interchangeable values.
Yield to maturity (YTM) is annualized (it's also forward looking).
Cumulative return is a historical measure of how much money an investment has earned for an ...