3
$\begingroup$

I have newly started with Quantlib-Python for valuing derivatives. In all the examples stated in this bolg or in other places, market quote is inserted and bootstrapping is done via individual rate helpers to create the zero curve.

Is there a way I can directly insert the zero rates in Quantlib so that it can interpolate from the zero rates and give the final NPV.

$\endgroup$
2
$\begingroup$

If you already have the zero rates, you can construct the zero curve using the set of maturities (dates) and zero rates values, in addition to a day count convention in this way:

import QuantLib as ql
ql.Settings.instance().evaluationDate = ql.Date(26, 7, 2018)
dates = [ql.Date(26, 7, 2019), ql.Date(26, 7, 2020), ql.Date(26, 7, 2030)]
zero_rates = [0.03, 0.04, 0.06]
zero_curve = ql.ZeroCurve(dates, zero_rates, ql.Actual365Fixed())

I don't understand what NPV you are looking for though? The NPV will be related to an instrument, not to a zero curve.

$\endgroup$
  • 1
    $\begingroup$ I meant valuation, not looking for NPV, it was a mistake, thanks $\endgroup$ – amitbisai Jul 27 '18 at 11:17
  • $\begingroup$ Welcome. Glad I was able to help! $\endgroup$ – byouness Jul 27 '18 at 12:11

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.