Questions tagged [quantlib]
Quantlib is an open-source C++ library for quantitative finance.
447
questions
4
votes
1
answer
1k
views
QuantLib-Python: What is "index = Euribor1Y(term_structure)" doing?
I am currently reading thorugh the QuantLib-Python cookbook to learn about this nice pice of software. On page 141 I encountered a block of code that made me wonder what it is exactly doing.
The code ...
4
votes
1
answer
242
views
Why risk-free interest is needed for Margrabe's Formula?
The source code for Margarble's formula in QuantLib is here. The implementation requires a forward price be computed:
...
4
votes
1
answer
634
views
Interpreting QuantLlib implied volatility numbers
I am using QuantLib to calculate implied volatilities.
I am trying to understand the calculated figures (especially, when compared to historical volatility). The calculated implied volatility numbers ...
4
votes
0
answers
199
views
Bates Model on Quantlib
I am actively trying to price an option using bates model on Quantlib.However,when I input my volatility I find the same Black Prices with the basic Heston Model.I wanted to know if my code was right.
...
4
votes
0
answers
287
views
RQuantLib: any difference between FixedRateBond() and FixedRateBondPriceByYield() with flat term structure?
Please, consider the following functions from RQuantLib package:
FixedRateBond()
...
3
votes
2
answers
3k
views
How to use quantlib with excel?
I installed an quantlib on my mac, but have no idea, how to start using it with an excel. Please advise hoq to do it. I followed all instructions here:
http://quantlib.org/install/macosx.shtml. I ...
3
votes
1
answer
3k
views
SABR Model Pricing Engine in Python QuantLib
I am looking for a SABR model pricing engine in Python QuantLib setting. I do know that it exists in C++ version, but not sure if available in Python. Any suggestion/feedback with respect to Python ...
3
votes
2
answers
4k
views
Excel YIELD function equivalent in python Quantlib
I am struggling to get an equivalent of Excel's YIELD function using Quantlib in python. As you can see from the Excel documentation on YIELD here, only a few parameters are needed compared to this ...
3
votes
1
answer
1k
views
Bootstrapping OIS curve
I am trying to get a zero curve from a series of EONIA-based OIS rates with Quantlib. When comparing my output with Bloomberg, I find some differences (see at the end of the question), and and I don't ...
3
votes
1
answer
793
views
QuantLib Gsr model
Almost spent the whole day. Could anyone give a link to the Gsr model specification that is implemented in QuantLib? Or give an explanation? Any help is highly appreciated.
3
votes
2
answers
2k
views
Why QuantLib computes the fixed-leg swap rate by this formula?
I'm trying to understand how QuantLib creates (bootstraps) a yield curve from a vanilla swap at the source level. I have the following test code:
...
3
votes
1
answer
2k
views
How to sum interest rate curves in QuantLib
C++ code taken from Bonds.cpp and slightly amended:
...
3
votes
1
answer
2k
views
QuantLib error with qlPiecewiseYieldCurveData() on qlPiecewiseYieldCurve() with ZeroYield and ForwardRate
I'm using QuantLibXL to build a discount curve, a zero yield curve and a forward curve of the EURIBOR rate (QuantLibXL is downloadable here).
I've built an object of class ...
3
votes
1
answer
2k
views
Using RateHelper (bootstrapping) and Speed up in Quantlib Python
I am wondering whether it is possible somehow to speed up my script using ratehelpers/bootstrapping. I am creating for every days a new ratehelper. Is there a way building up just once the ratehelper ...
3
votes
1
answer
5k
views
Discounting Curve in Quantlib/Python
I'm using Python 2.7.12 with the QuantLib package. I'm trying to price fixed bonds. I understand how to create a bond object. How to get the "right" discounting curve is kind of a problem. Assuming a ...
3
votes
3
answers
8k
views
How to build a cross currency swap pricer?
We're looking to build a pricer to convert a funding spread in a given currency over a specific funding basis e.g. 20 bps EUR 3m€ and convert it to a funding spread to a different currency with a ...
3
votes
1
answer
971
views
Best way to do multithread Monte-Carlo in QuantLib
QuantLib has great facilities for Monte-Carlo pricing engines, classes McSimulation and MonteCarloModel do a lot of work. But they do it in a single thread. What is best way to introduce parallel run ...
3
votes
1
answer
1k
views
Simulation of Heston process Quantlib-Python
I am wondering weather there exists some method such that one can simulate sample paths for the Heston model in Quantlib-Python. I am currently working on a project that require simulations with the ...
3
votes
1
answer
593
views
TermStructure/Evaluation Dates in Quantlib
i'm puzzled by the way Quantlib handles the evaluation date in the yield term structure classes. I have the following code as example:
...
3
votes
1
answer
5k
views
Quantlib Day Count between dates
Need some help on following items regarding functions in Qunatlib:
Is there any function available to calculate time between two dates with specific day count convention. For Example, I want to know ...
3
votes
1
answer
455
views
Given QuantLib Python VanillaSwap object, how to get the iborIndex of the swap object?
I'm currently using QuantLib Python. Let's say that I've got a VanillaSwap object:
import QuantLib as ql
swap_obj = ql.VanillaSwap(... , iborIndex , ...)
How can ...
3
votes
3
answers
1k
views
Compiling QuantLib example
I have followed the guidlines for installing QuantLib for mac from here http://quantlib.org/install/macosx.shtml and also fixed the flags using the commands:
export CXXFLAGS = -stdlib=libstdc++
...
3
votes
1
answer
2k
views
Quantlib in JavaScript? [closed]
Is there such a thing? Or is there a project around that aims to realize Quantlib in JS? I'm a JS coder and I'd like to get involved if so.
Maybe it seems futile or insane today, but who can doubt ...
3
votes
1
answer
4k
views
Calibration of Theta, A(t) and B(t) of Hull White 1Factor model
I’m simulating interest rates via the HullWhite One factor model. To simulate the short rate I’m using the code from the Quantlib Python Cookbook, chapter 15 and beyond (By Goutham Balaraman and Luigi ...
3
votes
1
answer
685
views
Why Quantlib Option NPV does not change when repricing?
Trying to learn Quantlib with Python, please have a look at below code:
...
3
votes
1
answer
365
views
QuantLib C++: Monte Carlo Engine with SequenceStatistics
I'm trying to implement a Monte Carlo PricingEngine that stores multidimensional statistics.
I have done the following:
Defined a Monte Carlo Trait that among other things stores as the ...
3
votes
1
answer
2k
views
Quantlib: Greeks of FX option in Python
I'm using Quantlib in Python to price an FX option.
I'm comparing the result to Bloomberg, to make sure the code is working correct.
I also want to calculate all the Greeks, and eventually use those ...
3
votes
1
answer
584
views
Bootstrapping discount and forward curve (using ESRA) and price a vanilla swap
I am just starting to use Quantlib, and want to try and replicate the SWPM-functionality in Bloomberg, and price a vanilla 5Y EUR OIS. Below is the overall swap data used in BBG:
Overall settings
...
3
votes
2
answers
900
views
Repricing SOFR Quotes and Non-Zero NPV
I generated/calibrated a SOFR Curve using Quantlib Python and would like to know why when repricing the swaps have non-zero NPVs. Appreciate any assistance. Thank you.
Parameters
...
3
votes
1
answer
910
views
QuantLib: Which CalibrationHelper to use for Normal Volatilities
I am using the SwaptionHelper class to create the swaptions.
Reading the documentation: https://www.quantlib.org/reference/class_quant_lib_1_1_swaption_helper.html
I realize that one of the ...
3
votes
1
answer
2k
views
Basis Swaps in Quantlib/Python
I am aware that I can create a IRS in Quantlib/Python by using the following function:
...
3
votes
1
answer
2k
views
Using QuantLib Python to value FX options using stochastic volatility
I would like to use QuantLib (and in particular the python wrapper) to value FX option using the Heston model. Thanks to http://gouthamanbalaraman.com and all of the articles therein : in particular ...
3
votes
1
answer
638
views
forward + displacement
I I am trying to price a cap/floor using Quantlib in Python.
the initial code from from this website:
http://gouthamanbalaraman.com/blog/interest-rate-cap-floor-valuation-quantlib-python.html
Here is ...
3
votes
1
answer
2k
views
QuantLib CDS pricing error: negative time given
I am new to QuantLib, and I am using it to price CDS. Following is my python code:
...
3
votes
1
answer
688
views
Quantlib - model changes in option value on day of expiry
I'm trying to model option value changes during the progression of the last trading day before expiry. All option pricing Quantlib examples that I've seen work with day-level granularity. I'm ...
3
votes
1
answer
1k
views
Using quantlib to price swaps with different payment and calculation resets for floating leg
I understand the VanillaSwap object assumes that payment and calculation resets are the same, so is there any way we could use quantlib to price a swap with different reset and calculation frequencies?...
3
votes
1
answer
536
views
Quantlib-Python: Can anyone help me understand how enableExtrapolation works?
I found 'enableExtrapolation' in many curve-building examples but can only guess. Can anyone help me to understand it? It will be perfect if there are examples to show how it works. Thank you very ...
3
votes
1
answer
284
views
Quantlib - exercise probability function?
I am using Quantlib to obtain the option value embedded in a convertible bond.
I create an american option as follows:
...
3
votes
1
answer
2k
views
Bootstrap ESTER and SOFR curves with Quantlib Python
Is it possible to bootstrap the new ESTER and SOFR term structures in Quantlib? More in general, does the process work as the usual one? Given these are simple indices that are published on a daily ...
3
votes
1
answer
2k
views
Calculate tenor wise DV01 of a Swap in Quantlib Python, i.e. Key-rate Duration
Is there a way I can get DV01 breakup of a Swap across different tenors of the deal in Quantlib-Python. The question asked here, follows the basic method of re-valuing the swap by shifting the curve ...
3
votes
1
answer
1k
views
QuantLib in Python : Execution time with OISRateHelper compared to Swap/Deposit RateHelper
I have been working on valuation of interest rate swaps using dual curve bootstrapping. And for this I use OISRateHelper to create a discount term structure using OIS rates. The entire code below :
<...
3
votes
0
answers
89
views
Manual Computation of Python QuantLib's NPV for Pricing of a Forward Rate Agreement
Following the question that I have asked on this link and response obtained, I have managed to price a 3x6 FRA using QuantLib Python, using the following codes:
...
3
votes
0
answers
617
views
Using Python Quantlib's FittedBondDiscountCurve as Evaluator of Parametric Curve - Errors
I am using Quantlib's FittedBondDiscountCurve in Python 3.7 and setting MaxIterations to 0, and giving a guess_solution, which then turns the routine into an evaluator for the parametric form I choose,...
3
votes
0
answers
699
views
FX curve stripping beyond one year (with CCS and NDS)
In QuantLib, the FxSwapRateHelper allows to create bootstrap a curve FX Swap quotes. For instance, the link below includes example of bootstrapping PLN yield curve using EURPLN spot rate and forward ...
3
votes
0
answers
503
views
How to calculate YTW (yield-to-worst) in QuantLib?
After defining a CallableFixedRateBond object in QuantLib, I can calculate YTM (yield-to-maturity) right now. I'm using Python so the function is bondYield().
Is there any way to calculate YTW (yield-...
3
votes
1
answer
1k
views
Quantlib FuturesRateHelper triggers not a valid IMM date error
I'm beginning to use QuantLib with Python SWIG, and trying to build a EUR yield curve.
I face this error which frankly I don't understand; I looked at the code of bool IMM::isIMMdate in imm.cpp and ...
3
votes
0
answers
123
views
How do I specify Thirty360::European day counter in RQuantLib
I am taking liberty to ask the following question in quantLib forum though this question is about RQuantLib
I am trying to use RQuantLib to calculate clean price of a fixed coupon bond using a Nelson-...
2
votes
1
answer
2k
views
AmericanOptionImpliedVolatility - root not bracketed issue in QuantLib/R
I'm trying to compute an implied volatility -- I am trying to match real data I see in Yahoo finance which shows an IV of about 27%. My call in 'R' for the same params returns a root not bracketed ...
2
votes
2
answers
4k
views
Bootstrap yield curve with QLNet / Quantlib
I am trying to grasp QLNet (C# version of Quantlib, all the functions of Quantlib have the same name and work the same way, so if you just know Quantlib, you can still help me), especially for pricing ...
2
votes
2
answers
683
views
Building a percent of floating rate IRS in QuantLib
Just starting to learn Quantlib for Python.
I am trying to figure out how you create an interest rate swap where the floating leg is a percent of the floating index. For example, the floating leg ...