Questions tagged [quantlib]
Quantlib is an open-source C++ library for quantitative finance.
447
questions
0
votes
0
answers
45
views
fixedLocalVolSurface class in QuantLib 1.29 (Python)
I am using the Python interface to QuantLib 1.29.
I have an own implementation of the Local Volatility (LV) interpolator and I would like to use it within QuantLib.
I would like to represent it as a ...
0
votes
0
answers
45
views
Quantlib - bond with capped coupons
Using QuantLib I want to price a Floating rate bond whose coupons are capped at some rate.
I understand I could price the coupon caps separately and then add that to a zero-bond.
However, I've noticed ...
0
votes
0
answers
33
views
Gilts using QuantLib [closed]
Gilts apply an ex-dividend period on accrued interest. It is
starting from trade-date to 7 business days prior to cpn payment date, or
starting from settle-date to 6 business days prior to cpn ...
1
vote
0
answers
95
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 ...
0
votes
1
answer
105
views
Does QuantLib have a DayCount convention that supports India financial year calculations?
I'm currently using QuantLib to perform financial calculations in my application, but I'm having trouble finding a DayCount convention that supports the India financial year calendar (April 1 to March ...
0
votes
0
answers
25
views
Use `LocalVolTermStructureHandle` in Python QuantLib
I would like to simulate a local volatility underlying
$$ dS_t = S_t\sigma(t, S_t)dW_t $$
and have looked at QuantLib's LocalVolTermStructureHandle to do so.
So far:...
1
vote
0
answers
27
views
Python Quant Lib - Bond Pricing ex coupon period [closed]
were wondering If anyone knows how to use rate bonds on Python Quantlib, that have
an ex-coupon period.
For example the link below shows the construction of such a bond in the c++ quantlib
using
...
0
votes
1
answer
90
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
0
answers
36
views
How to calculate forward swap curves for different tenors using QuantLib in python
I am interested in calculating the forward curve for different swap tenors. I have the below code in Python, but I believe that this only calculates the forward discount curve. Are we able to modify ...
0
votes
0
answers
69
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 ...
0
votes
1
answer
58
views
Quantlib interpolated zero rates not as expected
I have created a piecewise linear zero curve using quantlib (c++). It's a NACA, modifiedFollowing swap curve. When I extract the zero rates on the pillar dates the rates line up with what is expected ...
1
vote
0
answers
121
views
Cross currency swap valuation in QuantLib
Does QuantLib support valuation of Cross currency swaps ?
Eg. SOFR / SONIA cross currency swap.
1
vote
0
answers
41
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 ...
0
votes
1
answer
123
views
Option Prices And Calibrating The Heston Model Code Question
I'm trying to understand this Python code that uses Quantlib to calibrate the parameters of the Heston model. The data that is provided in the code is the spot price, the risk free interest rate, the ...
0
votes
0
answers
61
views
Quantlib GitHub and Documentation instructions mismatch
There is a mismatch in the Quantlib documentation instructions and Quantlib GitHub, on pricing simple bonds and term structure building, ql.Schedule
I believe IssueDate should go in ql.schedule not a ...
0
votes
1
answer
47
views
Quantlib date hour time in ql.Date()
How does the quantlib set up hour time, say in the example below:
ql.Date(20, 1, 2023), US calendar,
what is the time, 12 AM US time? local machine time?
say I would like to set up a NY 4 pm time, is ...
0
votes
1
answer
103
views
QuantLib including holiday in option price
I am trying to add a holiday to my calendar in QuantLib such that my option pricing model considers this in pricing where I would expect that the time to expiry should decrease with the inclusion of a ...
0
votes
1
answer
83
views
Forward pricing of cashflows with QuantLib - Python
I am building a tool with Quantlib (Python) to work on the forward pricing of different types of assets (inflation linked, amortizing, vanilla, zero coupon bonds).
For a number of reasons I am using ...
0
votes
1
answer
61
views
QuantLib: How to check or access the QuantLib version in conda prompt or spyder?
I didnt find the answer in QuantLib library. This will surely help to get the track of quantlib version and installed package versions.
0
votes
0
answers
79
views
Quantlib t bills price using DepositRateHelper or FixedRateBondHelper
EDIT:
I edit my question, as I didn't get any answers,
my previous question was why in the python quantlib cookbook we see 2 different approaches for t bills 1. example using DepositRateHelper and 2. ...
1
vote
0
answers
37
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 ...
0
votes
0
answers
24
views
Help with Quantlib DepositRateHelper (unexpected maturity dates)
I've been working with the Quantlib DepositRateHelper and get some unexpected maturity dates and date pillars from the helpers when I have constructed them.
In the example below, I have set a range of ...
0
votes
0
answers
91
views
Quantlib Build a yield curve with 2 day conventions
I am following the example below;
build a yield curve using tbills(deposit rates) and bonds,
in the final step yield curve is built using deposit and bond helpers,
but in the case where I have ...
0
votes
1
answer
60
views
Python Quanlib : yearFraction returns same number when I change the valuation date
I am completely new to python/coding so apologies in advance if the question is too basic but I could not find the answer elsewhere.
I am trying to calculate the daycount fraction from the settlement ...
0
votes
0
answers
53
views
Quantlib Piece-wise Heston for Monte Carlo Path Generation
I am trying to use a piece-wise heston to generate paths for a Monte Carlo Simulation. I create and calibrate a ql.PiecewiseTimeDependentHestonModel as in the example on the ql doc python site:
https:/...
0
votes
0
answers
52
views
Quantlib Monte Carlo using regular Volatility Surface, not Local Volatility surface
I am trying to run a Quantlib Python Monte Carlo simulation using either the ql.BlackScholesMertonProcess or the ql.GeneralizedBlackScholesProcess. I have a vol surface that I have generated using ql....
0
votes
0
answers
67
views
Quantlib Local-Volatility Code
I use QL in python and have had a few questions about how a vol surface is transformed into a local volatility surface. Would anybody be able to point me to the C++ code that does this transformation?
...
0
votes
0
answers
85
views
How to calculate YTM of AmortizingFixedRateBond in QuantLib - Python?
I'm trying to calculate the ytm of bonds amortized in quantlib. The maturity of this bond is five years, starting from the second year to repay 25% of the face value until the last year.
The cash flow ...
2
votes
0
answers
101
views
Quantlib vol surface issue 'the black vol surface is not smooth enough'
I create a vol surface from the market and do smoothing(interpolation and extrapolation), and explicitly correct for any total variance decreasing on a given strike as we increase maturity. I create a ...
0
votes
1
answer
182
views
Help plz - Quantlib daycount ql.ActualActual() error
Hi I am trying to create a zero curve from continuous rates data. I keep getting an error "RuntimeError: two dates correspond to the same time under this curve's day count convention". What ...
1
vote
0
answers
84
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 ...
0
votes
1
answer
81
views
0
votes
1
answer
48
views
Quantlib Vanilla Swap Amount not based on Forwards
I have the following code:
...
0
votes
0
answers
92
views
QuantLib: EUR Implied Curve using FxSwapRateHelper
I'm trying to construct a EUR implied curve using FxSwapRateHelper in QuantLib. I can't get the dates to match those in FRD in Bloomberg without an error. If I use ...
0
votes
0
answers
84
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
0
answers
179
views
Pricing a Digital Barrier Option using QuantLib in Python [closed]
I'm trying to price a EURUSD digital knockout in QuantLib/Python. Ideally would like to get the same output as this stylized Bloomberg OVML model (OVML EURUSD DIKO 1.0000P B0.9500 01/13/23 N1M). I ...
0
votes
1
answer
71
views
How to efficiently shift BlackVarianceSurface to compute the vega, volga and vanna of an option
I am working with a vol surface that was created as a BlackVarianceSurface.
Now I would like to compute the "vol" greeks for a product and as such I need to shift that surface by a small ...
0
votes
1
answer
83
views
Quantlib add weekends as holidays to ql.BespokeCalendar()
Is there an easy way to add weekends to a BespokeCalendar calendar instance?
0
votes
0
answers
78
views
Accrued Interest and Forward Pricing of Bond with Quantlib
I'm working on a forward bond pricing engine so i can either calulate the repo rate, or the forward price of the operation.
I'm using bloomberg as a reference to see if my values are right.
First ...
2
votes
1
answer
84
views
How do you handle non integer time intervals in Quantlib for options pricing (ie intraday pricing)
I'm using QuantLib (python version) for options pricing, and am trying to figure out how to handle non integer dates. If you try and price an option at 9:30 AM and at 4 PM, you should get different ...
1
vote
2
answers
237
views
Quantlib issue with BlackVarianceSurface diffusing with the wrong vol when there are either holes or arbitrages in early maturities
I'm new to Quantlib in Python and I'm running into a quite awkward situation.
I have a vol surface from the market on the SPX index. Not all strikes/maturities are populated. In addition, there could ...
2
votes
1
answer
159
views
Optimize interest rate swap calculations in Monte Carlo Simulation
I’m running a simulation in which I want to calculate the NPV of 100 swaps over 1000 (or even much more) different interest rate curves.
It looks like Quantlib is not really fast in performing these ...
0
votes
1
answer
89
views
Does QuantLib have functionality to value ILS Telbor swaps?
I didn't find the ILS Telbor class in QuantLib website and also reference online. Please let me know if we can value such swaps using QuantLib. For example ...
0
votes
1
answer
107
views
0
votes
1
answer
116
views
USD Libor fixing rule
I am missing something in the fixing rules for USD Libor: the fixing for the date Aug 31th, 2022 is on Aug 26th, 2022 - 3 ...
0
votes
0
answers
55
views
0
votes
1
answer
69
views
how to add redemptions to amortizing floating bond in dates that are not coupon dates
How can I in QuantLib add redemptions to a AmortizingFloatingRateBond that follow in dates outside the Bond Schedule?
...
0
votes
0
answers
68
views
Svensson fitting for ois curve
I am currently bootstraping ois curve using PiecewiseLogCubicDiscount method in QuantLib for python. There are some requests for using Svensson and NelsonSiegel parametric models also in order to get ...
0
votes
0
answers
160
views
QuantLib FX implied curve
I have a set of USDEUR FX forwards and USDEUR cross currency swaps (linked to overnight rates) and I've built both ESTR and SOFR curves using QuantLib.
How can I use QuantLib to generate a discounting ...
0
votes
0
answers
153
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 ...