All Questions
Tagged with programming option-pricing
80 questions
2
votes
0
answers
57
views
Help with Implementing Basket Option Pricing Code from Borovkova, Permana, and van der Weide (2007)
I'm working on pricing basket options for my research and am referencing the paper "A Closed Form Approach to the Valuation and Hedging of Basket and Spread Options" by Svetlana Borovkova, ...
0
votes
0
answers
53
views
Finite Difference Grid for Asian option + python
I am trying to write python code to price an Asian option (call payoff at maturity = avg(S(T)) - E, i.e. average of the asset price - strike) with FDM and grid. I have the following code, but the ...
0
votes
0
answers
44
views
Quantlib Heston MC Discrepancy between methods
I am a newbie at Quantlib (not finance) and am trying to price with the Heston model. I have implemented two different ways to verify the correctness of the Heston path generation to use in a custom ...
4
votes
1
answer
294
views
To estimate the parameters when only the characteristic function is known to us
Recently I was working with a process named Variance Gamma with Stochastic Arrival (VGSA) and trying to fit this process on a given data.
To obtain VGSA, as explained in Carr et al. [2001], we take ...
0
votes
1
answer
153
views
Why is my Risk Neutral Density recovery failing?
I'm working on a project to recover a known Risk Neutral Density from option prices, using the Breeden-Litzenberger formula (assuming a continuum of option_price(strike_price), the second derivative ...
1
vote
0
answers
371
views
Longstaff & Schwartz algorithm - Python: American option cheaper than European option
I have implemented the Longstaff & Schwartz algorithm for pricing American Option in Python, but I ran into an issue while doing some experiments: sometimes, for the same option, I get a higher ...
0
votes
1
answer
401
views
How to calibrate a volatility surface using SSVI with market data?
Context
I'm a beginner quant and I'm trying to calibrate an vol surface using SPX Implied Vol data. The model is from Jim Gatheral and Antoine Jacquier's paper https://www.tandfonline.com/doi/full/10....
3
votes
0
answers
310
views
Financial software: academia vs. real world [closed]
I am looking for resources (if they exist) that explain the differences between quant finance software in academia and the real world, or explain how quant software is implemented in practice.
For ...
0
votes
1
answer
145
views
Uncertain Volatility Model - Option Pricing R code help
I am trying to price the following call option using the UVM method in R.
The code I wrote below keeps producing the same price for the min and max volatilities, which is wrong, however, I can't seem ...
2
votes
1
answer
375
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
votes
2
answers
523
views
Pricing European Call Closed Form Spread Options in Python
I am currently trying to correctly price European Call Closed Form Spread Options using Python. The main problem I am currently running into is that I have nothing to compare the option price so that ...
4
votes
1
answer
841
views
Bartlett's delta gives wrong signs for calls and puts
There is a paper by Bruce Bartlett introducing a modified delta for SABR model which accounts for the correlation between forward and volatility processes. The main result of the paper is that if $dF$ ...
2
votes
1
answer
553
views
Gamma for a basket option in Python - Finite Differences vs. AAD Autograd library using Heaviside Approximation
I have been trying to use the Heaviside Approximation for a simple basket option so that I can solve for Gammas with AAD (Adjoint Automatic Differentiation). This routine smooths the payoff function ...
1
vote
1
answer
1k
views
Basket option value calculation
I am reading the article, where different approximations for the pricing of basket options are presented. I have tried to reproduce the result obtained by the Gentle's method in Python.
We define the ...
2
votes
1
answer
385
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 ...
0
votes
1
answer
624
views
Option pricing Greeks in Python - incorrect Gamma with MC option pricing (Black) using AAD autograd / JAX libraries - but works with closed form?
I am attempting to use AAD (Adjoint Algorithmic Differentiation) with a simple Black MC pricer, and found that the Gamma is incorrect. The output was compared to Black analytical Greeks, as well as ...
0
votes
0
answers
454
views
Monte Carlo Pricing of Barrier Options - can't figure out where I'm wrong
I'm trying to price a simple Up-and-out Barrier option using Monte Carlo; haven't even implemented the variance reduction but it's already glitching.
The code seems right, but I'm not sure where it's ...
1
vote
0
answers
80
views
Extend basket analytic solution (equal weighted) to a various weight basket, also put formula
So I coded up the solution from here: Do basket options have a closed form valuation formula?
Which provides a good solution for equally-weighted underlyings under a Black model. The simplified ...
0
votes
0
answers
2k
views
Bloomberg OVML| FX option pricing | Python
Wanted to check if any API for python is available to replicate Bloomberg's OVML.
The objective is to perform FX options pricing for multiple positions, and we are getting stuck in calculating ...
1
vote
0
answers
171
views
SciPy Calibrating Heston call option
I have been attempting to calibrate my Heston model, but I am running into issues with scipy.optimize module. I have tried various scipy optimizers, but they all return the error "TypeError: can ...
2
votes
0
answers
65
views
Approximating second derivatives at boundary of finite difference scheme
The Question
I am implementing a finite difference scheme for the Heston-Hull-White PDE:
\begin{align}
\frac{\partial u}{\partial t} &= \frac{1}{2}s^2v\frac{\partial^2 u}{\partial s^2 } + \frac{1}{...
2
votes
1
answer
1k
views
QuantLib Inaccurate - American Put Option with Discrete Dividends
I'm trying to use the QuantLib library to price American options that pay discrete dividends.
The call options are priced with good accuracy (generally <0.1% error), however the same inputs for a ...
1
vote
0
answers
61
views
HNGARCHFIT in R (No standard deviations or P values printed)
When I estimate an HN-GARCH model using the hngarchfit() from the fOptions package in R, only the coefficient estimates are printed. There are no standard deviations or P-values printed. Does anyone ...
2
votes
0
answers
179
views
GARCH Option Pricing in R
I am trying to code a GARCH option pricing model in R. I am still new to R so this does seem a bit complicated.
I want to estimate an asymmetric GARCH model as well as an EGARCH model. This I have ...
2
votes
0
answers
138
views
HNGARCH Option Pricing in R (How to loop)
I am having difficulties when using the HNGOption program in R.
The program will only run for 1 specific option price, meaning that I would have to manually insert strike price etc. and this would ...
1
vote
0
answers
128
views
Valuing American Options using Tilley algorithm
Hey I want to implement Tilley's algorithm (Valuing American Options in a Path Simulation Model by JA Tilley, 1993) to price american options. Where can I find implementation of this method in any ...
2
votes
0
answers
240
views
Implementing a Variance Swap Hedging in R
I am trying to compute a hedge for a variance swap, in a simulation. Fo that I am using the following equation:\begin{align*}
E^Q\bigg(\sum_{i=1}^n \bigg(\frac{S_{t_{i}}-S_{t_{i-1}}}{S_{t_{i-1}}}\bigg)...
1
vote
1
answer
794
views
Option pricing using discrete fourier transform (python)
I am trying to implement the pricing formula for a European (call) option given in Ales Cerny's paper "Introduction to Fast Fourier Transform in
Finance" (paper can be found here), as ...
1
vote
1
answer
2k
views
How to perform Monte Carlo simulations to price a Forward contract under the Schwartz mean reverting model?
Objective: (1) Implement the Euler Explicit Method for solving the PDE for option prices under the Schwartz mean reverting model. (2) Compare with a Monte Carlo simulation.
I'm stuck with point 1 (...
2
votes
1
answer
908
views
Kou model implementation Python
Hey I try to implement Kou model in Python. This is my code:
...
-2
votes
1
answer
5k
views
How to simulate Poisson and Compound Poisson process
someone knows, maybe websites / blogs where I can find tips (preferably ready codes) to simulate the trajectory of processes? So far I only need the Poisson process and the compound Poisson process ...
0
votes
1
answer
1k
views
Why does the closed formula result for a Barrier option price deviate so strongly from the Monte Carlo approximation?
I am trying to price a down-and-out, leveraged Barrier option using the closed form formula of Hull (2015). When the price of the underlying asset falls and hits a certain barrier (H), the contract ...
4
votes
0
answers
444
views
Best practices for C++ development in quantitative finance [closed]
I'm been working as a quant for the past 10 years, but have managed to avoid any significant C++ projects until now. I typically use a combination of kdb, R, and python.
I've now been tasked with ...
0
votes
1
answer
2k
views
CDS Option pricing in quantlib python
I am newbie in Python and I am trying to price a CDS Option in quantlib Python. I have the below code:
...
2
votes
1
answer
2k
views
Is there any way to check my delta hedging is implemented correctly?
When implementing a Black-Scholes delta-neutral portfolio using Python to perform delta hedging, I am not sure whether I implemented it correctly or not.
Unlike coding binomial trees for European ...
0
votes
1
answer
671
views
Bachelier Normal Implied Vol Python Script Jaekel Not computing?
Encountering issue with Python Script for computing Nomral Implied Volatility from (Bacherlier). Using industry standard method, Jaekel-> https://jaeckel.000webhostapp.com/ImpliedNormalVolatility.pdf
...
0
votes
0
answers
169
views
Pricing options by IFT under the Heston and Nandi (2000) model: odd behavior
I am working on option pricing using GARCH models and, currently, I am coding the pricing of options under the Heston and Nandi (2000) model. This model admits a quasi analytical formula for pricing ...
2
votes
2
answers
837
views
Problem with the maximum likelihood for a GARCH-type of model
I'm currently working with the following GARCH process from Heston and Nandi (2000):
\begin{align*}
r_{t+1} - r_f &= \lambda h_{t+1} - \frac{h_{t+1}}{2} + \sqrt{h_{t+1}}z_{t+1} \\
h_{t+1} ...
2
votes
1
answer
596
views
Pricing options using the IG component GARCH model of BCHJ(2018)
Babaoglu, Christoffersen, Heston and Jacobs (2018) introduced a component GARCH model with inverse Gaussian innovations and an exponentially quadratic pricing kernel back in 2018. The article shouldn'...
1
vote
1
answer
181
views
Simulation Heston Model, markovianity
I am trying to simulate the instanteneous volatility of a Heston process.
My equations are the following :
wealth process:
$$dX_t = r_t X_t + \theta \sqrt {V_t} u_t dt + u_t dW_{1t}$$
Volatility:
$$...
4
votes
1
answer
2k
views
QuantLib Python: caplet/swaption pricing under dual curve
Is there a way to price caplets/swaptions in QuantLib python (v 1.6.2) under dual curve i.e. pass projection curve for forwards and discounting curve for discounting the cash flows?
Goutham has an ...
1
vote
1
answer
722
views
Duan (1995) GARCH Option Pricing Model with MATLAB
This is the MATLAB code that replicates the option pricing model proposed by Duan in his paper "The GARCH Option Pricing Model". However, the parameters estimated in the file do not match with the ...
7
votes
2
answers
6k
views
What are some beginner quantitative option trading strategies?
I'm new to quantitative trading, with good knowledge in finance and coding (mainly Python, Java, R, etc).
I would like to know if there are any basic quantitative option trading strategies that can ...
6
votes
2
answers
6k
views
Numerical simulation of Heston model
I am trying to simulate on Python random paths for a general asset price as described by the Heston model:
\begin{equation}
\begin{aligned}
dS_t &= \mu S_t dt + \sqrt{\nu_t} S_t dW^S_t \\
d\nu_t &...
1
vote
1
answer
339
views
Need explanation on weird Gamma Behaviour Black Formula
I am using the RQuantlib package to price options on futures. With a slight modification one can go from the Black Model (76) to The BS Model.
It can easily be shown that if we write S0 = (e-rt) * F0 ...
3
votes
3
answers
979
views
Are there recommended books/readings for advanced option pricing
I am learning option pricing and derivative markets this year in class. I have had some background on stochastic calculus so it was relatively manageable for me to write vanilla and American option ...
3
votes
1
answer
304
views
RQuantLib: BermudanSwaption(): effective date later than or equal to termination date
When running the command in the RQuantLib library:
...
3
votes
0
answers
659
views
Is there a more efficient data structure to implement binomial trees than 2d array?
I'm just curious what is the "industry standard" for implementing a binomial tree (if "standards" exist in this case). For simplicity, let's just talk about the simplest trees with recombining nodes.
...
2
votes
1
answer
453
views
Merton's Jump diffusion model: Specify poisson rate
Currently applying the Merton's jump diffusion to test how Option price change as parameters change. However, I am struggling to specify the poisson rate $\lambda$. We know that:
$P(\text{There is a ...
1
vote
1
answer
5k
views
Python package for option pricing models?
Is there a good python package for various option pricing models, e.g., Heston, SABR, etc? I found that it's even hard to find a good python implementation of Black-Scholes model (i.e., price + IV + ...