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

Valid RSS

FinanceBanking

bill Yield

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

Calculate the yield for a treasury bill. Excel: TBILLYIELD

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

Interface

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

using namespace Finance::Banking;

double billYield (int sett, int mat, double price)
Calculate the yield for a treasury bill. Excel: TBILLYIELD
ExcelReal cc_billYield (Integer sett, Integer mat, Real price)
This function is available as a Microsoft Excel add-in.

Function Documentation

Bill Yield Calculator
  
Add calculator to website or email
 
doublebillYieldintsett
intmat
doubleprice )
This function calculates the yield for a treasury bill. It is equivalent to the Microsoft Excel function TBILLYIELD. The following equation is used to calculate the result:
yield =  \frac{100-pr}{pr} * \frac{360}{DSM}

Where: yield is the yield of the treasury bill, pr is the price per 100 (currency units) face value, and DSM is the number of days from settlement to maturity.

Example:

#include <iostream>
 
#include <codecogs/units/date/date.h>
#include <codecogs/units/date/dateymd.h>
#include <codecogs/finance/banking/billyield.h>
 
int main()
{
  int settDate=Units::Date::date(1999, 3, 31);
  int maturityDate=Units::Date::date(1999, 6, 1);
  double yield=Finance::Banking::billYield(settDate, maturityDate, 98.45);
  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("bill yield=%f\n", yield);   return 1; }
Output:
settlement=1999/3/31
maturity=1999/6/1
bill yield=0.091417

References:

Microsoft Excel help file

This is the date after issue when the treasury bill is traded to the buyer.

Julian date. This is the date when the treasury bill expires.

(expressed in the appropriate currency units).

Note:
maturity dates more than 1 yeaer after the settlement date cause an error message to be issued.
Parameters:
settThe settlement date, expressed as a serial Julian date.
matThe maturity date of the settlement, expressed as a serial
priceThe price per 100 face value of the treasury bill
Returns:
The yield of the treasury bill.
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-09 02:44:38

Valid CSS!   Valid XHTML 1.0 Transitional