OddfYield(Settlement: DateTime; Maturity: DateTime; Issue: DateTime; FirstCouponDate: DateTime; Rate: Double; PresentValue: Double; Redemption: Double; Frequency: Integer; [Basis: Integer = 0]): Double;
OddfYield(Settlement: System.DateTime; Maturity: System.DateTime; Issue: System.DateTime; FirstCouponDate: System.DateTime; Rate: double; PresentValue: double; Redemption: double; Frequency: integer; Basis: integer): double;
Settlement. The payment day on securities. Must be greater than Issue.
Maturity. The security's maturity date. Must be greater than FirstCouponDate.
Issue. The security's issue date. Must be less than Settlement
FirstCouponDate. Securities first coupon date. Must be greater than Settlement.
Rate. Annual interest rate for coupons on securities. Must be positive.
PresentValue. The value of securities. Must be positive.
Redemption. The security's redemption price per $100 face value. Must be positive.
Frequency. The annual number of coupon payments. The parameter can take the following values:
1. Annual payments.
2. Semi-annual payments.
4. Quarterly payments.
Basis. The day calculation method used. Select a value from 0 to 4:
0. The day calculation method - American/360 days (NSAD method).
1. The day calculation method - Actual/actual.
2. The day calculation method - Actual/360 days.
3. The day calculation method - Actual/365 days.
4. The day calculation method - European 30/360 days.
The OddfYield method returns profit for securities with irregular - short or long - first period.
To get a price for 100$ of nominal securities value for irregular - short or long - first period, use the IFinance.OddfPrice method.
Add a link to the MathFin system assembly.
Sub UserProc;
Var
r: Double;
Begin
r := Finance.OddfYield(DateTime.ComposeDay(2008,11,11), DateTime.ComposeDay(2021,03,01),
DateTime.ComposeDay(2008,10,15), DateTime.ComposeDay(2009,03,01), 0.1075, 145.5, 200, 4, 3);
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, DateTime3, DateTime4: System.DateTime;
Begin
DateTime1 := New DateTime(2008,11,11);
DateTime2 := New DateTime(2021,03,01);
DateTime3 := New DateTime(2008,10,15);
DateTime4 := New DateTime(2009,03,01);
r := Finance.OddfYield(DateTime1, DateTime2, DateTime3, DateTime4, 0.1075, 145.5, 200, 4, 3);
System.Diagnostics.Debug.WriteLine(r);
End Sub;
After executing the example the console window displays the profit equal to 9.07%.
See also: