I have forgotten
my Password

Or login with:

  • Facebookhttp://facebook.com/
  • Googlehttps://www.google.com/accounts/o8/id
  • Yahoohttps://me.yahoo.com
COST (GBP)
this unit 2.81
sub units 12.67
+
0
FinanceBanking

interest Security

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

Dependents

Info

Interface

C++

InterestSecurity

 
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: where:
  • rate is the interest rate for the security,
  • redemption is the amount to be received at maturity,
  • investment is the amount invested in the security,
  • B is the number of days in the year, depending on the year
basis,
  • and DIM is the number of days from settlement to maturity.

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

Source code is available when you buy a Commercial licence.

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