Questions tagged [quantlib]
Quantlib is an open-source C++ library for quantitative finance.
111
questions with no upvoted or accepted answers
8
votes
0
answers
2k
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
238
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
290
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
29
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
94
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
662
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
747
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
537
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
124
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
80
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
62
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 ...
2
votes
0
answers
72
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
92
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
0
answers
176
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
362
views
cross currency basis swap instrument in Quantlib
I have noticed that there is a cross currency basis swap rate helper added to the Quantlib new release. However, I could not find the instrument cross currency basis swap. I assume the helper is added ...
2
votes
0
answers
667
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
98
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
285
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
418
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
659
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 ...
2
votes
0
answers
199
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
122
views
Unable to match quantlib examples
I'm currently learning Quantlib using C++ and am following the very good instructions here:
https://www.quantlib.org/slides/dima-ql-intro-2.pdf
Specifically on building piecewise yieldcurves (slide ...
1
vote
0
answers
203
views
Cross currency swap valuation in QuantLib
Does QuantLib support valuation of Cross currency swaps ?
Eg. SOFR / SONIA cross currency swap.
1
vote
0
answers
50
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 ...
1
vote
0
answers
140
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
172
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
217
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
121
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
86
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
160
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
654
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
156
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
708
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
178
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
0
answers
372
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
229
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
238
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
327
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
228
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
48
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
112
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
47
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
70
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
172
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
240
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
188
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 ...
1
vote
0
answers
230
views
quantlib isda cds time-series
I am trying to use quantlib from python to work with time series of cds quote, e.g I would like to evaluate the PV or PUF or other metrics on many different days. Each day has an associated yield ...
1
vote
0
answers
300
views
Quantlib Python OISRateHelper using Quantlib Cookbook - hands on Quant Finance
I am completely new to Python, just trying to reference Quantlib Cookbook to construct eonia curve, here is my code. I didn't change much compared to the cookbook Eonia Curve BootStrapping chapter, ...
1
vote
0
answers
343
views
Building OIS curve in Quantlib from Fed Funds Futures and handling steps
Has anyone tried building an OIS curve with Quantlib from Fed Funds futures?
If so, could you share a code snippet for how you do it. (Assuming you already have the prices for the futures)
How do ...