Questions tagged [quantlib]
Quantlib is an open-source C++ library for quantitative finance.
493
questions
0
votes
1
answer
3k
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
1
answer
97
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 ...
0
votes
1
answer
1k
views
What is the cause of this error 'TypeError: Wrong number or type of arguments for overloaded function 'new_HestonModelHelper'?
I'm simulating the option prices every month using the Heston Model. The option contract expires at the of the month and the next option contract start the day after the previous contract expire. In ...
0
votes
1
answer
1k
views
Getting a daily forward OIS rate curve with QuantLib in Python
I am trying to build a 1-day EONIA forward curve with QuantLib giving OIS yields from 1mo to 50yr as input.
My current approach consists on (i) obtaining the yield curve with ...
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
2
answers
940
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
1k
views
Struggling with Modeling Convertible Bond using Python
I am trying to price Convertible bond with the following data:
price = 5.11
coupon = 0.0575
frequency = semi-annual
risk free rate = 0.02347
conversion Ratio = 3.8095
Conversion Price = 26.25
...
0
votes
2
answers
564
views
Issue in Pricing Binary Options using Heaviside Function and QuantLib Python
I am trying to price binary option using MC Simulation and Python QuantLib Library. The price of the option matches with the Analytical Engine. However, I am not sure how to incorporate the Heaviside ...
0
votes
1
answer
602
views
Issue in Pricing Barrier Options using MCBarrierEngine in QuantLib Python
Extremely sorry for bugging the community again, but I am struggling with finding proper documentation of QuantLib Python. I am trying to price Barrier Option using MC Simulation. Here is the code:
<...
0
votes
1
answer
888
views
Calculating the Option price using Quantlib
I can calculate the fair price of a European Option using Quantlib as below -
...
0
votes
1
answer
164
views
How to price an Annuity
When we price a fixed rate bond using Quantlib, we generally take below approach -
...
0
votes
1
answer
374
views
How to calculate basis swap fair spread Using Quantlib 'floatfloatswap'?
I am trying to calculate a single currency basis swap by using the Quantlib floatfloatswap function.
Please advice if I am doing wrongly.
...
0
votes
1
answer
134
views
Swap date doesn't match
I use quantlib to bootstrap yield curve from deposit rate, future price and swap rate. But after I get curve, the date in curve.nodes() doesn't match the date of swap.
Here is the code:
...
0
votes
1
answer
826
views
float float swap in quantlib
I'm using quantlib to calculate a fair spread of Libor/OIS swap. I have read the reference of ql.Swap and ql.FloatFloatSwap. But the document is too vague. I totally can't understand what parameters ...
0
votes
1
answer
965
views
Quantlib : How to resolve ' more than one instrument with pillar' in valuing swaps?
I had valued interest rate swaps of most of the currencies keeping my valuation date as 13th Sep 2019. But I faced a problem of 'RuntimeError: 2nd leg: more than one instrument with pillar December ...
0
votes
1
answer
255
views
0
votes
2
answers
568
views
Value a Swap with Custom Coupons with QuantLib
I'd like to valuate a custom Libor3M - Fix swap with QuantLib in Python. With custom I mean, custom starting/end/payment dates for every coupon, a fixed coupon in the float leg (starting_date < ...
0
votes
1
answer
258
views
Swaptions vols,object using quantlib xl
How can I build a good vol surface using QuantlibXl?
My goal is to price a swaption 5 year with option maturity 1Y1M.
The data are:
0
votes
1
answer
219
views
How to make the effective date to start on a holiday/weekend in py QuantLib?
I'm trying to price a non-standard swap. However, my schedule is not returning the correct dates. In particular, the effective date starts on a Saturday but the schedule returns the next biz date ...
0
votes
1
answer
216
views
Removing/Purging QuantLib/Boost
I recently updated to Ubuntu 20.04, as well as to R v4. When updating packages, I ran into an issue with QuantLib. I tried removing/reinstalling, but the reinstall was a different version. RQuantLib ...
0
votes
1
answer
232
views
0
votes
1
answer
394
views
Pricing Compound Options using QuantLib
I am trying to price Compound Options using QuantLib on Python. I've looked around but am unable to find any sample code. I believe that the CompoundOption Class ...
0
votes
1
answer
1k
views
Zero Curve from a par curve curve QuantLib
I'm trying to understand why pricing a par bond with zero curve, contracted from par bonds themselves doesn't give me par.
(Based on examples here)
...
0
votes
1
answer
486
views
0
votes
1
answer
468
views
How to use QuantLib.IborIndex in python?
QuantLib users.
I'm trying to use ql.IborIndex(...) using this example but for USD currency. However, I receive a type error of the following. How can I use this ...
0
votes
1
answer
1k
views
Python Quantlib : How to value the Non Deliverable currency Interest Rate Swaps?
I followed all the procedure in Quantlib to process interest rate swap valuation through Python Quantlib. I valued more than a million records. All the valuation is almost the expected amount. But '...
0
votes
1
answer
425
views
Why does changing the evaluationDate multiple times lead to a performance lag?
I am simulating an swaption strategy through time. Following the examples in the Python Quantlib cookbook, as I progress through time I am updating the internal evaluation date
...
0
votes
1
answer
346
views
Constructing Daily Term Structure
I am very new to QuantLib and am trying to do Swaption Model calibration following the example here:http://gouthamanbalaraman.com/blog/short-interest-rate-model-calibration-quantlib.html
Appreciate ...
0
votes
1
answer
2k
views
How to calculate premium in Black Scholes model with quantlib?
I am new to quantlib as well as option price modelling. I need to get premium from black scholes model and found this code in internet
...
0
votes
1
answer
698
views
how to change the value set by the addFixing method in QuantLib
Suppose we have had constructed an index for forecasting future interests of a floating bond, and as suggested by the official document, I used addFixing method to set a past fixing for the current ...
0
votes
1
answer
2k
views
QuantLib Python price same swap on different evaluation dates
I want to use QuantLib Python to price a swap at 2 different evaluation dates during the life time of the swap. The following is what I've tried so far:
...
0
votes
1
answer
152
views
Premium result with BlackProcess not in line with online engines
I'm trying to implement BlackProcess with Quantlib (in C#) and the result I get for NPV() is not inline with some resources I can find online. Here is my code:
...
0
votes
1
answer
115
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 ...
0
votes
0
answers
31
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 ...
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 ...
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
0
answers
34
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 ...
0
votes
1
answer
67
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
255
views
Building a forward curve for multiple tenors - Quantlib python
I am attempting to build a forward curve for multiple tenors (1M / 3M / 6M / 12M) using the quantlib library. The input to my model are sofr swaps(1W through 50Y). It appears I am building my curve ...
0
votes
0
answers
50
views
How do I obtain the RMSE from a QuantLib curve estimation?
I'm estimating yield curves in Python using the QuantLib package and the included Nelson Siegel, Svensson, specifications. I can get the estimated parameters, but I would like to see a measure of the ...
0
votes
0
answers
114
views
QuantLib: Getting the present value of a leg of cashflows using a 'risk-free' yield curve
I am trying to evaluate the present value of some cashflows and QuantLib does not return the discount factors that I am expecting.
I have a Risk Free (Zero Coupon Bond) Yield curve:
...
0
votes
0
answers
90
views
Calculation of accruals using Actual/Actual AFB day count convention in QuantLib library
I am using the QuantLib library to calculate accruals for a fixed rate leg, using the "Actual/Actual AFB" day count convention. The payment period is annual, and the cash flows occur between ...
0
votes
1
answer
575
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
144
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
295
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
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 ...
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.
0
votes
0
answers
166
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
0
answers
77
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
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 ...