Questions tagged [quantlib]
Quantlib is an open-source C++ library for quantitative finance.
469
questions
0
votes
1
answer
140
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:
...
1
vote
2
answers
353
views
How to install QuantLib with Python SWIG for the first time?
Have just installed Quantlib on Mac
now trying SWIG for Python but get below error
...
2
votes
1
answer
744
views
Price Barrier Options on Baskets using Quantlib
Is it possible to price barrier options on a basket of stocks using Quantlib, e.g. a Worst-of Down-and-in-Put on a basket of 3 stocks?
I already checked the ...
1
vote
1
answer
1k
views
QuantLib FittedBondDiscountCurve fitResults [Error]
I try to use FittedBondDiscountCurve with NelsonSiegelFitting, but I faced with error when call fitResults() method:
...
1
vote
1
answer
2k
views
Constructing yield curve directly from yield-to-maturity data
I'm trying to use Bloomberg yield-to-maturity data for sets of sovereign bonds of different maturities to fit to a yield curve. I looked into using the QuantLib library (the FittedBondCurve ...
2
votes
1
answer
1k
views
Calculating the greeks for Quantlib Python Swaptions
So I have created a Swaption object and can get the premium with the NPV() function. However, I would also like to calculate the greeks (eg. delta, vega).
From some searching, I found that vega can ...
10
votes
4
answers
1k
views
How do you check your option calculations?
I'm implementing a bunch of different algorithms to price options/find Greeks: finite difference, Monte Carlo, binomial...
I'm not really sure how to check my calculations. I tried using QuantLib to ...
3
votes
3
answers
8k
views
How to build a cross currency swap pricer?
We're looking to build a pricer to convert a funding spread in a given currency over a specific funding basis e.g. 20 bps EUR 3m€ and convert it to a funding spread to a different currency with a ...
1
vote
0
answers
718
views
FIX engines comparison
Need help, looking for some comparison between c++ FIX engines, like onixs, antenna and some fpga solutions.
If anyone has experienced some of the named engines also would like to hear the ...
-1
votes
1
answer
91
views
Open source code based on quandl for security analysis and options priming
Quandl seems to be an excellent source of wide range of free/open financial data. But is there an open source code or platform that uses the quandl datasets to perform security analysis and option ...
0
votes
0
answers
447
views
Quantlib xll - Converting deposit/swap curve to zero curve
I am trying to create a spreadsheet using the Quantlib xll to convert deposit/swap rates to zero rates. I tried to implement such by referencing to the C++ code listed here:
How to sum interest rate ...
5
votes
1
answer
7k
views
How to calculate bond yield in QuantLib - Python
I want to calculate yield of bond having market price and coupons. I try to replicate C++ from (https://mhittesdorf.wordpress.com/2013/03/03/introducing-quantlib-internal-rate-of-return/) in Python ...
5
votes
1
answer
620
views
How many ways can QuantLib handle the price of option on its maturity date?
I have been playing with QuantLib for some time. This is a great framework with amazing design and capabilities. However, one thing that I find hard to understand is the way it handles the price of ...
3
votes
3
answers
2k
views
Compiling QuantLib example
I have followed the guidlines for installing QuantLib for mac from here http://quantlib.org/install/macosx.shtml and also fixed the flags using the commands:
export CXXFLAGS = -stdlib=libstdc++
...
1
vote
0
answers
165
views
Quantlib binomial tree
I was trying to price options with the extendedBinomialTree class of quantlib. I actually tried at some point to modify this class in order to optimize it. Normally the drift and diffusion of the ...
2
votes
4
answers
2k
views
Quantlib with python on mac?
Is there anyone who knows a good guide to get quantlib working for python om mac?
I have tried to search online and have not found any good guidance. I need to use quantlib for a project on python.
...
5
votes
4
answers
3k
views
How to select the initial guess for implied volatility?
When we calculate the implied volatility, we would need to give the solver a range to start with. For example, QuantLib uses [0,4.0] for the range, which is another way of saying try all possible ...
1
vote
1
answer
1k
views
Why QuantLib assumes zero rates to discount factor is continuous?
https://github.com/lballabio/QuantLib/blob/0ec43027834220baf0a554d68de79a159a2c5489/ql/termstructures/yield/zeroyieldstructure.hpp
...
1
vote
1
answer
105
views
AmericanOptionImpliedVolatility strange answers for calls IV's
My data provider includes the greeks. I tried to compute the IV's myself using RQuantLib and see if they match -- for Puts it's generally close, for Calls however certain values are way way off -- any ...
2
votes
1
answer
2k
views
AmericanOptionImpliedVolatility - root not bracketed issue in QuantLib/R
I'm trying to compute an implied volatility -- I am trying to match real data I see in Yahoo finance which shows an IV of about 27%. My call in 'R' for the same params returns a root not bracketed ...
2
votes
1
answer
433
views
Debugging Quantlib
I am trying to understand Quantlib's finite-difference pricer using Eclipse with GDB debugger.
The code shown below prices an American put option using the Crank-Nicholson finite-difference scheme.
...
1
vote
1
answer
289
views
QuantLib: New Instrument derived from VanillaOption + PricingEngine that must work for both VanillaOption and the derived class
The derived class is a Vanilla Option on a Future and I need to specify the expiry of the underlying future which is in general different (later) than the expiry of the Vanilla Option. I have ...
2
votes
1
answer
713
views
How to price touch options using quantlib?
I am new to quantlib and I want use it to to price a touch option (single/double).
I searched on google for example code but I could not find anything. Hence, I am ...
3
votes
1
answer
368
views
QuantLib C++: Monte Carlo Engine with SequenceStatistics
I'm trying to implement a Monte Carlo PricingEngine that stores multidimensional statistics.
I have done the following:
Defined a Monte Carlo Trait that among other things stores as the ...
5
votes
1
answer
461
views
QuantLib: Is the StochasticProcess class adapt for a HJM type of modelling?
I would like to use the following model in QuantLib:
$\frac{dF(t,T)}{F(t,T)} = \sigma_se^{-\beta(T-t)}dW_{t}^{1} + \sigma_L\left(1-e^{-\beta(T-t)}\right)dW_{t}^{2}$
This is a reformulation of the ...
12
votes
4
answers
4k
views
Why does it take so many lines of code to price even the simplest of options with QuantLib
I have been looking at QuantLib I am trying to figure out why I need to write so much boilerplate code even when pricing the "simplest" of European Options using the analytical Black-Scholes formula (...
5
votes
2
answers
925
views
Are there missing methods in QuantLib python?
I'm reading Introduction to Selected Classes of the QuantLib Library I by Dimitri Reiswich and am trying to "convert" it to Python.
It seems to me that some C++ possibilities aren't available in ...
1
vote
0
answers
277
views
RQuantLib FixedRateBondPriceByYield() Non-tradable error
How do I use FixedRateBondPriceByYield() function on maturity date that is earlier than today? I get "non tradable error" when applying on date older than today.
<...
2
votes
1
answer
2k
views
Quantlib bootstraping fails on 5y swap
I'm trying to build a euro swap curve with real up to date data. I should say that examples provided in github work fine.
as soon as I add the 5y swap, I got the following error :
...
0
votes
1
answer
230
views
Binary Option valuation problem in R using RQuantLib; also result validation aspect
When I am trying to value Binary Option using RQuantLib I am not getting all the greeks for exctype "american" wheras "european" exctype is fine. What is the problem here ?
...
3
votes
1
answer
1k
views
Quantlib FuturesRateHelper triggers not a valid IMM date error
I'm beginning to use QuantLib with Python SWIG, and trying to build a EUR yield curve.
I face this error which frankly I don't understand; I looked at the code of bool IMM::isIMMdate in imm.cpp and ...
1
vote
0
answers
162
views
QuantLib C++: Friendship dilemma between derived class from PiecewiseYieldCurve and Bootstrap class
I derived a class template, OISCurve<Traits,Interpolator,Bootstrap>, from ...
2
votes
1
answer
746
views
CallableFloatingRateBond in QuantLib: just a matter of multiple inheritance?
I would like to know what are the issues related to a possible CallableFloatingRateBond class in QuantLib and to have some hints on implementation.
My (very ...
3
votes
2
answers
2k
views
Why QuantLib computes the fixed-leg swap rate by this formula?
I'm trying to understand how QuantLib creates (bootstraps) a yield curve from a vanilla swap at the source level. I have the following test code:
...
12
votes
5
answers
19k
views
How to learn QuantLib-python at first?
In my project, I have to get the delta of up and out call option (with vol surface). I found out that QuantLib might help me on that.
Since my main language is python and I don't know well about C++, ...
1
vote
1
answer
323
views
Quantlib FRA with shifted start date
I'm new to quantlib. I am trying to construct a PiecewiseYieldCurve. I been looking at the implementation of FRA. It seems that the start date of the FRA must be an integer number of month from the ...
3
votes
2
answers
3k
views
How to use quantlib with excel?
I installed an quantlib on my mac, but have no idea, how to start using it with an excel. Please advise hoq to do it. I followed all instructions here:
http://quantlib.org/install/macosx.shtml. I ...
4
votes
1
answer
248
views
Why risk-free interest is needed for Margrabe's Formula?
The source code for Margarble's formula in QuantLib is here. The implementation requires a forward price be computed:
...
3
votes
1
answer
991
views
Best way to do multithread Monte-Carlo in QuantLib
QuantLib has great facilities for Monte-Carlo pricing engines, classes McSimulation and MonteCarloModel do a lot of work. But they do it in a single thread. What is best way to introduce parallel run ...
4
votes
1
answer
796
views
Black model: Delta - strike relationship regardless of expiry?
While wandering through some QuantLib experimental classes for FX trading, I've found this Black Delta Calculator.
By reading its .cpp, it seems that no use of ...
2
votes
2
answers
4k
views
Bootstrap yield curve with QLNet / Quantlib
I am trying to grasp QLNet (C# version of Quantlib, all the functions of Quantlib have the same name and work the same way, so if you just know Quantlib, you can still help me), especially for pricing ...
3
votes
0
answers
124
views
How do I specify Thirty360::European day counter in RQuantLib
I am taking liberty to ask the following question in quantLib forum though this question is about RQuantLib
I am trying to use RQuantLib to calculate clean price of a fixed coupon bond using a Nelson-...
6
votes
1
answer
234
views
BlackProcess' constructor $x_{0}$ argument in QuantLib
I am currently using BlackProcess to price options and I have a doubt related to the $x_{0}$ argument of the constructor: I've figured out it should be the forward ...
7
votes
1
answer
3k
views
QuantLib: Black / BSM processes and pricing via volatility surface. Different results?
I start this question with a couple of C++ functions that will be useful to show some results. So start your Visual Studio C++ Express or Ceemple or whatever you want and copy & paste this:
...
8
votes
1
answer
6k
views
Pricing a FixedRateBond in Quantlib: yield vs TermStructure
I am trying to price a simple U.S. treasury in QuantLib, using two methods. The first method calls FixedRatebond.dirtyPrice(...), passing in a YTM and other parameters.
The second method involves ...
1
vote
1
answer
1k
views
novice question on fixed coupon schedule in QuantLib
For some bonds I work with the last coupon date is not equal to bond's maturity date. E.g. the last coupon date is April 25th, 2020 and maturity date is April 25th, 2021. I looked at Schedule class ...
2
votes
1
answer
466
views
QuantLibXL - Optionlet bootstrapping failure
I am trying to bootstrap the Optionlet volatility surface from a Cap/Floor volatility surface using QuantLibXL. To be specific, the data is from ICAP:
...
6
votes
1
answer
366
views
Pricing a bond with variable strike collar with QuantLibXL
I am trying to price a floating rate bond with a capped and floored interest rate.
The strikes of the caps and floors vary, but are known in advance.
I am trying to do this with QuantLibXL, but I am ...
4
votes
1
answer
2k
views
How to manage evaluation date changes in QuantLib while using ImpliedTermStructure Class
I will not attach the whole code 'cause it would be just a huge waste of space and it would be not useful for this question's purpose.
What I am going to attach here is a snippet code and its output, ...
3
votes
1
answer
2k
views
How to sum interest rate curves in QuantLib
C++ code taken from Bonds.cpp and slightly amended:
...