financebanking

bill Price

Available under GPL (Free) and Commercial licence
get a GPL licence
COST (GBP)
this unit 0.90
sub units 5.40
add a commercial licence to your cart
0
viewed 1915 times and licensed 11 times
www.codecogs.com/d-ox/finance/banking/billprice.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: CodeCogs    Contact Controller

Interface

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

using namespace Finance::Banking;

double billPrice (int sett, int mat, double rate)
Calculate the price per 100 units face value of a treasury bill. Excel: TBILLPRICE
Click for details on using CodeCogs in ExcelReal cc_billPrice (Integer sett, Integer mat, Real rate)
This function is available as a Microsoft Excel add-in.

Function Documentation

Bill Price Calculator

  

Add calculator to your site or email
 
doublebillPriceintsett
intmat
doublerate )
Return the price per 100 (currency units) face value of a treasury bill. This function is equivalent to the Microsoft Excel function TBILLPRICE.

The following equation is used:

(1)
\displaystyle price = 100 * (1 - \frac{rate * DSM}{360})

Where: price is the price per 100 face value of the treasury, rate is the discount rate of the treasury bill, DSM is the number of days from settlement to maturity.

References:
Microsoft Excel help file
Example:
#include <stdio.h>
#include <codecogs/units/date/date.h>
#include <codecogs/finance/banking/billprice.h>
 
int main(int argc, char *argv[])
{
  int settDate=Units::Date::date(1999, 3, 31);
  int maturityDate=Units::Date::date(1999, 6, 1);
  double result=Finance::Banking::billPrice(settDate, maturityDate, 0.09);
  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("treasury bill price=%f\n\n", result);
 
  settDate=Units::Date::date(2005, 8, 9);
  maturityDate=Units::Date::date(2005, 12, 30);
  result=Finance::Banking::billPrice(settDate, maturityDate, 0.11);
  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("treasury bill price=%f\n", result);
  return 0;
}
Output:
settlement=1999/3/31
maturity=1999/6/1
treasury bill price=98.45
 
settlement=2005/8/9
maturity=2005/12/30
treasury bill price=95.661111
Parameters:
settThe settlement date, expressed as a serial Julian date. This is the date after issue when the treasury bill is traded to the buyer.
matThe maturity date of the settlement, expressed as a serial Julian date. This is the date when the treasury bill expires.
rateThe discount rate of the treasury bill.
Returns:
The previous coupon date of the security.
Note:
maturity dates more than 1 yeaer after the settlement date cause an error message to be issued.
Authors:
James Warren (August 2005)
Source Code:
Register

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


Last Modified: 18 Oct 07 @ 17:07     Page Rendered: 2008-05-14 09:32:05

Page Comments

  You must login to leave a messge


Valid CSS!   Valid XHTML 1.0 Transitional