TBillEq(Settlement: DateTime; Maturity: DateTime; Discount: Double): Double;
TBillEq(Settlement: System.DateTime; Maturity: System.DateTime; Discount: double): double;
Parameters | Description | Constraints |
Settlement | Date of settlement of a treasurer's bill. | Must be less than Maturity. |
Maturity | Treasury's bill maturity date. | Must be greater than Settlement. |
Discount | Discount for a treasury's bill. | Must be positive. |
The TBillEq method returns yield for a treasury bill equal to a bond.
TBillEq is calculated using the following formula:
Where:
DSM - the number of days between the Settlement and Maturity arguments calculated on the basis of a 360 days year.
To execute the example, add a link to the MathFin system assembly.
Sub UserProc;
Var
r: Double;
Begin
r := Finance.TBillEq(DateTime.ComposeDay(2007,01,01), DateTime.ComposeDay(2008,09,01), 0.05);
Debug.WriteLine(r);
End Sub UserProc;
After executing the example the console window displays the yield equal to 0.0553.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
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.TBillEq(DateTime1, DateTime2, 0.05);
System.Diagnostics.Debug.WriteLine(r);
End Sub;
See also: