Questions tagged [quantlib]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
24 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: ...
-2
votes
0answers
54 views

Running Quantlib with Visual Studio Code in Windows

I am trying to run Quantlib with Visual Studio Code in Windows. A bit of background, I am able to run Quantlib with Visual Studio 2019; however due to the lack of support in my company, I cannot ...
0
votes
1answer
49 views

Quantlib: loan cash flow

Situation: I would like to make a small script which prices loans (fe annuities or fixed payment) for the ALM purposes. However, I am stuck in the amount of classes existing in Quantlib and would like ...
0
votes
0answers
34 views

CDO tranche pricing

I am trying to use the CDO class from Quantlib in C++. Can I see an instance of using this class to price tranche of a CDO. I want to see what the input for default probability term structure and ...
1
vote
1answer
74 views

In Python QuantLib how to identify Principal and Interest cashflows?

I am fairly new to QuantLib Python. I have generated the following cashflows from one AmortizingFloatingBond from QuantLib Python. But I am not able to identify which ones are Interest payments and ...
0
votes
1answer
81 views

NPV of Interest Rate Swap not coming to be 0 at initiation

I am using the iPython notebook published by Gouthaman Balaraman at [http://gouthamanbalaraman.com/blog/interest-rate-swap-quantlib-python.html][1] This is to value the Interest Rate Swap. I am ...
0
votes
0answers
51 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
1answer
51 views

How To Properly use QuantLib to Replicate Excel's MDURATION Function

just wanted to ask how to use Quantlib on replicating Excel's MDURATION. Given the following parameters, I was able to get a value of 4.478837 via MS Excel's MDURATION Function. ...
1
vote
1answer
148 views

Quantlib Black Model for Commodity Options (Interest Rate Options) is extremely light on gamma and price vs BBG, is model incorrect?

I am using the QuantLib developers example to try and price a TY option. The Delta is pretty close but the price and gamma are way off (almost by a factor of 2). Am I using the model wrong or is the ...
0
votes
0answers
60 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
0answers
23 views

end of month is being applied to the termination date in quantlib schedules

According to the QuantLib-Python Documentation for the Schedule function endOfMonth : If the start date is at the end of the month, whether other dates are required to be scheduled at the end of the ...
0
votes
1answer
86 views

How to compute NPV of Latin American swap CLP-TNA (chilean) using quantlib?

I am trying to value the Latin Americans swaps. But CLP-TNA valuation is far off from the actual valuation. Please suggest, what I am missing in below methodology to compute NPV. ...
0
votes
0answers
62 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 ...
1
vote
2answers
84 views

Problem with bond.bondYield Quantlib

I'm having issues with a simple FixedRateBond bond yield calculation using QuantLib: ...
0
votes
0answers
40 views

QuantlibXL - How can I define a volatility surface using moneyness instate of strikes?

I wonder if in the function qlBlackVarianceSurface() I can replace the strikes for moneyness and then price the option using the spot = 100% and the option strike = Original_Strike / Original_Spot. ...
1
vote
0answers
47 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, ...
4
votes
0answers
66 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. ...
1
vote
0answers
44 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
1answer
100 views

USD Swap curve prices do not line up with inputs

As mentioned in the title, i'm having trouble with pricing USD swaps in quantlib. I wanted to take some inputs (Prices of swaps in the market) and be able to construct a yield term structure that ...
1
vote
2answers
83 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
1answer
64 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
1answer
41 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
1answer
68 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
1answer
86 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
0answers
74 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
0answers
52 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
0answers
56 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 ...
1
vote
2answers
129 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 ...
7
votes
0answers
263 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
0answers
66 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 ...
0
votes
0answers
82 views

Calibrating Hull-White 2 Factor in Quantlib

I am trying to calibrate Hull White 2 factor model in Quantlib in Python. Since, the Quantlib doesn't have Hull-White 2 Factor, I am using G2(Gaussian 2-Factor Model). Ideally, the interest rates ...
1
vote
0answers
22 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
0answers
108 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
0answers
35 views

QuantLib forward dates not matching

I am getting forward swap rates from spot rates of various different curves (3M USD Libor, 6M GBP Libor, 6M Euribor, Fed Funds, SONIA & EONIA): ...
0
votes
0answers
41 views

Calculation Option Greeks per day using Quantlib

I'm trying to calculate option greeks and impVol for a series of European index options (they are in a DataFrame) using QuantLib. Is there a way to get the Greeks and impVol on a daily basis? Thank ...
0
votes
1answer
68 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
0answers
63 views

How to build Basis Swap Instrument for Libor Curve Bootstrapping

I am trying to bootstrap LIBOR curve in QuantLib-Python similar to what Bloomberg does. I need to create Basis Swap instruments for this but I could not find any helper like basis swap rate helper (...
0
votes
1answer
174 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
0answers
632 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
0answers
36 views

Import an external term rates structure in QuantLib

I need to create a Monte Carlo simulation for a Hull-White process. I have the term rates structure already given in a csv, and imported it into Python with the name "rates". However, I have ...
0
votes
1answer
47 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
1answer
198 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
1answer
73 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
2answers
180 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
1answer
294 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
2answers
202 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
1answer
141 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
0answers
92 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
2answers
455 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: ...
0
votes
0answers
49 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
2 3 4 5
7