Post Reply 
Finance in Prime: odd period...
05-22-2015, 01:48 PM (This post was last modified: 05-22-2015 05:36 PM by salvomic.)
Post: #4
RE: Finance in Prime: odd period...
(05-21-2015 08:39 PM)Terje Vallestad Wrote:  ... at the start of the 36 month period you need to add the accrued interest for 16 days which is 4500x0.05/12*16/30 -> 10

So using N=36, PV=-4510 and I=5% you arrive at PMT= 135.17
Cheers, Terje

hi Terje,
a first version of a program to calculate odd period with the Prime, giving that period and all parameters to call Finance.CalcPMT() to get TVM *with* "odd period" added, like you say...
For now the program check for Financial/Actual (360/365) year, BEGIN/END, it calculates date with DDAYS (for actual year) or my formula (financial year: 30*(mm2-mm1)+dd2-dd1; it works well in my Simple Interest program, on HP Software Library of the Forum), "odd period" only with simple interest, not still with compound option...
In the evening I hope to add this option or more.
If you want, please, check it. Any advice is welcome Smile

Salvo

Code:

EXPORT odd_period()
BEGIN
local days1, days2, n, flg, r;
local dd1, dd2, mm1, mm2, yy1, yy2;
local pv, beg, inte, pmt, anno,gg;

input ({ {dd1,[0],{15,15,1}}, 
{mm1,{"1","2","3", "4", "5", "6", "7", "8", "9", "10", "11", "12"}, {40,15,1}}, 
{yy1,[0],{70,15,1}},
{dd2,[0],{15,15,3}}, 
{mm2,{"1","2","3", "4", "5", "6", "7", "8", "9", "10", "11", "12"}, {40,15,3}}, 
{yy2,[0],{70,15,3}},
{pv, [0], {15,15,4}}, 
{n, [0], {40,15,4}},{r,[0],{70,15,4}},
{beg,0, {20,2,5}}, {flg,0,{80,2, 5}}
}, 
"Calc difference days", {"d1", "m1", "y1", "d2", "m2", "y2", 
"PV", "N","r%", "End","Financial"}, 
{"Day 1", "Month 1", "Year 1", "Day 2", "Month 2", "Year 2", 
"Present value", "Yearly pmt n", "Yearly rate%", 
"Begin or End", "Financial year (360)"
}, 
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0}, 
{1, 1, 2015, 1, 1, 2015, 1000, 36, 5, 1, 1} );
dd1:=EVAL(dd1); mm1:=EVAL(mm1);
dd2:=EVAL(dd2); mm2:=EVAL(mm2);
yy1:=EVAL(yy1); yy2:=EVAL(yy2);
days1 := yy1+mm1/100+dd1/10000;
days2 := yy2+mm2/100+dd2/10000;
IF (flg==0) THEN // Actual year
gg:= DDAYS(days1, days2);
anno:=365;
ELSE // Finacial year
gg:= 30*(mm2-mm1)+dd2-dd1;
anno:=360;
END; //if
inte:=(pv*(r/100)*(gg))/anno;
pmt:=Finance.CalcPMT(n, r, (-(pv+inte)),0,12,12,beg);
RETURN pmt;
END;

∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Finance in Prime: odd period... - salvomic - 05-21-2015, 10:40 AM
RE: Finance in Prime: odd period... - salvomic - 05-22-2015 01:48 PM
RE: Finance in Prime: odd period... - DrD - 05-23-2015, 10:21 AM
RE: Finance in Prime: odd period... - DrD - 05-23-2015, 01:00 PM



User(s) browsing this thread: 12 Guest(s)