I have been playing with QuantLib for some time. This is a great framework with amazing design and capabilities. However, one thing that I find hard to understand is the way it handles the price of option on maturity date. As far as I understand, it simply equates option price to zero on maturity date. However, I find this behavior is kind of awkward in some certain situations. Will it be better off if the framework figures out something else, e.g. the intrinsic value of the option on the maturity date, rather than just a zero.

So my question is is there any globe settings can be used to override this behavior?

If the answer is yes, please kindly instruct how to do it? If no, please kindly explain the reason behind this?

Thanks in advance!


1 Answer 1


As you saw, the default behavior is to consider the option expired at the exercise date, so the NPV is null. You can override this behavior by executing

Settings::instance().includeReferenceDateEvents() = true;

After the above, the option will be considered alive at exercise date. I'm not sure that all pricing engines will manage the case $T=0$ correctly (they might), but I checked that at least AnalyticEuropeanEngine does and will return the intrinsic value.

  • 1
    $\begingroup$ Thank you very much Dr. Ballabio. Also, when using QuantLib in Python, the corresponding setting should be achieved as follows: import QuantLib as ql ql.Settings.instance().includeReferenceDateEvents = True $\endgroup$
    – funnycrab
    Commented Mar 22, 2016 at 2:49
  • $\begingroup$ I have not been able to get this to work (in Python) with FdBlackScholesVanillaEngine. QL throws an error, in fact: "RuntimeError: end must be large [sic] than start" $\endgroup$
    – Drew
    Commented Jun 11, 2020 at 2:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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