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.

433 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2 votes
0 answers
331 views

Problems in computing VaR with GARCH-GPD-copula approach

I use a time-varying Gaussian copula (with GARCH-filtered standardized residuals modeled semiparametrically with Gaussian kernel interior and GPD tails, i.e. generalized pareto distributed) to ...
Kondo's user avatar
  • 449
2 votes
0 answers
70 views

False warning messages in R, is it possible?

I'm modeling GARCH-filtered standardized residuals via semiparametric distribution with Gaussian kernel and GPD (generalized pareto distribution) tails with thresholds at 5% and 95%. For some series I'...
Kondo's user avatar
  • 449
2 votes
0 answers
171 views

Monte Carlo approach to RAN bonds in Quantlib or suggestions

This is a problem from Schlogl's book in the chapter on the HJM model: Price option of the RAN instrument with 3 month coupons and maturity 3 years using Monte Carlo(Exercise 4 Range Accrual Note). ...
user133100's user avatar
2 votes
0 answers
734 views

Backtesting Long/Short Market Neutral Z-Score Strategy with Custom Factors and Custom Stock Universe

So I've managed to backtest simple strategies, like MA, RSI and some fundamental ones (P/E ratios etc) but Im stuck at my last strategy. Here is some information: Tools: Excel and Python (also a ...
mortenhaga's user avatar
2 votes
0 answers
170 views

Using Market Prices of Bonds to Model the Discount Curve with a Polynomial (Math + R)

I have a small program I'm building to interpolate the discount curve from a portfolio of benchmark bonds. If anyone has any guesses as to whether it's my process, or my code that's messed up I would ...
user3338639's user avatar
2 votes
0 answers
886 views

Johansen cointegration test interpretation in R

I want to test my time series for cointegration using the Johansen test in R. I got the following result and so I know now that at least 5 out of 9 of my time series are cointegrated. My question is, ...
Anna's user avatar
  • 21
2 votes
0 answers
157 views

Interpreting different factor models w.r.t. correlation matrix and min variance portfolio weights

Background In Eric Zivot's analysis of factor models he uses three models The sample (.sample) Single index model (.si) Barra factor industry model (.ind) PCA model (.pca) You can download his ...
jacob's user avatar
  • 233
2 votes
0 answers
734 views

backtest asset allocation strategies

I've searched the site but haven't found an easy way to backtest my personal portfolio allocations. Suppose I want to know the total return for the following portfolio from Jan 1, 2009 to Dec 31, 2014:...
Stephen Grimes's user avatar
2 votes
0 answers
2k views

How to fit a VAR + GARCH in R

I should create a VAR model with Garch error in R but i don't know how to do it and which package to use. The Vector Autoregressive model (or VECM) should also have covariates in it. Then I should ...
Enrico's user avatar
  • 21
2 votes
0 answers
299 views

What is the best open source automated trading platform or options?

I would like a custom C++ Automated Trading Platform for Futures like Multicharts, or similar automated trading platform that I can put on my servers so its secure and fast. I have found this so far, ...
Alex's user avatar
  • 21
2 votes
0 answers
437 views

Downloading IB futures data and then making a datapump to another program

I never have programmed before in my life but I wouldn't mind learning if I knew what i needed to do in order to solve my problem. I use neuroshell for day trading and use it extensively for trading ...
user19145's user avatar
2 votes
0 answers
230 views

Liquidity Adjusted Asset Pricing Model

I have a data set with 4000 companies and I have calculated a liquidity measure of each of the company in the dataset as Where, Turnover is the monthly average ratio of daily volume to shares ...
Aquarius's user avatar
2 votes
0 answers
288 views

Behaviour of out of sample efficient frontier

I am comparing the efficient frontier of a set of portfolios that are in and out of sample. The first period is from 1991-01-03 until 1992-10-03 and the second one from 1992-10-03 until 1994-03-03. I ...
Jonkie's user avatar
  • 189
2 votes
0 answers
664 views

Gaussian Time-varing copula in R

I want to estimate the parameters of time-varing Normal Copula using R. A bivariate Normal copula is defined as following: The dynamic equation of dependance parameter ρ is : So I need the identify ...
Nourhaine's user avatar
2 votes
0 answers
867 views

More cache friendly linked list or alternative with optimal append, delete, and ordered traversal for limit order book?

I am trying to implement a stock matching engine/order book in C++, and am searching for a more cache friendly architecture. Currently, my data structures are as follows: An intrusive rb-tree for the ...
Ronny Rildil's user avatar
2 votes
0 answers
233 views

Issues with +100 symbols in Quantstrat, Erratic Trades

I've tested my code against individual symbols and very small groups of symbols. I'm finding the more symbols I add the fewer trades I get. For instance, if I just include the first five symbols, all ...
timtrice's user avatar
  • 121
2 votes
0 answers
1k views

Forecast of ARMA-GARCH model in R

I managed to forecast a GARCH model yesterday and run a Monte Carlo simulation on R. Nevertheless, I can't do the same with an ARMA-GARCH. I tested 4 different method but without achieving an ARMA-...
Tom's user avatar
  • 21
2 votes
0 answers
2k views

Simulation of Heston process

I am currently working on implementing Heston model in matlab for option pricing (in this case I am trying to price a European call) and I wanted to compare the results I obtain from using the exact ...
Matt59's user avatar
  • 71
2 votes
0 answers
126 views

Problem with Naive Bootstrapping (US Government Bonds)

I am using the formula here to determine the discount factor function and eventually the zero-coupon yields. I get the data for Coupons, Face Values and Closing Prices from Thomson Reuters, which I ...
Jojo's user avatar
  • 895
2 votes
0 answers
531 views

Can you tell me what this RBloomberg formula means?

I've been asked to re-create a spreadsheet that used RBloomberg using a different data source. But I'm having trouble figuring out exactly what one of the spreadsheet's formulas does. Can anyone tell ...
ransomedbyfire's user avatar
2 votes
0 answers
539 views

Initial values for Heston Model calibration

I'm doing a Heston model in Matlab using simple Monte Carlo simulations (5.000 paths and 2 steps per day, simulating 360 days). When I try to calibrate the Heston parameters using fminsearch it takes ...
Oliver Mohr Bonometti's user avatar
2 votes
0 answers
137 views

How to estimate constrained a constrained VAR(1) with MATLAB?

Suppose I want to estimate the following VAR(1) model: $$ Y_t = \mu + \Phi Y_{t-1} + \varepsilon_t $$ where $Y_t=(y_{1t}, y_{2t},…,y_{kt})'$, $\mu=(\mu_1,…,\mu_{k})’$ and $\Phi$ a matrix of ...
fni's user avatar
  • 1,886
2 votes
0 answers
262 views

Ibrokers: reqMktData extremely slow when adding tickers

I am trying to snap prices in R for the latest price for a list of stocks (around 150). When I snap them for 2 stocks, it's almost instantaneous: ...
Trexion Kameha's user avatar
2 votes
0 answers
522 views

Stationarity tests in the frequency domain for regression

Strict stationarity is the strongest form of stationarity. It means that the joint statistical distribution of any collection of the time series variates never depends on time. So, the mean, variance ...
Barnaby's user avatar
  • 436
2 votes
0 answers
298 views

trading strategy outperforms passive strategy in absolute terms, but in returns vice versa. how could this be?

Background: I want to compare two trading strategies in term of profitability. The red one is an active trading strategy, which involves many entry and exit to a specific market. The blue one is a ...
Daniel Ryback's user avatar
2 votes
0 answers
1k views

fetch from yahoo! finance database - varying number of ticks

To test a model with real-life data, I used the fetch-function in matlab to connect to the database of yahoo! finance. My code to try and get 7 different assets' returns is the following: ...
Marie. P.'s user avatar
  • 519
2 votes
0 answers
151 views

How to simulate a Geometric Binomial Process with state/tie dependent increments?

I want to simulate a geometric binomial process with state/time dependent increments. So the model is given by \begin{align}R_t=\frac{X_t}{X_{t-1}}\end{align} \begin{align}P(R_t=u)=p(X_{t-1},t) \...
Stat Tistician's user avatar
2 votes
0 answers
1k views

Interpolate option volatility in delta space in R

I have a bunch of deltas and option implied vols at those deltas. I would like to interpolate them in R. Interpolating them in delta space seems difficult, since normally you would like the ATM calls ...
Alex's user avatar
  • 153
2 votes
0 answers
729 views

portfolio optimization with a loop

I am attempting to minimize the variance of a 3 stock portfolio using optimization within a loop. What I have done is calculated the stock returns and cov matrix from dates 1980-01-01 to 1989-12-31 ...
user2214069's user avatar
2 votes
0 answers
230 views

Looking for FpML best practices

We want start using FpML within our organisation; where message will be sent using FpML. What are best practices to do this ? If anyone who have used Tools as well as; i want to use FpML for ...
Ocean's user avatar
  • 141
2 votes
1 answer
881 views

How to extract sentiment from Yahoo finance message board?

Does anyone know if it is possible to write a software to pull Yahoo message board sentiment for a specific stock? Any API from Yahoo or anyone has done it before?
electro's user avatar
  • 153
1 vote
0 answers
67 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
1 vote
1 answer
105 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
80 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
1 vote
0 answers
30 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
198 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
1 vote
1 answer
54 views

replicating momentum strategy - Formation Periods

I am trying to replicate the momentum strategy of the study by Jegadesh and Titman (1993) onyl using data from the past 10 years.I am trying right now to calculate the formation period returns. But I ...
Vici's user avatar
  • 11
1 vote
1 answer
63 views

Garch Model with Vix as external regressor un dummy rugarch r studio

I would like to try to replicate this variance dummied model in r studio, to try to compare garch vs i.v in forecasting vol: Data : S&P 500 log-return from 03.01.2020 to 31.12.2022 Ext regressor : ...
fabdellar's user avatar
1 vote
0 answers
75 views

Resource recommendations: Levy process estimation using programming languages

Perhaps this type of question is not very suitable for this forum, but I'll try to make my question a little useful. I'm studying stochastic processes, more precisely, Levy processes. A Levy process $...
André Goulart's user avatar
1 vote
1 answer
38 views

Can the coef be negative in cointegrated stocks?

I'm searching for cointegrated stocks using the Python CointAnalysis library. While computing stock prices on a 5 mins time frame, I found that the stocks MNST (Monster Beverage Corp.) and KDP (Keurig ...
Begoodpy's user avatar
  • 111
1 vote
0 answers
53 views
+50

R resources for GMM estimation and testing of multifactor asset pricing models

Has anyone seen R script for GMM estimation and testing of asset pricing models such as Fama-French 3-factor or similar? Ideally, I would like to have R scripts corresponding to Cochrane "Asset ...
Richard Hardy's user avatar
1 vote
1 answer
175 views

Market impact power law fitting confusion

In many market impact papers such as "Anomalous price impact and the critical nature of liquidity in financial markets" by Tóth et al (2018), there is a standard power-law relation in the ...
des224's user avatar
  • 93
1 vote
0 answers
151 views

Minimum transaction size for portfolio optimization with CVXPY

Long time reader, first time asker! I am working on a portfolio optimizer where I have a universe which is much larger than potential portfolio and where I want to exclude small transaction, i.e. a ...
herminat0r's user avatar
1 vote
0 answers
51 views

Johansen Cointegration Test returns non-stationary error even though trace statistics suggest their existence

I'm working with Python and use the statsmodels.tsa.vector_ar.vecm.coint_johansen function to analyze if several stocks have a stationary error term with respect to ...
Marx's user avatar
  • 11
1 vote
0 answers
151 views

Adjoint Automatic Differentiation

I'm currently benchmarking several Monte Carlo computing methods for sensitivities computation purposes. I've already done some implementation in Python using Numpy and MyGrad libraries and it's ...
Hilbert's user avatar
  • 43
1 vote
0 answers
75 views

Measuring latency with tcpdump and storing output

I am writing a code in python that streams real-time data from the Coinbase Exchange. ...
apt45's user avatar
  • 213
1 vote
0 answers
225 views

CEV model effective simulation

I want to simulate the following CEV process : $$ dM_t = \sigma_t M_t^{\eta} dW_t $$ Using Euler discretization to $M_t$, if at a given time $t$, $M_t$ takes a negative value then $M_{t+1} = M_t + \...
H K Y's user avatar
  • 11
1 vote
0 answers
43 views

Fitting model between security price and intraday volatility

I'm trying to construct a model which shows how much the closing price of a security ($P_t$) differs from the VWAP of that security on that day ($VWAP_t$). I'm calling this measure the "VWAP ...
Ringleader's user avatar

1 2
3
4 5
9