2
$\begingroup$

I'm using QuantLib (python version) for options pricing, and am trying to figure out how to handle non integer dates. If you try and price an option at 9:30 AM and at 4 PM, you should get different prices, but I don't know what the best way to handle this in QuantLib would be.

You could perhaps try running it with that date as the calculation date, and the date after as the calculation date, and then try and interpolate the prices? But then this might run into weird issues around dividends, etc.

$\endgroup$

1 Answer 1

3
$\begingroup$

QuantLib has support for intraday calculations, but it's not enabled by default because it makes the library slower. Unfortunately, it's not a runtime switch: you'll have to recompile QuantLib and its Python module.

General instructions for that are at https://www.quantlib.org/install.shtml; you'll have to configure the intraday option depending on the build system you use:

  • if you're on Linux or MacOS and use ./configure, you'll have to pass the flag --enable-intraday;
  • if you're on Windows and use Visual C++, you'll have to open the file ql/userconfig.hpp and uncomment the line #define QL_HIGH_RESOLUTION_DATE;
  • if you're using cmake on any platform, you'll have to pass the option -DQL_HIGH_RESOLUTION_DATE=ON to your initial cmake invocation.
$\endgroup$

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.