Questions tagged [programming]

For questions about programming languages, implementation, and packages in quantitative finance. Note: question must be specific to quantitative finance and must necessitate knowledge of quantitative finance in order to be on topic.

Filter by
Sorted by
Tagged with
0 votes
0 answers
2 views

Getting standardized residuals from MSGARCH in R

After estimation by the MSGARCH package in R, I couldn't find a way to extract residuals from the estimation results. Anyone know how to extract the residuals from MSGARCH package in R? Thanks!
Frank Cheng's user avatar
0 votes
0 answers
22 views

Is there any way to view historical data on market capitalization?

Is there any way to view historical data on market capitalization? I would like to calculate a market capitalization weighted index with only the top 10 nasdaq stocks (like nasdaq 10). I have tried ...
nokemono's user avatar
-4 votes
0 answers
51 views

Hull-White Matlab code

Can someone help me with a code of Hull-White model to price derivatives, in which we use A(t,T), B(t,T) and P(t,T)-the discount factor? Thank you. I already have this code, that doesn´t work. ...
Carla Luisa's user avatar
1 vote
1 answer
136 views

GBP OIS Curve - Zero Rate Curve Calculation in Quantlib

I am new to Quantlib and I am looking to create a Zero Rate Curve from GBP OIS to then use to calculate the present value of fixed rate bonds. I have Looked at the documentation: https://quantlib-...
TheGr8Destructo's user avatar
0 votes
0 answers
19 views

Got different results using SEC EDGAR API and Seeking Alpha

I am trying to get the same Depreciation and Amortization (Total) we can get for AAPL on Seeking Alpha and QuickFS for instance. Here is what is their values: However, what I am getting using the SEC ...
J.Doe's user avatar
  • 73
0 votes
0 answers
39 views

Barrier option Greeks using AD

I am trying to price a Down-and-Out Barrier option using Monte Carlo and get the Greeks using autodiff as provided by PyTorch. However, comparing the output to bumping, I get vastly different values ...
nducl's user avatar
  • 1
1 vote
2 answers
163 views

fast backtesting library in R

I’m looking for a fast library for backtest in R that supports limit orders, stop-losses, and take-profits. The library should be optimized for repeated historical testing and ideally ported from fast ...
mr.T's user avatar
  • 155
0 votes
1 answer
29 views

Is End of Month (Eom) Rule overrides Unadjusted convention rule in Quantlib?

Concerning the post Is End of Month (Eom) Rule overrides convention rule in Quantlib Schedule? I noticed that with Unadjusted convention has the same behavior. Is this wanted? For example, with Target ...
Alessandro Ruo Bernucchio's user avatar
1 vote
0 answers
55 views

Python Quantlib Loop to calculate cap prices: Setting of evaluationDate

I am trying to calculate cap prices for different points in time (valuation dates) with Quantlib. I have built three loops for this. The first one creates the quantlib yield curve object ts_handle ...
Marc157's user avatar
  • 55
4 votes
1 answer
198 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 ...
Starlord22's user avatar
0 votes
1 answer
132 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 ...
v.y.'s user avatar
  • 31
0 votes
0 answers
61 views

How to simulate a conditional expectation given a filtration

I had a question regarding how to simulate a certain conditional expectation. I am given two processes $X_1(t), X_2(t)$ which both follow their own SDE, but both are of the form \begin{equation*} dX_i(...
Tipeg's user avatar
  • 1
1 vote
0 answers
130 views

Validator for Risk-Neutral Distributions Derived from Option Prices

I've developed a validator for risk-neutral distributions. I did this for the purpose of testing the risk-neutral distributions generated by a Spectral Analysis risk-neutral density recovery method, ...
v.y.'s user avatar
  • 31
0 votes
0 answers
19 views

How to analyse success of trades by time of day, day of week, duration from the output of an MT5 Expert Advisor

I have the output of an MT5 EA in csv format. I want to analyse the output to identify best time of day, day of week, duration, buy or sell, consecutive wins and losses. Ideally I would like to use a ...
Eric's user avatar
  • 1
3 votes
2 answers
211 views

QuantLib calculations for a Canadian corporate fixed rate bond differ from BBG YAS

I am pricing a non-callable, fixed-rate, Canadian corporate bond with the following parameters: Name Value CUSIP 12657ZAT0 Evaluation Date 2/14/2024 Settlement Date 2/16/2024 Bond Issue Date 3/6/...
Juice's user avatar
  • 31
0 votes
0 answers
104 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 ...
Noomkwah's user avatar
  • 101
0 votes
1 answer
68 views

How does the isInArrears affect the quantlib IborLeg? [closed]

Deal details ...
Roshan Yadav's user avatar
0 votes
2 answers
126 views

how to make this time series reguarly spaced

in the picture below we have in the first coloumn the day of the month, in the second coloumn the time in millisecond in epoch time(elapsed from 1 january 1970), third coloumn the stock price and in ...
XY0's user avatar
  • 93
1 vote
0 answers
204 views

IDE to use for Python for Quant Trading [closed]

Dear Quantitative Finance Stack Community, Since many Quantitative propietary trading firms seem to be using Python over alternatives such as STATA. I have now decided to get myself familiar with ...
Julien Maas's user avatar
0 votes
2 answers
164 views

My Montecarlo Simulation is not working?

My aim is to predict 1 year ahead and daily, the price of a stock under certain scenario. These scenarios are the ones that this year the stock will have a similar year, in terms of standard deviation ...
Ricter's user avatar
  • 101
0 votes
1 answer
122 views

Python Quantlib G2 calibration with negative interest

I am currently calibrating the G2++ in Python with Quantlib in negative interest rate environments with cap volatilities. Unfortunately, this does not work as intended and I get error messages:...
Marc157's user avatar
  • 55
0 votes
1 answer
198 views

How to bootstrap the zero coupon curve for US treasuries

Here is my understanding of the process: Capture price of most recently sold gov security at each tenor of the curve (reference treasuryDirect) For coupon paying securities, (i.e. tenor>2yr) you ...
dbojanin's user avatar
0 votes
1 answer
66 views

ISIN symbol pairs for DAX, MDAX, SDAX, TecDAX and Nasdaq-100

I am looking for a simple source for ISIN-symbol pairs for DAX, MDAX, SDAX, TecDAX and Nasdaq-100? I can't find anything on Yahoo and possible sources only offer searches for individual stocks, but I ...
M14's user avatar
  • 101
1 vote
0 answers
72 views

Reserves using Thiele differential equation

I am trying to solve the Thiele differential equations $$ \frac{d}{dt}V^1(t)=r(t)V^1(t)-b^1(t)-\mu_{12}(t)(V^2(t)-V^1(t))-\mu_{10}(t)(V^1(t)) \\ \frac{d}{dt}V^2(t)=r(t)V^2(t)-\mu_{21}(t)(V^1(t)-V^2(t))...
idlatva's user avatar
  • 11
0 votes
0 answers
100 views

Quantlib Python bootstrapping with ArithmeticOISRateHelper: cannot find a soluton for forward rate

I am trying to construct a curve based on OIS quotes. Fixed rates in those OIS are quoted againgst the arithmetic average of the floating rate. Consequently, I am using the correspoding helper class - ...
feeshee 's user avatar
0 votes
1 answer
101 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....
khubquant's user avatar
0 votes
1 answer
92 views

QuantLib: How to compute the forward rate using historical fixing rate and discount factor data

Let's say the valuation date is 08/24/2023. The effective date and maturity date of the swap are 03/12/2022 and 01/10/2024. I want to apply the given historical fixing rates till the valuation date ...
John83's user avatar
  • 37
0 votes
1 answer
91 views

Creating Implied Volatility surface using log moneyness [closed]

When creating the implied volatility surface using $\left(T,log\left(\frac{K}{S_0}\right)\right)$ as $(x,y)$ axis, do the inputs for the implied vol calculation need to be logged too? In other words, ...
ayamathss1's user avatar
6 votes
0 answers
266 views

Creating the local volatility surface from the IV surface

I have been using the dupire equation: $$ \sigma_{LV} (K,T) = \frac{\sigma_{i m p}^2+2 \sigma_{i m p} T\left(\frac{\partial \sigma_{i m p}}{\partial T}+(r-q) K \frac{\partial \sigma_{i m p}}{\partial ...
Xerium's user avatar
  • 45
0 votes
1 answer
205 views

Approximation of an Itô integral with python

Exercise 3.11 (Approximation of an Itô Integral). In this example, the stochastic integral $\int^t_0tW(t)dW(t)$ is considered. The expected value of the integral and the expected value of the square ...
Jessie's user avatar
  • 103
0 votes
0 answers
74 views

Interpreting parameters on Matlab from Patons code on time varying copulas

I ran Andrew pattons code(2006) for Markov switching time varying copulas with an example code given in the Matlab tool box. This is the equation for Markov switching time varying normal copulas I ...
nadeem's user avatar
  • 3
0 votes
1 answer
85 views

QuantLib FittedBondDiscountCurve does not produce expected rates

I am using the QuantLib library to fit yield curves. For a $\\\$100$ face bond, with price equal to $\\\$100$, and coupon equal to $\\\$0$, I would expect it to provide a zeroRate of $0.0\%$. However, ...
Trevor J Richards's user avatar
2 votes
0 answers
57 views

Finite difference method for the Heston model using the ADI scheme

I am trying to implement the ADI FDM scheme for the heston and I am following The Heston Model and Its Extensions in Matlab and C#. They have the scheme: $$U'(t) = \textbf{L}U(t),$$ $$\textbf{L} = A_0 ...
Xerium's user avatar
  • 45
0 votes
1 answer
134 views

Getting ETF components (underlying stocks)

Using EDGAR's API interface, what is the best way to get the list of an ETFs underlying stock positions (in this case, just the CIKs)? I can pull all of the CIKs from EDGAR with no issue. Given that ...
Matt's user avatar
  • 1
2 votes
2 answers
194 views

QuantLib Python - Discount Factor Interpolation within curve nodes

Generated a discount curve, dCurve.PiecewiseLogLinearDiscount() using input par rate for terms (.5Y, 1Y, 2Y, 3Y, 5Y, 7Y, 10Y, 15Y, 20Y, 30Y) and output discount curve matching the input term structure....
Mike's user avatar
  • 21
1 vote
1 answer
146 views

QuantLib: Latin American FixedFloat Swap pricing with multiple payment frequency specification

With reference to the post of latin american swap, I am valuing the FixedFloat CLP swap.The specifications of this swaps has payment frequency upto 18 months as Zero coupon(1T) and after that ...
John83's user avatar
  • 37
0 votes
1 answer
156 views

Why do the Greeks not converge to the strike as the volatility tends to zero? [closed]

So, I was playing around with the Greeks in Python with some made up data for a European call option assuming the Black-Scholes model. I plotted the graphs to see what happens to the Greeks when ...
Mr. Ivan's user avatar
2 votes
1 answer
116 views

QuantLib: Pricing BRL zero coupon swap using relevant attributes in Quantlib

I am trying to price the BRL zero coupon swap. As we know that ZC swaps fixed payer pays a single payment at maturity and the float payer pays the interim payments till maturity. So in this case, ...
John83's user avatar
  • 37
0 votes
0 answers
29 views

Searching for minute binned OHLCV Cryptocurrency data from 5 January 2018 to 7 September 2018

As the title states, searching for OHLCV data (USD) from the dates listed for these coins: [ADA, BCH, CVC, DASH, EOS, ETC, ETH, LTC, MANA, OMG, BCN, BTC, CND, DATA, ETP, GNT, NEO, NXT, QASH] I'm a ...
Jackson Thorn's user avatar
0 votes
1 answer
206 views

QuantLib: How to price or construct a zero coupon swap using Quantlib

I am trying to construct and price the zero coupon swap. However its giving me the AttributeError: module 'Quantlib' has no attribute 'ZeroCouponSwap'. Please let me know how to price the zero coupon ...
John83's user avatar
  • 37
1 vote
1 answer
187 views

Find the right module for CDI DI BRL swaps valuation Quantlib

I'm trying to find a way to price BRL CDI Swaps with Quantlib but I can't find any solutions so far - so I was wondering if anyone encountered this issue: I don't see any solution on Quantlib. I ...
Gloomy's user avatar
  • 21
1 vote
0 answers
91 views

Efficient Method of Moments(EMM) for Stochastic volatility model

We are attempting to calibrate the parameters of the Heston model via EMM on historical stock price returns. However, we are first trying a simple stochastic volatility model using EMM. We have come ...
AJ van Niekerk's user avatar
0 votes
0 answers
44 views

Lognormal-mixture dynamics and calibration to market volatility smiles

Can someone assist me in replicating the code and results from page 11, Figure 3 of the paper 'Lognormal-mixture dynamics and calibration to market volatility smiles' by Damiano Brigo, Fabio Mercurio, ...
BloomShell's user avatar
0 votes
0 answers
38 views

Implementations of stochastic collocation for Arbitrage Free SABR

I am currently reading this paper (link) on fitting arbitrage free parameters for SABR using stochastic collocation. Are there any publicly available github repos that implement solutions that are ...
user85127's user avatar
0 votes
0 answers
442 views

Simulating Hull-White Model in Python

I first simulated the short rate in the Vasicek model using the following code, which is equivalent to simulating the following normal distribution $r_{t} \sim N\left(r_{0}e^{-at} + b\left(1-e^{-at}\...
Guyon Van Rooij's user avatar
2 votes
1 answer
150 views

Uncertainty on volatility prediction using GARCH(1,1)

I have daily returns data and I predict the variance for the next day using GARCH(1,1) as follows ...
PhDStudent's user avatar
0 votes
1 answer
76 views

Reliability of R Package on Covariance Matrix Shrinkage

I recently used a R package CovTools in R with the command CovEst.2003LW(X), where X is your sample covariance matrix as an input, to compute the shrunk covariance matrix (an estimate that is closest ...
KaiSqDist's user avatar
  • 1,032
2 votes
2 answers
231 views

Extending/Subclassing QuantLib Classes in Python?

I'm using quantlib via the quantlib-python or open-source-risk-engine both on pypi. The question relates whether it's possible to extend QuantLib term structure base classes in python rather than C++....
Phil's user avatar
  • 123
1 vote
0 answers
33 views

Seeking a Model to Extrapolate Locate Fees for Short Selling in Absence of Historical Data

I'm in the process of developing an automated stock trading algorithm, with short selling being a significant part of the strategy. A key factor in deciding whether to short a stock is the associated &...
David's user avatar
  • 33
1 vote
1 answer
406 views

Python - yahoo finance options data - volatility smile plot

I have plotted the IV of TSLA options using yahoo options data, but the scatter plot doesn't look right, can anyone advise why the plot looks like this? I would expect to see a vol smile plotted. EDIT ...
Skittles's user avatar
  • 135

1
2 3 4 5
24