Normal Topic Amoritization Problem (Read 1447 times)
Jhatton
Member
*
Offline


No personal text

Posts: 2
Joined: Jul 25th, 2005
Amoritization Problem
Jul 25th, 2005 at 2:41pm
Print Post Print Post  
Hello all - I've been trying to create a program that prequalifies somebody for a loan (or at least gives me a read on whther they will or not).

The problem I'm coming across is that the math isn't entirely working out.  If any of you fine Sesame users are working on similar projects, maybe you could give me a hand. ---

The main problem is amortization - this is what I've BEEN using as my code:

===============
if main_term > 0 AND
main_interestrate > 0 THEN
{
PMRP_MPI =
(MAIN_loanamount*((@EX(1+(MAIN_interestrate/12)),(main_TERM*12))*
(main_interestrate/12))/((1+@EX((main_interestrate/12),
(main_term*12))-1)))/1000
================

I finally got it to where it wasn't dividing by zero, but now I can't seem to get it to process the number correctly.  The idea is by the person punching in the LOAN AMOUNT, THE INTEREST RATE, and the TERM, they should get an amoritized monthly payment. 

Anyone have a tip?
  
Back to top
 
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Amoritization Problem
Reply #1 - Jul 25th, 2005 at 3:51pm
Print Post Print Post  
Check out pg 34 of programming manual. Financial Functions.

@pmt
@ir
@pv

Etc..

Do you also need to calculate DTI and LTV?

  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
Jhatton
Member
*
Offline


No personal text

Posts: 2
Joined: Jul 25th, 2005
Re: Amoritization Problem
Reply #2 - Jul 29th, 2005 at 3:01pm
Print Post Print Post  
Thanks for the quick response, but here's the problem.  The @PMT isn't Amortirizing.

ie:

For sake of ease in trying to figure this out, I've made a small program.  4 fields.

MAIN_LOAN
MAIN_RATE
MAIN_TERM

The programming for MAIN_MPI reads:

main_mpi = @PMT(MAIN_LOAN,MAIN_RATE,MAIN_TERM)

I've also tried (MAIN_RATE/MAIN_TERM), (MAIN_TERM*12)

Nothing seems to change it from doing the basic math withou the more complex amort stuff.


Thanks for your continued help.
James
  
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Amoritization Problem
Reply #3 - Aug 2nd, 2005 at 8:52pm
Print Post Print Post  
Hello James,

Could you give me a sample set of data and the correct amoritized payment.

Something like...

Loan - $
Rate -  %
Term -  Years or Monthes
should give you this
Amor. Payment - $

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
glenn
Member
*
Offline


No personal text

Posts: 1
Joined: Oct 18th, 2005
Re: Amoritization Problem
Reply #4 - Oct 18th, 2005 at 10:45pm
Print Post Print Post  
Ray,

example would be 100,000 loan
                              6% rate
                              30 year or 360 months
                              payment should be 599.55
any help would be appreciated

glenn and james
  
Back to top
 
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Amoritization Problem
Reply #5 - Oct 19th, 2005 at 2:52am
Print Post Print Post  
Don't know how you are interfacing, or what you are doing, but here is an online amortization calulator:

http://www.hsh.com/calc-amort.html

You can get the same resulting page without the input steps by entering the following URL line when starting your browser with@shell.........

http://www.hsh.com/cgi-bin/flap.cgi?prin=100000∫=6&term=30&strt=Jan&stry=2...

Just enter desired variables for prin, int, term values,
Enter values for starting month and year for detailed schedule vs. just the amount.
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Amoritization Problem
Reply #6 - Oct 19th, 2005 at 1:32pm
Print Post Print Post  
Quote:
Ray,

example would be 100,000 loan
                              6% rate
                              30 year or 360 months
                              payment should be 599.55
any help would be appreciated

glenn and james



For compatibility purposes, Sesame's @PMT function works identically to the one in Q&A. By converting the 6% APR to a monthly rate, I get $589.37. However, this differs slightly from your number.

I looked up the formula used by the online calculators (which match your numbers). By using this formula in SBasic, I was able to match the results provided by an online mortgage calculator.

Code
Select All
Function CalcPayment(vRate as Double, vMonths as Double, vPrincipal as Double) as Double
var vPmt as Double
var vInterest as Double


	vInterest = (vRate / 1200)
	vPmt = (vInterest + (vInterest / (@EXP(1 + vInterest, vMonths) - 1))) * vPrincipal
	Return(vPmt)

End Function 



So, the following line of code would print the result you expect.

Code
Select All
WriteLn(CalcPayment(6, 360, 100000)) 



If you want to see the math, the formula is available here:
http://www.1728.com/loanform.htm
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Amoritization Problem
Reply #7 - Oct 19th, 2005 at 3:31pm
Print Post Print Post  
BTW, the difference appears to be the way that the annual rate is converted to the monthly rate. If I convert the annual rate to monthly using the "online" way (which is to simply divide by 12), then @PMT gives the correct result.

Code
Select All
var vRate as Double

	vRate = 6 / 1200
	WriteLn(@PMT(100000, vRate, 360))
 



  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged