CodeCogs - An iteractive open source Numerical library Welcome... Login
CodeCogs
shopping cart
OSXWindowsLinux
Search CodeCogs
Numerical Components

Valid RSS

FinanceBanking

interest Security

Only available under a commercial licence
COST (GBP)
this unit 2.34
sub units 11.12
add a commercial licence to your cart
0
viewed 1337 times

Return the interest rate for a fully invested security. Excel: INTRATE

Further Info Controller: CodeCogs  Contact Controller
+View version details
Contents hide toc
buy now     add cart

Interface

#include <codecogs/finance/banking/interestsecurity.h>

using namespace Finance::Banking;

double interestSecurity (int sett, int mat, double investAm, double redemAm, Finance::Banking::YearBasis basis=yb_USA)
Return the interest rate for a fully invested security. Excel: INTRATE

Function Documentation

 
doubleinterestSecurityintsett
intmat
doubleinvestAm
doubleredemAm
Finance::Banking::YearBasisbasis = yb_USA )
Returns the interest rate for a fully invested security. The function works using the following equation:
rate = \frac{redemption-investment}{investment} * \frac{B}{DIM}
where: basis,
Example 1:
#include <iostream>

#include <codecogs/units/date/date.h> #include <codecogs/units/date/dateymd.h> #include <codecogs/finance/banking/interestsecurity.h>

int main(int argc, char *argv[]) { int settDate=Units::Date::date(1999, 2, 15); int maturityDate=Units::Date::date(1999, 5, 15);

double intRate=Finance::Banking::interestSecurity(settDate, maturityDate, 1000000, 1014420, Finance::Banking::yb_Act360);   int y, m, d; Units::Date::dateYMD(settDate, y, m, d); printf("settlement=%i/%i/%i\n", y, m, d);

Units::Date::dateYMD(maturityDate, y, m, d); printf("maturity=%i/%i/%i\n", y, m, d);

printf("interest rate=%f", intRate); return 1; }
Output:
settlement=1999/2/15
maturity=1999/5/15
interest rate=0.058328

Julian date. This is the date after issue when the security is traded to the buyer.

Julian date. The maturity date is the date when the security expires.

Note:
The day count basis is specified using the basis parameter. This basis can be any of the following: yb_USA, yb_EU, yb_Act, yb_Act360 or yb_Act365.
Parameters:
settThe settlement date of the security, expressed as a serial
matThe maturity date of the security, expressed as a serial
investAmThe amount invested in the security.
redemAmThe amount to be received at maturity.
basisThe day count basis to use. See YearBasis
Returns:
The interest rate for the security.
Authors:
James Warren (August 2005)
Source Code:

To view or download source code you need to buy a Commercial licence.

buy now     add cart

Not a member, then Register with CodeCogs. Already a Member, then Login.


Page Comments

Format Excel Equations

  You must login to leave a messge


Last Modified: 18 Oct 07 @ 17:07     Page Rendered: 2010-03-14 04:00:09

Valid CSS!   Valid XHTML 1.0 Transitional