Questions tagged [quantlib]
Quantlib is an open-source C++ library for quantitative finance.
469
questions
1
vote
2
answers
355
views
Python QuantLib FuturesRateHelper issue
I'm trying to do bootstrapping using some future rates however encountered some errors below. A reproducible case is as follows:
this is constructing a future rate helper with 'IRM1 Comdty' from ...
0
votes
1
answer
271
views
Calculate DV01 for a vanilla swal for MXN index using quantlib
I am trying to calculate dv01 for a vanilla swap using quantlib. Its a MXN TIIE Swaps for built an index like
...
0
votes
1
answer
55
views
Sorting SimpleCashFlows in QuantLib
I would like to sort SimpleCashFlow(s) according to date. I am having trouble incorporing the the less than function < in std::sort
...
0
votes
1
answer
294
views
Calculate Fixed Rate on Vanilla Swap in Quantlib
I am trying to calculate dv01 on the vanilla swap using quantlib but not able to understand how to calculate the fixed_rate. In all the examples it's a hardcoded value which is not right. Any ...
0
votes
1
answer
193
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 ...
1
vote
0
answers
326
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 ...
0
votes
0
answers
147
views
QuantLib Python currency conversion
A simple code below to do currency conversion copied from QuantLib-Python Documentation. This is failing in the EUR to GBP conversion (in the last line of code). Thank you for looking into this.
The ...
0
votes
0
answers
90
views
Black Standard Deviation in QuantLibXL
I was having a doubt about a fucntion in the QuantLib add-on for excel.
What is the formula for the function: qlBlackFormulaImpliedStdDev(...)
I know that there ...
3
votes
2
answers
1k
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
...
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 ...
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 ...
0
votes
0
answers
203
views
Rebonatos's formula in C++
I'm trying to code in C++ Rebonato's formula for swaption volatilities
$$ v_{\alpha,\beta}^2=\frac{1}{T_\alpha} \sum_{i,j=\alpha+1}^{\beta} \frac{w_i(0)w_j(0)F_i(0)F_j(0)}{S_{\alpha\beta}^2(0)}\rho_{i,...
0
votes
1
answer
338
views
Configuring barrier option in Quantlib-Python
Is there a possibility to configure the period the barrier is active, using Quantlib for python? Namely to set up the start and the end dates we compare the spot vs the barrier.
If we look at quantlib-...
0
votes
1
answer
2k
views
Quantlib Calendar Advance
Hi I'm trying to advance a business date (28-12-2012) by 1 day and 1 week according to the Japan calendar.
...
0
votes
0
answers
3k
views
Nelson-Siegel-Svensson Yield Curve Estimation From Zero-rates Using QuantLib (Python)
I am using QuantLib in Python to estimate yield curves using the Nelson-Siegel-Svensson (NSS) model with zero-rates as input. Since the NSS model in QuantLib uses the discount function to estimate the ...
0
votes
1
answer
80
views
Quantlib error initializing CapFloor C++ Class
I'd like to use QuantLib as a C++ library to price interest rate derivatives, in particular Cap&Floors. To semplify things a little, let's say I have a vector of EURLibor1Y rates for different ...
-1
votes
1
answer
1k
views
QuantLib Python: how to calculate duration and convexity for irregular cashflows? Can I use SimpleCashFlow or must I define a custom bond?
I have 2 questions:
If I want to discount a set of irregular cashflows, I can do it using the SimpleCashFlow class, or defining a bond with custom cashflows (thank you to Ballabio and David Duarte for ...
-1
votes
1
answer
171
views
QuantLib Python: why is the NPV different? NPV(0.1,[0,110]) should be 100, not 99.53
I am trying to learn QuantLib for Python. Further to my previous question on the syntax for CashFlows.npv(), now that I understand how the syntax works, I have a question on why the output differs ...
-1
votes
2
answers
825
views
QuantLib Python: how to calculate the npv of irregular cashflows?
I am trying to learn QuantLib for Python but I must say I am banging my head against the documentation (I also bought Ballabio's python cookbook) - maybe it's me, but even finding the most basic ...
-1
votes
1
answer
2k
views
Converting pandas datetime to QuantLib dates: why do the inputs need to be converted to int only some times? It seems random
I am trying to use the QuantLib library with Python.
In the example below, I create a pandas dataframe with some dates and some cashflows, convert the dates from pandas' format to QuantLib's, and use ...
0
votes
2
answers
2k
views
Getting quarterly forward rates with QuantLib
I am trying to build a quarterly forward curve with 3 month USD Libor swap rates from 1Y to 50Y as inputs.
From other posts I have looked at, I have managed to come up with this code so far:
...
1
vote
1
answer
900
views
QuantLib constructing yield curve error: root not bracketed
much appreciated if anyone can help with the below, basically i'm trying to construct a yield curve using some real market data. I have pasted the python code below. I use a list of swap rates and ...
0
votes
2
answers
637
views
question on QuantLib schedule to get bond coupon payment dates - python
sorry the original question was answered by an expert but somehow I cannot edit the original question and add comments. so posting it again with some follow up questions:
i have a number of bonds that ...
0
votes
2
answers
3k
views
QuantLib python ql.schedule getting end of month dates
i'm trying to get payment schedule of a bond that pays coupon quarterly. value date is 2020-04-01, first coupon date is 2020-06-30, maturity date is 2022-09-30. so I expect to have a list of dates:
...
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 ...
0
votes
1
answer
1k
views
Bloomberg bond clean price and accrued amount differs from Quantlib
I'm getting the different bond clean price from Bloomberg and from QL but surprisingly Bloomberg price matches with excel price() function
I have the following bond : GETC21117030. The parameters are ...
1
vote
1
answer
298
views
LIBOR Quoting Conventions and Swap Pricing
Given that LIBOR quotes have value date T+2, when considering a simple IRS, which dates are considered when fixing the floating rate? Say floating leg is Euribor 3M and next fixing date is today (02/...
0
votes
1
answer
284
views
Constructor error pricing american ops with divs quantlib?
Looking at post from Issue Using QuantLib and Python to Calculate Price and Greeks for American Option With Discrete Dividends
and trying to recreate the result; but getting a constructor error I ...
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
2
answers
718
views
QuantLib: ImportError: DLL load failed:
I intalled quantlib using "pip install QuantLib" and now I'm getting the below error. I'm using windows 10 and Spyder IDE. I don't see any dll file called _QuantLib, only _QuantLib.cp37-...
1
vote
1
answer
844
views
QuantLib Bond Yield
I think I have the same question as was asked here but I still haven't been able to resolve my issue:
Excel YIELD function equivalent in python Quantlib
I am trying to calculate the yield on a bond ...
2
votes
1
answer
2k
views
QuantLib - Calibrating Hull White one-factor on negative interest rates
I have been working with the QuantLib Python package for some days now. Currently, I am working on calibrating a Hull White one-factor model for short rates. I am calibrating the model on the yield-...
0
votes
0
answers
131
views
Quantlib simulating options with different evaluation dates
Im given a dataset of option data that looks like this.
...
2
votes
1
answer
148
views
Excel PasteSpecial Values shortcut button causing QuantLib to crash
I am experiencing a strange issue with QuantLibXL when I use the quick-access PasteOptions/Values button on the Excel right-click toolbar (apologies for the picture: it is surprisingly hard to capture ...
0
votes
1
answer
894
views
What is the cause of this error 'TypeError: Wrong number or type of arguments for overloaded function 'new_HestonModelHelper'?
I'm simulating the option prices every month using the Heston Model. The option contract expires at the of the month and the next option contract start the day after the previous contract expire. In ...
2
votes
2
answers
1k
views
Best Approach to Creating a USD LIBOR Forward Curve from Market Data
This is a very basic question, I am convinced this has been answered before but I cannot seem to find it.
What is the best approach for constructing a USD Libor forward curve from market data?
For ...
2
votes
1
answer
839
views
Forward bond yield with QuantLib
I'm looking into way to calculate forward bond yield using QuantLib. In Python QuantLib book I see an example for bond futures, where
...
0
votes
1
answer
978
views
Getting a daily forward OIS rate curve with QuantLib in Python
I am trying to build a 1-day EONIA forward curve with QuantLib giving OIS yields from 1mo to 50yr as input.
My current approach consists on (i) obtaining the yield curve with ...
2
votes
1
answer
251
views
How many parameters in a discount curve exponential spline fit?
I am investigating the ExponentialSplinesFitting class in QuantLib. I've used this fitting technique using a variety of systems in the past (including by hand!). The form is $$df(t) = \sum_{n=1}^{N}(\...
2
votes
2
answers
738
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 ...
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?
0
votes
0
answers
470
views
Bootstrapping Swap Curve
I am trying to get the zero rates from the swap curve for chilean pesos (vs Camara). I tried this code (from a previuos question similar to mine from other person) and I am very close to get the ...
0
votes
1
answer
215
views
Why Yield cannot be calculated for short dated Bonds using Quantlib
I am trying to calculate a yield from a clean price using Quantlib for Bond.
I play a lot with the Quantlib samples (Bonds.java) and succeed but when I change to set today close to maturity, Quantlib ...
0
votes
1
answer
1k
views
Instrument valuation using Monte Carlo simulation with Quantlib
I am looking for some example to value an American swaption using monte carlo simulation of ...
1
vote
1
answer
39
views
Failing to create Quantlib's LM Fixed Volatility Model object
I want to create am LmFixedVolatilityModel object as defined in http://www.jquantlib.com/en/latest/_static/javadocs/0.2.6-SNAPSHOT/jquantlib/index.html?org/...
3
votes
1
answer
2k
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 ...
0
votes
1
answer
729
views
QuantLib Compounded vs CompoundedThenSimple and Simple vs SimpleThenCompounded
I was experimenting on a FixedRateBond on QuantLib python port and have a question on the use of Compounded vs. CompoundedThenSimple methods of discounting.
I am using the FixedRateBond.dirtyPrice() ...
0
votes
1
answer
1k
views
Struggling with Modeling Convertible Bond using Python
I am trying to price Convertible bond with the following data:
price = 5.11
coupon = 0.0575
frequency = semi-annual
risk free rate = 0.02347
conversion Ratio = 3.8095
Conversion Price = 26.25
...
0
votes
1
answer
196
views
dirtyPrice() and discounting curve on QuantLib
I am pretty new to Quant field and QuantLib and have been having the following problem when trying to model a very simple fixed rate bond using Python.
It looks like the library does not use the ...