RedemptionYield(
Price: Double;
AccumulateIncome: Double;
CouponsDates: Array;
Coupons: Array;
PaymentsDates: Array;
Payments: Array;
Settlement: DateTime): Double;
RedemptionYield(
Price: double;
AccumulateIncome: double;
CouponsDates: System.Array;
Coupons: System.Array;
PaymentsDates: System.Array;
Payments: System.Array;
Settlement: System.DataTime): double;
Parameters | Description | Constraints |
Price | Bond price. | Must be positive. |
AccumulateIncome | Accumulated coupon income. | Cannot be negative. |
CouponsDates | Array with payment dates by coupon. | It is required to use an array of the DateTime type. |
Coupons | Array with coupons' size. | It is required to use an array of the Double type. |
PaymentsDates | Array with payment dates of face value. | It is required to use an array of the DateTime type. |
Payments | Array with payment size of face value. | It is required to use an array of the Double type. |
Settlement | Date at which the calculation is performed. | Must be less than each element of the CouponsDates and PaymentsDates arrays. |
The RedemptionYield method returns effective redemption yield.
Effective bill rate is calculated based on calculating of the following equation:
Where:
P. Bond price.
A. Accumulated coupon income.
Y. Effective redemption yield, with annual interest.
ti. The number of days to payment of the i-th coupon.
n. Number of coupons.
rj. The date before the j-th payment of principal value (in days).
m. Number of payments for the principal debt amount.
Ci. Size of the appropriate coupon.
Nj. Size of the payment corresponding to the payment date of face value.
The equation is solved for the Y variable, which is to be found.
The size of the CouponsDates array must correspond to the size of the Coupons array.
The size of the PaymentsDates array must correspond to the size of the Payments array.
Add link to the MathFin system assembly.
Sub UserProc;
Var
Price, AccumulateIncome, Result: Double;
CouponsDates: Array[5] Of DateTime;
Coupons: Array[5] Of Double;
PaymentsDates: Array[2] Of DateTime;
Payments: Array[2] Of Double;
Settlement: DateTime;
Begin
// Bond price
Price := 1150;
// Accumulated income by coupons
AccumulateIncome := 40;
// Array with payment dates by coupon
CouponsDates[0] := DateTime.ComposeDay(2006, 1, 1);
CouponsDates[1] := DateTime.ComposeDay(2006, 4, 1);
CouponsDates[2] := DateTime.ComposeDay(2006, 7, 1);
CouponsDates[3] := DateTime.ComposeDay(2006, 10, 1);
CouponsDates[4] := DateTime.ComposeDay(2007, 1, 1);
// Array with coupon sizes
Coupons[0] := 80;
Coupons[1] := 80;
Coupons[2] := 80;
Coupons[3] := 80;
Coupons[4] := 80;
// Array with payment dates of face value
PaymentsDates[0] := DateTime.ComposeDay(2007, 1, 1);
PaymentsDates[1] := DateTime.ComposeDay(2007, 4, 1);
// Array with face value payments
Payments[0] := 500;
Payments[1] := 500;
Settlement := DateTime.ComposeDay(2005, 11, 15); // Date, to which calculation is executed
// Method result string
Result := Finace.RedemptionYield(Price, AccumulateIncome, CouponsDates, Coupons, PaymentsDates, Payments, Settlement);
debug.WriteLine(Result); // Output result into console window
debug.WriteLine(Finance.ErrorMsg);
End Sub UserProc;
After executing the example the console window displays the effective yield equal to 16.51%.
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
Price, AccumulateIncome, Result: Double;
CouponsDates: Array[5] Of DateTime;
Coupons: Array[2] Of Double;
PaymentsDates: Array[5] Of DateTime;
Payments: Array[2] Of Double;
Settlement: DateTime;
IFinance: Prognoz.Platform.Interop.MathFin.IFinance;
Begin
// Bond price
Price := 1150;
// Accumulated income by coupons
AccumulateIncome := 40;
// Array with payment dates by coupon
CouponsDates[0] := DateTime.Parse("1.1.2006");
CouponsDates[1] := DateTime.Parse("4.1.2006");
CouponsDates[2] := DateTime.Parse("7.1.2006");
CouponsDates[3] := DateTime.Parse("10.1.2006");
CouponsDates[4] := DateTime.Parse("1.1.2007");
// Array with coupon sizes
Coupons[0] := 80;
Coupons[1] := 80;
Coupons[2] := 80;
Coupons[3] := 80;
Coupons[4] := 80;
// Array with payment dates of face value
PaymentsDates[0] := DateTime.Parse("1.1.2007");
PaymentsDates[1] := DateTime.Parse("4.1.2007");
// Array with face value payments
Payments[0] := 500;
Payments[1] := 500;
Settlement := DateTime.Parse("11.15.2005"); // Date, at which calculation is executed
Result := IFinance.RedemptionYield(Price, AccumulateIncome, CouponsDates, Coupons, PaymentsDates, Payments, Settlement); // Method result string
System.Diagnostics.Debug.WriteLine(Result); // Output result into console window
System.Diagnostics.Debug.WriteLine(Finance.ErrorMsg);
End Sub;
See also: