OddfPrice(Settlement: DateTime;
Maturity: DateTime;
Issue: DateTime;
FirstCouponDate: DateTime;
Rate: Double;
YieldP: Double;
Redemption: Double;
Frequency; Integer;
Basis; Integer): Double;
OddfPrice(Settlement: System.DateTime;
Maturity: System.DateTime;
Issue: System.DateTime;
FirstCouponDate: System.DateTime;
Rate: double;
YieldP: double;
Redemption: double;
Frequency; integer;
Basis; integer): double;
| Parameters | Description | Constraints |
| Settlement | Securities settlement date. | Must be greater than Issue. |
| Maturity | Securities maturity date. | Must be greater than FirstCouponDate. |
| Issue | Securities issue date. | Must be less than Settlement. |
| FirstCouponDate | Securities first coupon date. | Must be greater than Settlement. |
| Rate | Securities interest rate. | Cannot be negative. |
| YieldP | Securities annual profit. | Cannot be negative. |
| Redemption | Redemption price for $100 of principal value. | Must be positive. |
| Frequency | The number of payments for coupons in a year: 1 - For annual payments. 2 - For semi-annual payments. 4 - For quarterly payments. |
Must take the values 1, 2 or 4. |
| Basis | The employed method of day calculation. The following values are available: 0 - American/360 days (NSAD method). 1 - Factual/factual. 2 - Factual/360days. 3 - Factual/365 days. 4 - European 30/360 days. |
Must be in the [0,4] interval. |
The OddfPrice method returns price for 100 rubles of face value of the securities for an irregular (short or long) first period.
OddfPrice is calculated using the following formula.
Irregular short first coupon:
Where:
A - the number of days from coupon period start to settlement date (accumulated days).
DSC - the number of days from settlement date to the next coupon.
DFC - the number of days from irregular coupon to the first coupon date.
E - the number of days in coupon period.
N - the number of paid coupons between settlement date and maturity date. If this number is fractional, it is rounded up to the next integer.
Irregular long first coupon:
Where:
Aj. The number of days from the beginning of the j-th last quasi coupon period in the non-regular period.
DCj. The number of days from the specified date (or issue date) to the first quasi coupon (j = 1) or the number of days in the quasi coupon (j = 2,…, j = NC).
DSC. The number of days from settlement date to the next coupon date.
E. The number of days in the coupon period.
N. The number of paid coupons from the first actual coupon date to the maturity date. (If this number is fractional, it is rounded up to the next integer).
NC. The number of quasi coupon periods, which fits in an irregular period. If this number is fractional, it is rounded up to the next integer.
NLj. Normal length in days of the full j-th or last quasi coupon period in an irregular period.
Nq. The number of full quasi coupon periods from the settlement date to the first coupon.
To execute the example, add a link to the MathFin system assembly.
Sub UserProc;
Var
r: Double;
Begin
r := Finance.OddfPrice(DateTime.ComposeDay(2008,11,11), DateTime.ComposeDay(2021,03,01),
DateTime.ComposeDay(2008,10,15), DateTime.ComposeDay(2009,03,01), 0.1275, 0.1025, 200, 4, 3);
Debug.WriteLine(r);
End Sub UserProc;
After executing the example the console window displays the price equal to 146.115.
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, 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.OddfPrice(DateTime1, DateTime2, DateTime3, DateTime4, 0.1275, 0.1025, 200, 4, 3);
System.Diagnostics.Debug.WriteLine(r);
End Sub;
See also: