Skip to main content

Questions tagged [quantlib]

Quantlib is an open-source C++ library for quantitative finance.

104 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
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 ...
K. Mao's user avatar
  • 181
4 votes
0 answers
392 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. ...
lays's user avatar
  • 446
4 votes
0 answers
761 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 ...
Jose Pedro Melo's user avatar
4 votes
0 answers
295 views

RQuantLib: any difference between FixedRateBond() and FixedRateBondPriceByYield() with flat term structure?

Please, consider the following functions from RQuantLib package: FixedRateBond() ...
Lisa Ann's user avatar
  • 2,131
3 votes
0 answers
443 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. ...
Wynn's user avatar
  • 105
3 votes
0 answers
111 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 ...
bkhoor's user avatar
  • 31
3 votes
0 answers
364 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 ...
Oamriotn's user avatar
  • 355
3 votes
0 answers
129 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: ...
ql.user2511's user avatar
3 votes
0 answers
797 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,...
NBF's user avatar
  • 1,068
3 votes
1 answer
1k 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 ...
bluk's user avatar
  • 131
3 votes
0 answers
619 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-...
Zhenduo Cao's user avatar
3 votes
0 answers
134 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-...
kishore's user avatar
  • 131
2 votes
0 answers
65 views

Can effective duration > modifed duration for a callable bond? I get that in QuantLib

I am using QuantLib to create a CallableFixedRateBond. I set up the HullWhite model as the pricing engine and compute effective duration and modified duration. Given the price of the bond is heavily ...
Eduardo's user avatar
  • 21
2 votes
0 answers
153 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 ...
TourEiffel's user avatar
2 votes
0 answers
108 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 ...
henriqueab's user avatar
2 votes
0 answers
237 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 ...
Jessica's user avatar
  • 21
2 votes
0 answers
141 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] ...
gibster's user avatar
  • 21
2 votes
0 answers
814 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?: ...
Lay González's user avatar
2 votes
0 answers
104 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 ...
NTFP's user avatar
  • 21
2 votes
0 answers
330 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 ...
Michael Lowenstein's user avatar
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++: ...
Arkadiy Naumov's user avatar
2 votes
0 answers
456 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 (...
Jim Smith's user avatar
2 votes
0 answers
210 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 ...
jonmaestro's user avatar
1 vote
0 answers
58 views

Setting up QuantLib to get correct yield for bond with long first payment period

I am dealing with fixed rate bonds. There is one particular bond, 34659UAC0, that caught my eye. This bond has a first coupon period of a whopping 5 years, followed by regular periods of 6 months. My ...
Jerry's user avatar
  • 11
1 vote
0 answers
40 views

Heston++ with QuantLib

Is it possible to implement in QuantLib the Heston++, hence, the Heston with a displacement factor? Thanks!
BloomShell's user avatar
1 vote
0 answers
59 views

Python Quantlib Loop to calculate cap prices: Setting of evaluationDate

I am trying to calculate cap prices for different points in time (valuation dates) with Quantlib. I have built three loops for this. The first one creates the quantlib yield curve object ts_handle ...
Marc157's user avatar
  • 55
1 vote
1 answer
162 views

Bootstrapping yield curve with forward rates using QuantLib

I'm attempting to calculate a GBP yield curve using a USD OIS rate curve and the FX Forward rates using Quantlib. I am trying to replicate the output of a different library, and am close but can't ...
user7631642's user avatar
1 vote
0 answers
92 views

Match CDS upfront amount between Quantlib and Markit Converter model

I'm trying to reconciliate the upfront amount between the Markit converter model (https://cds.ihsmarkit.com/converter.jsp) and the result from the quantlib IsdaCdsEngine function. the difference is ...
benr2506's user avatar
1 vote
1 answer
130 views

Best Practices for Maintaining and Automating Interest Rate Curve Bootstrapping in QuantLib"

We are a small team managing about 20 scripts for bootstrapping interest rate curves using QuantLib. Our process involves taking in interest rate swap data, bootstrapping curves, and then using these ...
AB123's user avatar
  • 41
1 vote
1 answer
200 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 ...
Gloomy's user avatar
  • 21
1 vote
0 answers
52 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 ...
user35980's user avatar
  • 1,386
1 vote
0 answers
224 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 ...
user35980's user avatar
  • 1,386
1 vote
0 answers
379 views

Quantlib: swap curve discount rate from spot rates

I'm new to Quantlib on Python and I'd like to use the overnight swap rate from Bloomberg to derive the swap curve discount factors. I don't know which yield term structure I should specify? I checked ...
sp1r0u's user avatar
  • 13
1 vote
0 answers
303 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 ...
ayoub's user avatar
  • 53
1 vote
0 answers
292 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 ...
Dan La Russa's user avatar
1 vote
1 answer
491 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 ...
nickos556's user avatar
  • 193
1 vote
0 answers
204 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. ...
Bill Qiu's user avatar
1 vote
0 answers
116 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 ...
sumit_uk1's user avatar
  • 141
1 vote
0 answers
199 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 ...
robin's user avatar
  • 105
1 vote
0 answers
906 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 ...
robin's user avatar
  • 105
1 vote
0 answers
211 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. ...
Quant enthsiast's user avatar
1 vote
0 answers
1k 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 ...
ql.user2511's user avatar
1 vote
0 answers
220 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 ...
suhasghorp's user avatar
1 vote
1 answer
768 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: ...
ql.user2511's user avatar
1 vote
0 answers
298 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, ...
Pratikgcet's user avatar
1 vote
0 answers
380 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 <...
Kenneth Christensen's user avatar
1 vote
1 answer
223 views

Canada House Trust Floater pricing

I am using python quantlib, according to one of the Quantlib sample code to evaluate the CHT (Canada Housing Trust) Floaters, and the index I am using is CDOR, and somehow the price I got is always ...
Bill Qiu's user avatar
1 vote
0 answers
503 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 ...
huarong's user avatar
  • 11
1 vote
0 answers
331 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 ...
abruckner's user avatar
1 vote
0 answers
56 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 ...
Nikhil Jain's user avatar