HP Forums
Combo Loan (Piggyback Loan) - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Software Libraries (/forum-10.html)
+--- Forum: HP Prime Software Library (/forum-15.html)
+--- Thread: Combo Loan (Piggyback Loan) (/thread-10453.html)



Combo Loan (Piggyback Loan) - Eddie W. Shore - 04-06-2018 01:27 PM

Link to blog article: https://edspi31415.blogspot.com/2018/04/hp-12c-and-hp-prime-combo-loans.html

The program COMBOLOAN calculates the payments for both separate loans and combined loans. This particular loan covers of three types: 80:20, 80:15:5, and 80:10:10.
Code:

EXPORT COMBOLOAN()
BEGIN
// EWS 2018-04-05
// Piggyback Loan
LOCAL a,lst,k;
LOCAL t1,t2,i1,i2;
LOCAL d,p1,p2,p;
// terms, order allows to
// use eqn −5*k+25
lst:={"80:20","80:15:5","80:10:10"};
// input
INPUT({a,t1,i1,t2,i2,{k,lst}},
"Payment: Combo Loan",
{"Loan: ","Term1:","Rate1:",
"Term2:","Rate2:","Type :"},
{"","years","","years","",""});
// calculation
p1:=Finance.TvmPMT(t1*12,i1,a*0.8,0,12);
p2:=Finance.TvmPMT(t2*12,i2,a*(−0.05*k+0.25),0,12);
p:=p1+p2;
// down payment 
d:=−a*0.05*(k-1);
// payment: down, total,
// large, small 
RETURN {d,p,p1,p2};
END;

Output: {down payment, total payment, large payment, small payment}

Examples:

Loan Amount: $200,000.00
80% Loan: Term: 30 years, Rate: 4.5%
Small Loan: Term: 15 years, Rate 5%

Example 1: Type 80:20

Result: {0, -1,127.01, -810.70, -316.32}

Example 2: Type 80:15:5

Result: {-10,000.00, -1047.93, -810.70, -237.24}

Example 3: Type 80:10:10

Result: {-20,000.00, -968.86, -810.70, -158.16}

Sources

Calculated Industries Real Estate Master IIIX: Resident Real Estate Finance Calculator Pocket Reference Guide Calculated Industries, LLC.: Carson City, NV 2010

Mortgage-Info.com “Piggy Back Mortgage Calculator” Mortgage Info.com 2011 http://www.mortgage-info.com/mortgage-calculators/piggybackmortgagecalculator.aspx Accessed April 4, 2018.