Questions tagged [quantlib]

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

Filter by
Sorted by
Tagged with
1 vote
2 answers
71 views

QuantLib Python - Discount Factor Interpolation within curve nodes

Generated a discount curve, dCurve.PiecewiseLogLinearDiscount() using input par rate for terms (.5Y, 1Y, 2Y, 3Y, 5Y, 7Y, 10Y, 15Y, 20Y, 30Y) and output discount curve matching the input term structure....
1 vote
0 answers
56 views

QuantLib: Latin American FixedFloat Swap pricing with multiple payment frequency specification

With reference to the post of latin american swap, I am valuing the FixedFloat CLP swap.The specifications of this swaps has payment frequency upto 18 months as Zero coupon(1T) and after that ...
1 vote
1 answer
50 views

Why the biz day convention of OIS Rate helper is hard coded as Modified Following in QL?

I am using QuantLib OIS Rate Helpers, and traced schedule creation back to the following function, and noticed that the business convention is hard coded as MF. Is the biz day convention hard coded ...
1 vote
0 answers
41 views

When is the Quantlib's C++ to python package faster than just coding natively in python?

Every package I have used of the QL's python package thus far have been slower than my own local python functions. From what I understand, it's running C++ underneath, but if you are running loops/...
2 votes
1 answer
72 views

QuantLib: Pricing BRL zero coupon swap using relevant attributes in Quantlib

I am trying to price the BRL zero coupon swap. As we know that ZC swaps fixed payer pays a single payment at maturity and the float payer pays the interim payments till maturity. So in this case, ...
0 votes
0 answers
406 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
2 answers
452 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
570 views

Bootstrapping SOFR curve and Swap Payment Lag

Can someone provide me an intuitive explanation of how discount factors are bootstrapped for SOFR when Swaps are trading with payment delay/ lag (e.g. of 2 business days). I can intuitively derive the ...
0 votes
1 answer
105 views

Quantlib FRA and interpolated rate in Swaps vs BBG valuation

I am building a CZK swap pricer on quantlib, and I am trying to understand my differences with Bloomberg pricing. I believe the way I set up my FRA is wrong, the reason is because even though I match ...
0 votes
1 answer
2k 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 ...
0 votes
1 answer
132 views

QuantLib: How to price or construct a zero coupon swap using Quantlib

I am trying to construct and price the zero coupon swap. However its giving me the AttributeError: module 'Quantlib' has no attribute 'ZeroCouponSwap'. Please let me know how to price the zero coupon ...
0 votes
1 answer
109 views

Bumping forward rates in Quantlib for Bartlett SABR greeks

This might be a naive question, but in order to compute the Barlett vega: $$ \frac{d\sigma}{d\alpha} + \frac{d\sigma}{dF}\frac{\rho F^\beta}{\nu}$$ (for forward rate $F$, implied vol $\sigma$, and ...
1 vote
1 answer
102 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 ...
0 votes
0 answers
29 views

ConstNotionalCrossCurrencyBasisSwapRateHelper in QuantLib doesn't give expected result

I'm trying to bootstrap to get discount curve based on cross currency basis swap using ConstNotionalCrossCurrencyBasisSwapRateHelper in QuantLib. As a test, I tried to bootstrap the discount curve ...
-1 votes
1 answer
339 views

Guidelines for building complex C++ such as QuantLib and Open Source Risk Engine in VS Code in Windows

I am looking for a guide for build correctly complex C++ projects such as those for quantitative finance and financial engineering such as QuantLib and Open Source Risk Engine. I can configure ...
1 vote
1 answer
173 views

Quantlib - mismatch with BBG Swap

I'm trying to price a CZK swap via Quantlib with BBG data, so far nothing complicated but I can't seem to match the floating leg cashflows, and NPV, when I price my swaps, even if I find the right Par ...
0 votes
0 answers
40 views

Quantlib Bond yield jump on front end of the curve

I'm trying to build up a US treasury curves using Bills and bonds with the FixedRateBond class, however when I compared the ParYield from .bondYield() and zero_rate from yield curve instance. The ...
2 votes
2 answers
147 views

Extending/Subclassing QuantLib Classes in Python?

I'm using quantlib via the quantlib-python or open-source-risk-engine both on pypi. The question relates whether it's possible to extend QuantLib term structure base classes in python rather than C++....
0 votes
0 answers
85 views

Wrt speed, how optimised is QuantLib's Heston pricing class?

I have a pricing formula that is 300x the speed of the QuantLib's Heston pricing class. Is it incredibly slow? For context, on a slow 1.6 GHz Dual-Core Intel Core i5 processor, my method can reliably ...
1 vote
1 answer
375 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 ...
2 votes
1 answer
311 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: ...
1 vote
1 answer
583 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
44 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 ...
3 votes
0 answers
165 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. ...
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++: ...
0 votes
1 answer
248 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 ...
1 vote
2 answers
449 views

Cross currency swap valuation in QuantLib

Does QuantLib support valuation of Cross currency swaps ? Eg. SOFR / SONIA cross currency swap.
2 votes
1 answer
454 views

cross currency basis swap instrument in Quantlib [duplicate]

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 ...
0 votes
0 answers
39 views

Commercial bank mortgages schedule calculation

I need to calculate the schedule of a fixed rate mortgage and an adjustable rate mortgage. Is there an open source library, preferable in python, that already makes these calculations? I tried ...
0 votes
1 answer
65 views

Pillar Date of Overnight Interest Swap Helper

I am not being able to set the pillar date of an overnight interest swap helper to its maturity date. I have the following code: ...
0 votes
0 answers
33 views

Computation of CouponLegNPV using IsdaCdsEngine

I've recently been trying to work on and understand the concepts around CDS. By making simplifications (flat hazard rate, flat forward rate), I wanted to compare the values I could obtain by manual ...
4 votes
2 answers
330 views

Calculation of Cashflows Using ISMA Day Count in Fixed-Rate Bond

I'm working with a fixed-rate bond in QuantLib, and I have set the day count convention to ISMA, but I would like to understand how this specific day count convention is used in the calculation of the ...
0 votes
1 answer
391 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
1 answer
193 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 ...
1 vote
2 answers
162 views

QuantLib: How to bootstrap Yield Curve using 3M futures - Python

I need to bootstrap a yieldcurve with 3M futures, using a cubic spline if possible. Using, for example 3M Euribor, how do I bootstrap the yield curve using python? I have a vector of dates and a ...
6 votes
2 answers
270 views

Best practice in QuantLib Python to include borrow rate

When pricing a vanilla option, there are at a minimum 3 yield curves to consider: risk free yield curve = YC dividend yield curve = DC (or discrete dividends for American options but not the topic ...
1 vote
1 answer
165 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
1 answer
69 views

PV different from Dirty Price in QuantLib

As far as I understand, dirty price is the sum of clean price and accrued amount and should be equal to the Present Value (PV) of a bond at a certain yield rate. However, I can't replicate this ...
2 votes
1 answer
859 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 ...
2 votes
2 answers
471 views

Quantlib SOFR swap repricing across 2 different dates

I am trying to price SOFR swaps in two different dates (the same swaps, just different curves and dates) This are my initial parameters: ...
1 vote
1 answer
370 views

Understanding SOFR Fixing Rate Retrieval for Future Dates in QuantLib

I am using QuantLib to calculate the SOFR index for a bond's (ISIN : US025816CL12) cash flows. My objective is to understand how QuantLib computes the SOFR fixing rate for future dates. Here is my ...
0 votes
1 answer
206 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 ...
6 votes
2 answers
256 views

Replicating QuantLib plain vanilla Interest Rate Swap valuation

I'm learning QuantLib-Python and trying to replicate an Interest Rate Swap valuation on a custom curve constructed by passing lists of dates and discounting factors. Please see my code below ...
3 votes
1 answer
116 views

Quantlib: Is linking the curve to the discount curve important in vanilla swaps?

Below are steps I followed to value a few swaps. Just want to know if I have included the key steps in the below definitions. In some examples I found that we are also adding indexcurve.linkTo(). I ...
2 votes
1 answer
143 views

Generating normally distributed random numbers using Sobol generator in QuantLib

I am trying use low discrepancy Sobol RNG to generate normally distributed random numbers and fill an Eigen matrix with those random numbers. The matrix represents a basket of 5 assets (rows) each ...
2 votes
1 answer
103 views

QuantLib Python: How to print each caplet/floorlet value, intrinsic value and time value at each fixing date?

I have the following code to price a floor (can also be used for cap), and have been computing the payoff myself, but I think QL can already do this. Since the cashflows I print out aren't correct as ...
1 vote
1 answer
81 views

Zero Curve Interpolation Does Not recover Node point input rates

I having an issue with interpolation in QuantLib Python. Please see the code below for a minimum working example ...
0 votes
1 answer
429 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 ...
4 votes
1 answer
3k views

Quantlib: Greeks of FX option in Python

I'm using Quantlib in Python to price an FX option. I'm comparing the result to Bloomberg, to make sure the code is working correct. I also want to calculate all the Greeks, and eventually use those ...
3 votes
1 answer
1k views

Quantlib: day-by-day evaluation of option value

I'm using Quantlib in Python to price an FX option. I'm comparing the result to Bloomberg, to make sure the code is working correct. I want to calculate the P&L of a certain option trading ...

1
2 3 4 5
10