Skip to main content

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
39 views

Conducting PCA on features of dataset

To preface, I am very new to quantitative finance and nowhere near the point of actually trading so forgive me if this question is trivial to most of you. I am making a basic k-means clustering ...
Dylan McClish's user avatar
0 votes
0 answers
18 views

How can you progress a dual auction emulator project in Python [closed]

I am new to this forum. I am looking to start a Dual Auction Emulator project, can you advise on areas to consider/incorporate.
Jack Shephard-Thorn's user avatar
0 votes
0 answers
31 views

Trying to create a donchian breakout system (55day lookback)

...
ismet's user avatar
  • 1
1 vote
0 answers
60 views

Is my spread calculation correct?

I have automated Pair trading strategies running on both CME Futures and cryptocurrency perpetual pairs. I can chose between different spread calculation type and I noticed that the one I thought was ...
Sixk's user avatar
  • 11
0 votes
0 answers
13 views

How To Get Morningstar Unique Stock IDs

I have been trying to extract every piece of information I can from Morningstar's Investor platform and save it offline for free to integrate for a different use case; I have figured out how to ...
Rudy's user avatar
  • 1
-1 votes
1 answer
48 views

How to compute moving average convergence divergence without using pandas ewm function?

I'm trying to compute the moving average divergence convergence (MACD) which is a technical indicator in trading. To compute MACD we have to find out exponential moving average over a certain period ...
dev0419's user avatar
3 votes
0 answers
89 views

Rateslib - Pricing 1y EUR vs 6M (EUSA01)

I am using the rateslib python library to try to price some European swaps. It seems to be working for most tenors aside from the 1y for some reason. The code I am using is below: ...
barnslinger's user avatar
1 vote
2 answers
73 views

Reverse Optimization: finding the returns that satisfy specific weights given one known return

Here is the premise: I have a three asset portfolio, I know the assets covariance, the client's risk aversion and the expected return of one of the assets. I also have a desired set of weights. So, 1) ...
Farrep7's user avatar
  • 21
0 votes
0 answers
30 views

How to Bootstrap a daily compounding future in QuantLib

Hi I am currently tying to bootstrap the F-TIIE curve for mexican swaps In the short term it uses the F-TIIE Futures. These F-TIIE futures are 1 month futures that start on the first day of the month ...
Fiesteban's user avatar
0 votes
0 answers
53 views

ql.OvernightIndexFutureRateHelper asking for a fixing, but not able to add it

I´m trying to make a Overnight Index FutureRateHelper but when bootstrapping, the following Error arises: RuntimeError: 1st iteration: failed at 1st alive instrument, pillar May 31st, 2024, maturity ...
Fiesteban's user avatar
0 votes
0 answers
70 views

Volatility Surface Modelling in Python

For my master thesis, I try to create a Volatility Surface for S&P500 Index options. Every time I run my code, the surface I get is full of spikes. I'm just not sure if these are outliers which ...
Aaron 's user avatar
0 votes
0 answers
16 views

Is there any way to implement GARCH-MIDAS model in R for multivariate estimation?

I'm writing a research paper in economics, and would like to research the impact of both financial and macroeconomic variables on the NIFTY50 index. My plan was to use a GARCH model. I've stumbled ...
Zeeshan Mohammad's user avatar
-2 votes
0 answers
30 views

Exporting IV Curve calibrated in Cpp to python for analysis

This is more of a dev question than a quant question but I think a lot of people here would have faced this issue and might know. I am calibrating a IV Curve inside cpp, now how do I export the curve ...
user50123's user avatar
-1 votes
2 answers
93 views

Get bonds data in python [duplicate]

Anyone knows a way of getting trustworthy bonds data in python? I know that for stock there is yfinance package but it doesnt include bonds. Thx
Lucca F's user avatar
5 votes
1 answer
224 views

Recommended Setup for QuantLib-Python AmortizingFloatingRateBond

I am trying to model a term loan in QuantLib-Python that makes quarterly interest payments at CME Term SOFR 3M + 10bps + 525bps paid in arrears with a 2 business ...
cpage's user avatar
  • 64
0 votes
0 answers
21 views

eGARCH(1,1) model evaluation (R). How to assess model integrity?

I am using GARCH modelling for my bachelor thesis in Economics. I am entirely new to the concept, and have only been looking into these kind of models for about a week now. I am trying to do a ...
Sam's user avatar
  • 1
-2 votes
1 answer
71 views

Get upfront bps from a CDS with QuantLib

I have an example the pricing of a CDS in Excel and I am trying to match it with QuantLib, in order to get the upfront bps. Below there is a print of the excel screen where I know all the values are ...
Gustavo Amarante's user avatar
2 votes
0 answers
91 views

Brent algorithm supporting automatic differentiation

I painfully implemented automatic differentiation (AD) and a Gauss-Kronrod numerical integration routine working with it with AD. (Fully tested etc, perfectly working.) Needing a root finding ...
11house's user avatar
  • 113
0 votes
1 answer
60 views

Maximze Sharpe ratio from matlab to python [closed]

I know there matlab library funtion for Optimzing Sharpe ratio estimateMaxSharpeRatio, it mentioned it use direct method How can i do the same thing in python Is there any python libraries Or need ...
andy's user avatar
  • 1
0 votes
0 answers
57 views

Visualizing Drawdown

I want to replicate the image below: Does anyone have an idea how to do this in Python. To be specific; I am only having problems plotting the blue shade and the blue lines.
Lyft's user avatar
  • 1
0 votes
0 answers
20 views

How to get a complete and up-to-date list of ticker symbols for any Yahoo Finance index? [duplicate]

Good afternoon everyone, I am currently in a dilemma to which I have tried to find a solution for a whole week but unfortunately I have come to nothing. I have tried to locate a library or create a ...
Luis David's user avatar
1 vote
1 answer
160 views

Reverse optimization: How to generate the expected portfolio returns given the weights and a series of constraints on those weights?

I have the below function in Python. My objective is to back out the expected returns associated with certain portfolio weights given a series of assumptions. From this I want to generate the expected ...
Farrep7's user avatar
  • 21
1 vote
0 answers
72 views

Setting up QuantLib to get correct yield for bond with long first payment period

I am dealing with fixed rate bonds. There is one particular bond, 34659UAC0, that caught my eye. This bond has a first coupon period of a whopping 5 years, followed by regular periods of 6 months. My ...
Jerry's user avatar
  • 11
0 votes
2 answers
132 views

QuantLib Python: Calculate ZSpread

I am trying to use quantlib-python to calculate the z-spread of a fixed rate US corporate bond using a zero curve from swap rates provided. Here is the provided ...
cpage's user avatar
  • 64
0 votes
0 answers
34 views

YUIMA: Drift and diffusion parameters must be different?

I am currently working with the Yuima package and trying the estimate the parameters of a CARMA(p,q) model to real data. Using the eacf function of the TSA package a ARMA (2,1) process is recommended ...
Valentin's user avatar
  • 135
0 votes
1 answer
134 views

Portfolio optimization with Scipy in Python

I performed Scipy portfolio optimization in two scenarios: 1) when I cannot lend or borrow at the risk-free rate; 2) when I can lend and borrow at rf=1.5%. Now, optimal risky portfolio weights anyway ...
Maurizio Marinaro's user avatar
0 votes
0 answers
29 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
43 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
1 vote
1 answer
216 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
25 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
44 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
185 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
  • 125
0 votes
1 answer
34 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
71 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
213 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
142 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
63 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
131 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
20 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
244 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
182 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
  • 111
0 votes
1 answer
70 views

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

Deal details ...
Roshan Yadav's user avatar
0 votes
2 answers
131 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
  • 127
2 votes
0 answers
274 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
172 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
147 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
237 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
71 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
77 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
117 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

1
2 3 4 5
24