Was wondering if anyone can point me to an open source java quant library that provides implementation for Excel Price and Yield functions.
Thanks,
Tapasvi
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The Excel PRICE function is a simple sum of discounted cash flows, discounted assuming a flat zero rate discounting curve. It is documented here: Excel Help / PRICE.
I wrote a small Java version of the function, which I am posting below. The Java version just takes a “time to maturity” and does not support different daycountings, while the Excel PRICE function takes a settlement date and maturity date and supports different daycountings. However, you can attribute for the different daycountings by converting the coupon. Note also that the Excel function has a strange hardcoded notional of 100 in front of the coupon.
An Excel sheet benchmarking the two implementations can be downloaded here. The sheet requires “Obba”.
The Excel YIELD function is just a Newton solver applied to the PRICE function, see Excel Help / YIELD. A Java implementation of the Newton solver can be found at finmath.net.