Questions tagged [quantlib]
Quantlib is an open-source C++ library for quantitative finance.
493
questions
0
votes
0
answers
92
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 ...
1
vote
1
answer
165
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
211
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
0
answers
163
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. ...
0
votes
1
answer
202
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.
2
votes
0
answers
186
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 ...
4
votes
1
answer
2k
views
Using QuantLib Python to value FX options using stochastic volatility
I would like to use QuantLib (and in particular the python wrapper) to value FX option using the Heston model. Thanks to http://gouthamanbalaraman.com and all of the articles therein : in particular ...
0
votes
0
answers
169
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
0
answers
75
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
1
answer
159
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
125
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
117
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
179
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
171
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 ...
0
votes
1
answer
581
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
263
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
171
views
1
vote
2
answers
422
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 ...
1
vote
0
answers
595
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
153
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
132
views
Quantlib add weekends as holidays to ql.BespokeCalendar()
Is there an easy way to add weekends to a BespokeCalendar calendar instance?
2
votes
1
answer
188
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 ...
2
votes
1
answer
245
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
190
views
1
vote
0
answers
203
views
QuantLib Two Asset Barrier Option
I am trying to price a two asset barrier option where each asset has its own barrier and both barriers have to be met for the payoff. The experimental TwoAssetBarrierOption class seems to accept only ...
0
votes
1
answer
205
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
1
answer
100
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
1
answer
200
views
Quantlib Piecewise CubicZero Bond Curve Bootstrap
I am looking for more details on Piecewise Cubic Zero for bootstrapping/interpolating treasury curve ? Does quantlib uses Cubic interpolation or Cubic Spline interpolation ? If Cubic interpolation ...
0
votes
1
answer
1k
views
how can i see the cashflows of a specific bond created in quantlib in Python? this is the code i have, how should i change it
This is the code i have, what would be the way to see the cashflows of this specific bond i created
0
votes
1
answer
497
views
Graeme West's VBA code Monotone Convex
Can somebody post Graeme West's VBA code for monotone convex interpolation if you have? I was struggling to find it.
0
votes
1
answer
699
views
Running Quantlib with Visual Studio Code in Mac
I wanted to run Quantlib with Visual Studio Code in Mac. I have successfully installed ...
1
vote
0
answers
260
views
Can I use the QuantLib Monte Carlo engine to price American options using heavy/fat tailed-distributed random numbers?
This might be silly, but I’m seeking to use QuantLib to price vanilla American call and put options using a Black-Scholes-Merton process and the Monte Carlo pricing engine based on the Longstaff ...
2
votes
0
answers
124
views
QuantLib option.NPV() returns interpolation error
I've been trying to price some barrier options with a Heston model on Quantlib and it works quite well most of the times, but sometimes I get the error: "interpolation range is [3.4314, 4.28384] ...
0
votes
1
answer
170
views
Quantlib: VanillaSwap not using underlying Index fixings correctly
I am trying to reperform a vanilla swap. The problem is that the vanilla swap object does not seem to be using the exact fixings of the underlying index.
...
2
votes
0
answers
764
views
How to build an inflation term structure in QuantLib?
This is what I've got, but I'm getting weird results. Can you spot an error?:
...
1
vote
0
answers
169
views
CORRA linked FRN's accrual interest calculation using the QuantLib
In Canada, the CDOR index will be phased out in June 2024, and the replacement is the CORRA (Canadian Overnight Repo Rate Average), which is an OvernightIndex used for evaluating the FRN in Canada. ...
1
vote
1
answer
175
views
Is float32 enough for option pricing?
Most quantitate libraries use float64 precision for monte-carlo or other method. Some academic papers do experiments on float16 and find it has some restrictions on float16.
I just wondering if ...
1
vote
1
answer
208
views
Quantlib Yield curve and rate compounding [duplicate]
I need help in understanding Quantlib's interpretation of yield curve and rates. The rate output retrieved from yield curve differs from expectation for non continuous cases.
Illustration:
Let's start ...
0
votes
2
answers
399
views
Quantlib yield curve - zerorate output differs from expectation
I was creating an yield curve using zeroRate, when I read back the value from the created yield curve - it differs from expectation.
...
0
votes
1
answer
299
views
Pricing IRS over a range of days using QuantLib
I'm trying to figure out the way to value SONIA swap over the range of days based on the example in the QuantLib Python book (which has bonds in it).
...
4
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
...
0
votes
1
answer
227
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
1
answer
97
views
Bond Discounting Error With QuantLib
I have a list of bond coupons, their maturities and their current price. I want to find their corresponding discount factors. The code I have used is from the QuantLib cookbook, attached below:
...
0
votes
1
answer
472
views
falling flatforward curve in quantlib
I am trying to create a floating rate bond where I need to create a flatforward curve, but the curve seems falling over the time, or is there any way to keep the rate constant.
...
1
vote
1
answer
2k
views
Quantlib: Getting error trying to price a Swap
I have bootstrapped my curve based on end-of-day data for 24th Nov, 2017
I am then using that to price a off-market swap as below:
...
0
votes
0
answers
477
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++...
1
vote
1
answer
302
views
QuantLib in Python - RuntimeError: could not bootstrap optionlet:
I receiving the following error when I try to compute a cap price. However, I'm not sure how to solve this error.
" error: nu (-1.00062) must be >= -1.0 expiry: June 4th, 2020
annuity: 0....
1
vote
0
answers
106
views
Calibrating HW 1f model params to a term structure market data
I am using Quantlib to calibrate the HW model params to the market swaption price. The attached chart shows the performance of the calibration.
Am I correct in saying, this is expected for the 1f HW ...
1
vote
0
answers
195
views
QuantLib: Modeling GBP-6M-Libor Fixed-Float swaps as valuation date after 2021-12-31 using QuantLib
Starting from January 2022, LIBOR fixings/rates for most currencies (GBP, EUR, CHF, JPY) will be discontinued. After the switching date 2021-12-31 , such floating-rate bonds will effectively have two ...
0
votes
2
answers
588
views
QuantlIb: How to use maturities in place of Tenors in OIS rate helpers Quantlib?
I would like to know if I can use maturity dates from my rates dataframe to generate OISratehelpers. In the following code the OIS rate helper use 'tenors' and I want to replace those tenors with ...