FUNCTION
billBondEquiv
Return the bond-equivalent yield for a treasury bill. <span align="right" style="background-color:99FF99"><strong>Excel: TBILLEQ</strong></span>
You're viewing an older version of this page (#300). View the current version.
Interface
#include <codecogs/finance/banking/billbondequiv.h>
using namespace Finance::Banking;
This function calculates the bond-equivalent yield for a treasury bill. It does so using the following equation:
Where: rate is the discount rate, DSM is the number of days between settlement and maturity, computed according to the 360-day year basis. The actual date difference function used is dateDiff360, in dd_USA mode.
References
Microsoft Excel help file
Example 1
#include <iostream>
#include <codecogs/units/date/date.h>
#include <codecogs/finance/banking/yearlyfreq.h>
#include <codecogs/finance/banking/billbondequiv.h>
int
main(int argc, char *argv[])
{
int settDate=Units::Date::date(1999, 3, 31);
int maturityDate=Units::Date::date(1999, 6, 1);
double yield=Finance::Banking::billBondEquiv(settDate,
maturityDate,
0.0914);
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("bond equivalent yield=%f\n", yield);
exit(EXIT_SUCCESS);
}Output:
settlement=1999/3/31
maturity=1999/6/1
bond equivalent yield=0.094151Parameters
serial Julian date.
Returns
Interactive Calculator
Computing…
Set a range above first to export a graph.