Questions tagged [quantlib]
Quantlib is an open-source C++ library for quantitative finance.
107
questions with no upvoted or accepted answers
8
votes
0
answers
3k
views
Replicating Bloomberg Swap Prices with QuantLib
I'm trying to learn more about the QuantLib python package and as an exercise I'm trying to replicate some swaps on Bloomberg. However, when I do so, it seems like my swaps are consistently ...
4
votes
0
answers
325
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
293
views
RQuantLib: any difference between FixedRateBond() and FixedRateBondPriceByYield() with flat term structure?
Please, consider the following functions from RQuantLib package:
FixedRateBond()
...
3
votes
0
answers
169
views
Best practices for building an FX volatility surface with Quantlib in Python
Generally my question is: what are best practices for building FX volatility surfaces with Quantlib?
In FX options, I would like to price structures such as risk reversals, strangles and butterflies.
...
3
votes
0
answers
82
views
CDS Runtime Error: Issue changing evaluation date using UpfrontCdsHelper in Python
If I run the below CDS pricing example (from https://github.com/lballabio/QuantLib-SWIG/blob/master/Python/examples/cds.py) using the UpfrontCdsHelper instead of the SpreadCdsHelper, I get the ...
3
votes
0
answers
224
views
Seasonality adjustment within Quantlib Zero Coupon Inflation Swap
I am currently working on pricing a Zero Coupon Inflation Swap using Quantlib in Python. During my analysis, I have observed that when the start date and end date of the swap coincide exactly with X ...
3
votes
0
answers
109
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
750
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
844
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
586
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
0
answers
726
views
Bootstraping CLP Swap with Quantlib
After reviewing and fixing my last code (Swap Bootstrapping with quantlib), i managed to get the zero rates for the ICP swap curve (CLP). Now the thing is that there is a considerable difference ...
3
votes
0
answers
133
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
0
answers
108
views
Quantlib match clean price with bbg clean price : Huge gap between calculated price and bloomberg
I am not able to make quantlib match bloomber price, maybe I don't use the right parameters into ql.Schedule or ql.FixedRateBond
...
2
votes
0
answers
89
views
Quantlib: Problem with discount curve with different settlement days than the swap curve
When pricing a interest rate swap, I use the swap curve to price the instrument and the corresponding OIS curve to discount it. However, for some countries (eg Canada), the IRS curve settles on the ...
2
votes
0
answers
190
views
Quantlib Floating Rate Cashflow
I am struggling to reconcile the cashflow of a floating rate bond. I created a reference index of 5% flat, then a bond that pays quarterly coupon with Actual/360. For example, I'd expect the coupon on ...
2
votes
0
answers
124
views
QuantLib option.NPV() returns interpolation error
I've been trying to price some barrier options with a Heston model on Quantlib and it works quite well most of the times, but sometimes I get the error: "interpolation range is [3.4314, 4.28384] ...
2
votes
1
answer
311
views
Actual360 convention in quantlib schedule
I'm trying to make a payment schedule for different bonds in quantlib. For example, I made such a schedule:
...
2
votes
0
answers
764
views
How to build an inflation term structure in QuantLib?
This is what I've got, but I'm getting weird results. Can you spot an error?:
...
2
votes
0
answers
101
views
QuantLib XL Swap Valuation Fixing Dates
I want to rate IRS Swaps on an specific Valuation Date using QuantLibXL. Everything works fine besides the last Index Fixing before the Val Date. After using SwapLegAnalysis I saw that the Index ...
2
votes
0
answers
308
views
QuantLib - Synthetic deposit/FRA rates in yield curve
In my flat forwards dollar curve implemented in QuantLib I would like to add the following instrument:
Today is 12/28/2018
Pillar quote is 1% p.a. (ACT/360)
Pillar start is 1/30/2019 (specific ...
2
votes
3
answers
1k
views
In quantlib (python), is there a way to specify settlementdays for a swapratehelper without having to also give discountCurve?
Using the following Python code I am setting USD LIBOR Swap quotes. I found that by default settlementdays uses whatever is associated with the Index (in C++:
...
2
votes
0
answers
434
views
Calculating price -> yield and yield -> price for fixed rate bonds using QLNet
I'm trying to implement a simple calculation module to calculate fixed rate bond yield given the price (and then price based on yield to verify the calculation). I've looked at a number of examples (...
2
votes
0
answers
209
views
python and quantlib - setting futures priority
In setting up a curve using deposit rates and futures in python, is there a trigger which allows one to set when the futures start?
Looking for something similar to ...
1
vote
0
answers
66
views
QuantLib: Latin American FixedFloat Swap pricing with multiple payment frequency specification
With reference to the post of latin american swap, I am valuing the FixedFloat CLP swap.The specifications of this swaps has payment frequency upto 18 months as Zero coupon(1T) and after that ...
1
vote
0
answers
44
views
When is the Quantlib's C++ to python package faster than just coding natively in python?
Every package I have used of the QL's python package thus far have been slower than my own local python functions. From what I understand, it's running C++ underneath, but if you are running loops/...
1
vote
1
answer
105
views
Find the right module for CDI DI BRL swaps valuation Quantlib
I'm trying to find a way to price BRL CDI Swaps with Quantlib but I can't find any solutions so far - so I was wondering if anyone encountered this issue:
I don't see any solution on Quantlib. I ...
1
vote
0
answers
44
views
Quantlib's --enable-indexed-coupons flag
When building Quantlib from source there used to be an --enable-indexed-coupons flag option. This was an override for the default 'par coupon' setting which came with the standard Quantlib ...
1
vote
0
answers
173
views
SabrSwaptionVolCube Class in Quantilib Python
Just noticed after upgrading to the most recent version of Quantlib Python that the class ql.SabrSwaptionVolCube is now available. This is a very useful class in that it behaves in very much the same ...
1
vote
0
answers
265
views
Does Quantlib FloatingRateBond support SOFR index?
I am trying to use Quantlib to price FloatingRateBond, Thanks to some other posts on the stack I managed to do it for Ibor indexes. I tried to use the SOFR, but I didn't succeed, I couldn't get around ...
1
vote
0
answers
261
views
Can I use the QuantLib Monte Carlo engine to price American options using heavy/fat tailed-distributed random numbers?
This might be silly, but I’m seeking to use QuantLib to price vanilla American call and put options using a Black-Scholes-Merton process and the Monte Carlo pricing engine based on the Longstaff ...
1
vote
1
answer
379
views
Central Bank Meeting Date Curve in QuantLib
Is it possible to construct a central bank meeting date curve, using futures prices & OIS rates, in QuantLib?
Specifically, I mean a yield curve with flat (constant) forward rates in between ...
1
vote
0
answers
170
views
CORRA linked FRN's accrual interest calculation using the QuantLib
In Canada, the CDOR index will be phased out in June 2024, and the replacement is the CORRA (Canadian Overnight Repo Rate Average), which is an OvernightIndex used for evaluating the FRN in Canada. ...
1
vote
0
answers
106
views
Calibrating HW 1f model params to a term structure market data
I am using Quantlib to calibrate the HW model params to the market swaption price. The attached chart shows the performance of the calibration.
Am I correct in saying, this is expected for the 1f HW ...
1
vote
0
answers
195
views
QuantLib: Modeling GBP-6M-Libor Fixed-Float swaps as valuation date after 2021-12-31 using QuantLib
Starting from January 2022, LIBOR fixings/rates for most currencies (GBP, EUR, CHF, JPY) will be discontinued. After the switching date 2021-12-31 , such floating-rate bonds will effectively have two ...
1
vote
0
answers
810
views
Quantlib : Valuation of inflation swaps of EUR-RPI using quantlib python?
Below is the sample code to compute the inflation swaps. I have referred the Quantlib cookbook to get the flavor of Inflation swaps. But I feel that the term structure and final NPV is not accurate ...
1
vote
0
answers
195
views
Pricing Asian and barrier option using Quantlib
I am exploring to use the ql.FdBlackScholesAsianEngine and ql.FdBlackScholesBarrierEngine using python code to price commodity options with implied volatility from traded European or American options. ...
1
vote
0
answers
947
views
Schedule, Yield-to-Maturity, and NPV of Fixed Rate Bond from QuantLib Python
I would like to price a fixed rate bond using QuantLib Python.
The pricing is fine, however I would like to understand how to extract the Yield-to-Maturity (YTM) of the fixed rate bond, that is, the ...
1
vote
0
answers
203
views
QuantLib Two Asset Barrier Option
I am trying to price a two asset barrier option where each asset has its own barrier and both barriers have to be met for the payoff. The experimental TwoAssetBarrierOption class seems to accept only ...
1
vote
1
answer
585
views
SOLVED Manually Recomputing Forward Rates from QuantLib Python
I have used QuantLib Python to compute 1-month forward rates from zero rates as at 05 December 2019.
My codes can be found below:
...
1
vote
0
answers
267
views
DV01 on IRS giving error in Quantlib for ZAR curve "1st iteration: failed at 14th alive instrument"
I am at my wits end to calcualte the DV01 of a swap but keep getting the error "RuntimeError: 1st iteration: failed at 14th alive instrument, pillar May 28th, 2024, maturity May 28th, 2024, ...
1
vote
0
answers
330
views
Pricing a amortizing callable danish mortgage bond using quantlib
I am trying to price a callable fixed rate amortizing danish mortgage bond. since QuantLib only has CallableFixedRateBond i have created a dervived class called <...
1
vote
0
answers
430
views
QuantLib-Python Libor Market Model
It appears that QuantLib-Python does not include Libor Market Model, although the C++ version has it.
(https://rkapl123.github.io/QLAnnotatedSource/d5/d8d/class_quant_lib_1_1_market_model.html)
Is ...
1
vote
0
answers
292
views
CDS option pricing in Quantlib Excel (QuantlibXL)
I am trying to price an index CDS option using QuantlibXL. Anyone aware of an existing template sheet or sample formula for creation of CDS and CDS objects? The sample template sheets provided with ...
1
vote
0
answers
50
views
MC Simulation using G2Process Evolve function
I am trying to simulate the IR for G2 Process using the following code. However, the initial value of the simulation starts with zero. I want to initialize the simulation using a starting value.
Is ...
1
vote
0
answers
144
views
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 ...
1
vote
0
answers
59
views
When using qlSmileSectionFromSabrVolSurface in Quantlibxl, why the Option Time for input cannot be less than 1?
I constructed a SabrVolSurface in Quantlibxl. Then I wanted to obtain a volatility smile from the surface using qlSmileSectionFromSabrVolSurface. The problem is that the time input is the year-...
1
vote
0
answers
75
views
Quantlib Yield Curve given spot and forward rate
Is it possible to create a yield curve, given the spot rate and the forward rate?
1
vote
0
answers
198
views
Unable to find QuantLib-Python bindings for Synthetic CDO
I am trying to price a Synthetic CDO using QuantLib Python. Unfortunately, I am unable to find any suitable CDO pricing engine ported into Python. They do exists but in C++ as per my preliminary ...
1
vote
0
answers
292
views
How to use quantlib Excel for valuation of european swaption with vol surface to calibrate?
I would like to replicate the following Bloomberg pricer in quantlib using Quantlib xl. Is it possible?
Thanks
1
vote
0
answers
211
views
Why Quantlib CreditDefaultSwap::ISDA fail on roll dates: 1st iteration: failed at 1st alive instrument, pillar
I am experimenting with Quantlib CDS engine, I create a piecwise hzard rate based on CDSHelpers and try to compute default probability with it and then some specific upfront.
I managed to match BBG ...