Questions tagged [quantlib]
Quantlib is an open-source C++ library for quantitative finance.
447
questions
0
votes
0
answers
92
views
Treasury Bond Clean Price - Quantlib
The clean price of the Treasury 10 year bond on 6/30/22 is 98.8046 according to Bloomberg. The settlement day for treasury bonds is 1 day. I think this still means the clean price of bond is 98.8046 ...
0
votes
0
answers
52
views
Defining leverage function in QuantLib
I have numpy arrays for X,Y and Z that define a leverage function for the Heston SLV in Quantlib (Python).
This would then be used to define a pricing engine like so
...
0
votes
0
answers
90
views
Quantlib: Swaption volatility Data fo calibration
I am working with Quantlib and I use swaptions volatilities data to Calibrate the short rate model.
I was wondering what if we don't have these data?
can I model swaps and swaptions using QuantLib and ...
0
votes
0
answers
108
views
How do I price options with an American barrier on Quantlib?
I've been looking for a way to price options with an American barrier (continuous), but I can't seem to find any documentation on this... In the "QuantLib-Python Module Reference" by David ...
0
votes
0
answers
262
views
Quantlib python convertible bond pricing
I'm trying to price a convertible bond using quantLib library in Python but I can't seem to build the convertible bond object with ql.ConvertibleFixedCouponBond function. I get this error message, ...
0
votes
0
answers
38
views
Reasonable way to price swap under realized forwards assumption
I'm looking for a way to price swaps in QuantLib under the assumption of realized forwards, i.e. couple of weeks or months from today the yield curve would be the same as it is expected by the market. ...
0
votes
1
answer
192
views
Quantlib: How to bootstrap FedFunds Index having other tenors 3M, 1Wk, etc?
I am valuing few Basis Swaps having combination of USD-FedFunds-H.15-OIS-COMPOUND3M vs USD3MLibor. However, I can understand to value 'USD-FedFunds-H.15-OIS-COMPOUND1D' by using ql.FedFunds(). But ...
0
votes
0
answers
368
views
Quantlib in Python
I have been playing around with QuantLib in Python and have been struggling with couple of simple tasks I would like to share and hopefully get help from the community
debugging:
The fact that it's c++...
0
votes
1
answer
138
views
Does quantlib support Equity/Index Swap valuations?
Is there a way to create a Leg in quantlib in which the notional and reset amounts are calculated by how an index/equity performs?
0
votes
0
answers
112
views
Simple bond math calculation - Quantlib
I am reconciling a dirty price calculation using quantlib and I am having difficulty getting the same dirty price manually.
I am confident it is used to the day count convention but I've tripled ...
0
votes
1
answer
159
views
equivalentRate not matching for compounding cashflows
I am calculating equivalentrate between two days in quantlib python using following functions but the output is not matching with the manual calculation.
...
0
votes
0
answers
117
views
Price of a forward delivery bond - Quantlib python
I would like to find the bond price today which has already been issued but delivered later. Basically, the price won't include some of the coupons till the delivery date.
Let's say 10 year bond ...
0
votes
1
answer
270
views
Using QuantLib to get all holidays currently published by an exchange in multiyears without specifying a range
Is there a way to get a list of all the holidays published in an exchange calendar without specifying a date range? For example, NYSE has published their holiday calendar up to 2024 and I want to see ...
0
votes
0
answers
126
views
QuantLib - Help buiding a simple T-Bond (Mischievous Pricing Conventions)
Im having a problem getting the right price for a simple T-Bond, maybe a Mischievous Pricing Conventions like Luigi says in his book. Im tying to price "912810SZ Govt"
...
0
votes
0
answers
293
views
Pricing an OIS referencing SONIA with fixing lag
I'm trying to price an Overnight Index Swap referencing SONIA.
The swap will have a 5 day fixing lag (i.e using compounded SONIA over the current interest period but with the last rate set 5 days ...
0
votes
0
answers
84
views
Incorporate Transaction Date to Price Fixed Rate Bond using Quantlib Python
I am trying to use QuantLib Python to price a fixed rate bond, based on the following data:
Issue date is 28 September 2017 (issueDate), maturity date is 28 ...
0
votes
0
answers
248
views
Using QuantLib for bonds with irregular coupon payments
Could you please help properly use QuantLib python library to estimate different metrics of bond with uncommon coupon payment periods? For example, I have a bond, which pays coupon each 182 day (26 ...
0
votes
0
answers
192
views
Plotting a CSA curve in QuantLib
IRS under a CSA
Let's consider an example of Interest Rate Swap under a CSA.
To calculate discount factors that can be used to discount cashflows in one currency, $C_{1}$, collateralized in another ...
0
votes
0
answers
209
views
How to compute the Brazilian Plain vanilla swap using Quantlib?
How to compute the BRL plain vanilla swap. I have followed the below methodology to calculate the valuation for other indexes but BRL-CDI is far off from actual valuation. Please suggest if anything ...
0
votes
1
answer
186
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 ...
0
votes
0
answers
140
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
86
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 ...
0
votes
0
answers
194
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
307
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
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
0
answers
119
views
Quantlib simulating options with different evaluation dates
Im given a dataset of option data that looks like this.
...
0
votes
0
answers
447
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
638
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
185
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 ...
0
votes
0
answers
416
views
How to Calibrate SABR parameters by fixing Beta(Quantlib XL/Python)
Unable to find a good example for either Quantlib XL/Python where we can calibrate Alpha, Rho and Nu by fixing Beta. Any help would be appreciated
0
votes
0
answers
151
views
Option implied data from CME
I am trying to extract the risk free rate and volatility from the traded American options with expiry Nov-2020 from CME. https://www.cmegroup.com/trading/metals/...
0
votes
1
answer
928
views
Option price quantlib
I am lookin at https://github.com/lballabio/QuantLib/blob/master/Examples/EquityOption/EquityOption.cpp . I want plot a graph of the option price for different underlying prices. Other than changing ...
0
votes
0
answers
131
views
How to find Flow of Funds and Money Trail in Python for Finance
I'm trying to find Flow of Funds and Money Trail using python
but i'm stuck in middle of it not understanding what to do next
My Main goal is to finding Flow of Funds i.e flow of transaction from ...
0
votes
1
answer
1k
views
Monotonic Cubic Spline interpolation QuantLib python
I am new to QuantLib-Python and I am trying to replicate the implementation of a Dual Curve bootstrap using QuantLib-Python.
I have followed the steps in Chapter 9 of the QuantLib Python Cookbook. ...
0
votes
1
answer
352
views
Bootstrapping the 6m Sterling Libor curve
I am trying to bootstrap the 6m sterling swap curve using the depos and swap rates codes are below. I am a newbie and have been following (or at least trying to!) the python cookbook. I wanted to know ...
0
votes
1
answer
919
views
Zero Rates to Piecewise linear forward rates in Py QuantLib
How can I extract the piecewise linear forward rates given a term structure of zero rates for a given trade date in Py QuantLib. This is used to price an ir swap.
My attempt is to create a ZeroCurve ...
0
votes
1
answer
104
views
qlRateHelperEarliestDate and qlRateHelperLatestDate in QuantLib Python
I have been using Quantlib Addin, now I am looking for the equivalent function for QuantLib in Python:
=qlRateHelperEarliestDate(RateHelper)
and
=qlRateHelperLatestDate(RateHelper)
Or any ...
0
votes
0
answers
437
views
Quantlib xll - Converting deposit/swap curve to zero curve
I am trying to create a spreadsheet using the Quantlib xll to convert deposit/swap rates to zero rates. I tried to implement such by referencing to the C++ code listed here:
How to sum interest rate ...
-1
votes
2
answers
319
views
Easier way than using QuantLib to compute the price and Greeks of a vanilla European option?
I'm using the following to compute the price and Greeks a vanilla European option:
...
-1
votes
1
answer
157
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
748
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 ...
-1
votes
1
answer
769
views
Difference arising between Dirty Price and NPV using QuantLib Python
I have used QuantLib Python to price a fixed rate bond.
My codes are as follows:
...
-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
90
views
Open source code based on quandl for security analysis and options priming
Quandl seems to be an excellent source of wide range of free/open financial data. But is there an open source code or platform that uses the quandl datasets to perform security analysis and option ...
-1
votes
1
answer
468
views
Quantlib python FRA rate helper
Can i get an example of how to use quantlib python FRAratehelper?
I would like to use it to get discount factors, with 3month Jibar as a reference rate.
-1
votes
1
answer
588
views
Quantlib interpolation question
I am trying to use QuantLib to create some curves, but I am finding this error I do not really know how to get around. Say for simplicity this is the example:
...