financebanking

coupon Days After Set

Available under GPL (Free) and Commercial licence
get a GPL licence
COST (GBP)
this unit 1.00
sub units 18.95
add a commercial licence to your cart
0
viewed 1471 times and licensed 12 times
www.codecogs.com/d-ox/finance/banking/coupondaysafterset.php
Other modules that are used by this module. We add these to the cart for you whenever you add this module, unless you already own enough licences for them. Click for details
Controller: will    Contact Controller

Interface

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

using namespace Finance::Banking;

int couponDaysAfterSet (int sett,                int mat,                Finance::Banking::YearlyFreq freq,                Finance::Banking::YearBasis basis=yb_USA)
Return the number of days after the settlement until the next coupon date. Excel: COUPDAYSNC

Function Documentation

 
intcouponDaysAfterSetintsett
intmat
Finance::Banking::YearlyFreqfreq
Finance::Banking::YearBasisbasis = yb_USA )
This function computes the number of days from the settlement date to the next coupon date. The year basis is taken into account.

For a security, the settlement date is the date after issue when the security is traded to the buyer. The maturity date is the date at which the security expires.
Example:
#include <stdio.h>
 
#include <codecogs/units/date/date.h>
#include <codecogs/units/date/dateymd.h>
#include <codecogs/finance/banking/coupondaysafterset.h>
 
int main(void)
{
  int settDate=Units::Date::date(1998, 1, 25);
  int maturityDate=Units::Date::date(1999, 11, 15);
 
  int days=Finance::Banking::couponDaysAfterSet(settDate,
                                                maturityDate,
                                                Finance::Banking::yf_SemiAnnual,
                                                Finance::Banking::yb_Act);
  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("days after settlement=%i\n", days);
 
  return 0;
}
Output:
settlement=1998/1/25
maturity=1999/11/15
days after settlement=110
Parameters:
settThe settlement date, expressed as a serial Julian date.
matThe maturity date of the settlement, expressed as a serial Julian date.
freqThe frequency with which payments are made: The yearly frequency to be used in financial calculations
TypeDescription
yf_Annual Payments are made annually.
yf_SemiAnnual Payments are semi-annual (2 per year).
yf_Quarterly Payments are quarterly (4 per year).
basisThe year basis to use for the calculation:
TypeValueDescription
yb_US0US (NASD) 30/360 - As with the European 30/360 (yb_EU, with the additional provision that if the end date occurs on the 31st of a month it is moved to the 1st of the next month if the start date is earlier than the 30th.
yb_Act1Uses the exact number of elapsed days between the two dates, as well as the exact length of the year.
yb_Act3602Uses the exact number of elapsed days between two dates but assumes the year only have 360 days
yb_Act3653Uses the exact number of elapsed days between two dates but assumes the year always has 365 days
yb_EU4European 30/360 - Each month is assumed to have 30 days, such that the year has only 360 days. Start and end dates that occur on the 31st of a month become equal to the 30th of the same month.
Returns:
The number of days to the next coupon date.
Authors:
James Warren (August 2005)
Source Code:
Register

- To get code register with CodeCogs. Already a Member, then Login.


Last Modified: 10 Apr 08 @ 19:03     Page Rendered: 2008-05-09 15:37:37

Page Comments

  You must login to leave a messge


Valid CSS!   Valid XHTML 1.0 Transitional