IFinance.TBillYield

Syntax

TBillYield(Settlement: DateTime, Maturity: DateTime, Price: Double): Double;

TBillYield(Settlement: System.DateTime, Maturity: System.DateTime, Price: double): double;

Parameters

Settlement. The treasury bill's settlement date

Maturity. Maturity date for the Treasury bill

Price. The price per $100 face value  for a treasury bill.

Description

The TBillYield method returns yield for a treasury bill.

Comments

The Settlement parameter value should not be less than the Maturity parameter value.

Value of the Price parameter must be positive.

The method is calculated as follows:

,

where:

Example

To execute the example, add a link to the MathFin system assembly.

Sub UserProc;
Var
    r: Double;
Begin
    r := Finance.
TBillYield(DateTime.ComposeDay(2007,01,01), DateTime.ComposeDay(2008,09,01), 87.79);
    Debug.WriteLine(r);
End Sub UserProc;

Imports Prognoz.Platform.Interop.MathFin;

Public Shared Sub Main(Params: StartParams);
Var
    r: double;
    Finance: FinanceClass = New FinanceClass();
    DateTime1, DateTime2: System.DateTime;
Begin
    DateTime1 := New DateTime(2007,01,01);
    DateTime2 := New DateTime(2008,09,01);
    r := Finance.TBillYield(DateTime1, DateTime2, 87.79);
    System.Diagnostics.Debug.WriteLine(r);
End Sub;

After executing the example the console window displays the yield equal to 0.0834.

See also:

IFinance