Questions tagged [quantlib]

QuantLib is a free and open-source library for quantitative finance.

QuantLib is a free and open-source library for quantitative finance. Originally written in C++, it has since been ported to several other languages, including C#, Java, Python, and R.

References

399 questions
1
vote
1 answer

Having trouble to get the right yield with fixedRateBond.bondYield in QuantLib

I'm trying to figure out how to estimate bond yield using its price with QuantLib. There are a lot of different examples, but I could not still find the right solution. I have a bond maturing in March 2039, which pays coupons every 182 days. I…
Alex
  • 59
  • 7
1
vote
2 answers

OAS Quantlib of Callable Bond

I am attempting to determine the OAS of of a callable bond in QuantLib. However, my results are always negative!? I am wondering if there is some issue in the call schedule, as the bond yield returned from pricing the bond under the Hull White model…
Paddy
  • 91
  • 7
1
vote
1 answer

Pricing an FX option using the Garman-Kohlagen Process in QuantLib Python

I am trying to price a European FX call option using QuantLib in Python. The domestic risk-free rate is 0.16%. The foreign risk-free rate is -0.46%. The valuation date is 30 June 2020. The deal date is 25 June 2020. The exercise date is 2 July…
ql.user2511
  • 369
  • 2
  • 12
1
vote
1 answer

Pricing of Asian Option using the Heston Model using QuantLib Python

I am trying to price an Asian option with a Geometric average type using QuantLib. However, I can't seem to be able to compute the NPV or any Greek. I get the following error RuntimeError: wrong argument type Please find the codes below. The line…
ql.user2511
  • 369
  • 2
  • 12
1
vote
0 answers

How to apply scipy.optimize.minimize on heston model calibrations

I am looking to calibrate the Heston model daily using scipy.optimize.minimize() over a period of time. Some basic background information; I have collected information on 250.000 option trades over almost 4 years (so approx. 150 trades a day) and am…
1
vote
0 answers

Why do I get different results from different credit pricing engines in QuantLib

I am trying to use three credit pricing engines: IsdaCdsEngine, MidPointCdsEngine and IntegralCdsEngine but I am getting different NPV results from each of them. The case is like this: When I have as an input same cds spread values for different…
Amel B
  • 25
  • 9
1
vote
2 answers

Problem installing QuantLib on MacOS Big Sur: ./configure cannot find boost header/library

Hi fellow QuantLib users, I am trying to install QuantLib on my iMac running Big Sur, following the (somewhat outdated?) steps here: https://www.quantlib.org/install/macosx.shtml Issue: Despite having installed boost, I am getting the following…
1
vote
0 answers

Pricing credit loss for amortizing floating rate bond in QuantLib and Python

I am new to QuantLib, and I am trying to price a credit-sensitive amortizing floating-rate bond. The final payment for the bond may be less than par. If I price a non-amortizing floating-rate bond, I can use the class FloatingRateBond and the…
1
vote
0 answers

Quantlib: Vol surface, different strike levels for different tenors

I want to build an implied vol surface w/ Quantlib. I notice BlackVarianceSurface class can take in a strike list, an expiration list and a volMatrix as input. However, what if I want to set different strikes for different tenors? In the below…
zerra123
  • 15
  • 3
1
vote
1 answer

QuantLib-SWIG-1.19 python 'from . import _QuantLib' fails

I downloaded QuantLib-SWIG-1.19 for Windows 10 . I was able to build and install the python version. But it fails the test when it tries to run build_ext. SET QL_DIR=C:\Users\admuser\Workspace\QuantLib-1.19 SET…
Gerard N
  • 59
  • 6
1
vote
0 answers

AttributeError: module 'QuantLib._QuantLib' has no attribute 'delete_SwigPyIterator' in python

I just finished compiling QuantLib in Visual Studio and by installing module via SWIG. Testing and everything worked fine. Now in Spyder, when I want to import QuantLib, I get the following error: AttributeError: module 'QuantLib._QuantLib' has no…
Lorcan
  • 11
  • 1
1
vote
2 answers

Building QuantLib python bindings on windows 7: 'unrecognized command line option '-mno-cygwin''

I'm trying to build the QuantLib Python bindings. I managed to build QuantLib using these instructions (I found the libboost_serialization files here). When I try python setup.py build, I get the following error python setup.py build running…
John Salvatier
  • 3,077
  • 4
  • 26
  • 31
1
vote
1 answer

QuantLib-python pricing barrier option using Heston model

I have recently started exploring the QuantLib option pricing libraries for python and have come across an error that I don't seem to understand. Basically, I am trying to price an Up&Out Barrier option using the Heston model. The code that I have…
Lorenzo R
  • 11
  • 2
1
vote
1 answer

Is the implied volatility in QuantLib independent of the pricing engine?

This might be a stupid question as I just started looking into QuantLib. (I'm using the python API.) It seems that the implied volatility calculation does not require a pricing engine. If so, which pricing engine is used? I am interested in the…
spark
  • 365
  • 1
  • 3
  • 7
1
vote
0 answers

QuantLib par swap rates to zero rates to par swap rates

I built a zero-coupon curve out of a generic par swap rate curve (Step 1) and I am trying to recover the swap curve back from the zero-coupon curve (Step 2). Step 1 works but not Step 2. I get close quotes but they do not exactly match. Anyone has…
Jessica F.
  • 13
  • 1
  • 5