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
63
votes
8answers
25k views

Is R being replaced by Python at quant desks?

I know the title sounds a little extreme but I wonder whether R is phased out by a lot of quant desks at sell side banks as well as hedge funds in favor of Python. I get the impression that with ...
3
votes
2answers
481 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 ...
4
votes
1answer
915 views

How to backtest strategy in portfolio of stocks using SIT R?

I am creating and testing strategies in R code and using systemic investor toolbox(SIT) package as the backtesting tool. I copied a SIT backtesting code from a website and made small changes to make ...
3
votes
0answers
52 views

Identifying the same company behind stocks traded in different exchanges (e.g. CUSIP and WKN in 1990ies)

I would like to merge two data sources with companies headquartered in Germany between 1980-2000, but listed in Germany and the US. One source identifies "German companies" by their CUSIP, the other ...
2
votes
1answer
28 views

Does Adjusted Closing Price take account the Expense Ratio?

first time posting at Quantitative Finance. I am trying to use the yfinance python library to load various ETF's data and compared the return. I understand the adjusted closing price handles the ...
1
vote
1answer
55 views

SARIMA+GARCH model

The model ARIMA+GARCH writing as this form with the rugarch package in R: ...
1
vote
0answers
89 views

To calculate the Hedge Efficiency and Optimal Hedge Ratio with BEKK in R

I estimated an MGARCH-BEKK model (using the R package BEKK, i.e. Baba, Engle, Kraft and Kroner; see Engle and Kroner (1995)) on time series of spot and futures ...
2
votes
1answer
383 views

API for fundamentals for NSE and BSE

I want APIs for accessing fundamental data of all stocks in NSE and BSE India. I have searched a lot But no luck. Any such services available please guide me. I'm looking for specifically quarterly ...
3
votes
1answer
579 views

Trader Workstation on Ubuntu cannot be connected to via the API

I am using ibPy to connect to TWS on a fairly fresh ubuntu machine. I have been successful in logging into the paper trading account and submitting buy and sell orders programatically via the ibPy ...
3
votes
1answer
284 views

VAR-aDCC full ARCH and GARCH parameter matrices in R

I am working with the rmgarch package in R and I estimated a VAR-aDCC model. Is there any way to extract the extended version of estimates (allowing for volatility ...
2
votes
1answer
484 views

(Reproducible example) Conditional returns in GARCH-EVT-Copula context (with R)

I'm estimating a time-varying correlation matrix for the normal copula using the rmgarch package from R. I've found this code in the rmgarch.tests folder. I use the ...
9
votes
1answer
398 views

Block bootstrap to synthesize asset prices

I have a few basic questions on block bootstrapping on a financial time series ('TS'). Assuming my trade universe consists of 10 stocks, I would like to create a set of synthetic prices for all 10 ...
9
votes
1answer
721 views

Issue with OLS Regression for Nelson Siegel Svensson parameters

I have been working on getting input parameters to the Non-Linear Optimization which gives the Nelson Siegel Svensson model parameters and am carrying out the OLS regression as described in this ...
0
votes
0answers
48 views

Calculating a trading profit rate

I wanted to chek my backtester engine, so I opened a tradingview account and I ran the same test. All buy and sell numbers, prices, dates, indicator calculation, etc were exactly same, but profit ...
2
votes
2answers
118 views

How to use both yield curve and discount curve to value call in QuantLib

I'm new to QuantLib, and I'm trying value a simple European call. QuantLib's Black-Scholes-Merton Process makes sense to me, but I don't know how to incorporate a discount curve into it. Please see ...
4
votes
3answers
14k views

How can I calculate the Maximum Drawdown MDD in python

I need to calculate the a time dynamic Maximum Drawdown in Python. The problem is that e.g.: ( df.CLOSE_SPX.max() - df.CLOSE_SPX.min() ) / df.CLOSE_SPX.max() can'...
2
votes
4answers
129 views

Which rate to use as a risk free rate in emerging markets?

By looking at Fama and Frenchs global Portfolios, they just use the USD-RF rate as the risk free rate, because they converted their Returns to US-Dollar. Im currently estimating Strategy Returns in ...
1
vote
1answer
45 views

RQuantlib not returning greeks for options

I do not manage to get Delta/Gamma/Vega/Theta using the simplified AmericanOption function from RQuantLib: ...
3
votes
3answers
5k views

Python code to download historical firm data

I am looking for a Python code that scraps a website to download historical firm data such as market capitalization, dividend-yield, and so on. I have a code that downloads the current firm data from ...
2
votes
1answer
257 views

Generating surface of Kernel Density Estimates over time

I have a 1-minutely OHLC dataset indexed by time as follows: ...
2
votes
0answers
63 views

Finding Jump Probability For Time Series Data

I'm relatively new here, so if it seems like I'm asking a bad question, go easy on me. So I was looking at the Merton Jump Diffusion Stochastic Model on Turing Finance's article. Instead of creating ...
4
votes
1answer
221 views

Rolling seasonal and seasonal reversal patterns factor investing

I am trying to create a pattern variable that takes the mean of the same month (lag 12, 24... 240) for the last 20 years and the mean of the other months lag (1-11, 13-23, 25-35... 229-239). (...
0
votes
1answer
56 views

Can MACD be calculated for values other than 12 and 26?

I am working on time-series classification problem using Convolutional Neural Networks in Python. The data-set used is financial stock market data (like yahoo finance). I am using some technical ...
4
votes
1answer
476 views

Optimal Portfolio from Efficient Frontier

I found this code on plotly site, using CVXOPT to find the efficient frontier, and then, the optimal Portfolio. The optimal function is ...
1
vote
1answer
84 views

Which Maximum Diversification Approach in MATLAB is correct?

I am currently trying to find the portfolio weights of the Maximum Diversification Portfolio and found two approaches which result in different outcomes. The first one is based on this paper:https://...
1
vote
1answer
77 views

What methods of Data-Screening are necessary before starting an analysis with Thomson Reuters Datastream?

So im currently focussing my research on Momentum-Trading Strategies. I downloaded Constitutents of different All Share indices (including Price, Return index, Market value and Dividend Yield). For ...
0
votes
1answer
166 views

How to calculate premium in Black Scholes model with quantlib?

I am new to quantlib as well as option price modelling. I need to get premium from black scholes model and found this code in internet ...
0
votes
0answers
34 views

Performance Analytics SnailTrail Chart subscript out of bounds error

I am running the chart.SnailTrail function from the PerformanceAnalytics package in r. I get the following subscript out of bounds error. Error in chart.SnailTrail(z, Rf = 0.009261, main = "", : ...
1
vote
1answer
117 views

Useful Book for starting to programming quantative Finance [closed]

Could anyone recommend me a good book for an introduction to start programming quantative finance (preferably in R)? I found a lot of different ones, but unfortunately without any reviews.
0
votes
0answers
38 views

Why do these Monthly vs. daily plots differ?

I got my data from Thomson Reuters Datastream. As an Input for my plot i calculated daily Returns based on the Return-Index provided by datastream. Then i plotted the Monthly and the daily Returns.(...
2
votes
2answers
1k views

Does QuantConnect use both bid and ask data for backtesting?

Or Quantopian? How about Python libraries like ultrafinance and PyAlgoTrader?
21
votes
5answers
7k views

Which Algorithmic trading library would you recommend for trading Bitcoin?

I am starting to do Algorithmic trading in cryptocurrencies using Python libraries. Most exchanges have RESTful API that make it easy to write you own code and get started. However, I would like to ...
9
votes
4answers
1k views

Explanation of Standard Method Generalized Hurst Exponent

Apologies if this question is vague, I've gone over how to word it several times in my head, and I'm not sure it gets clearer each time. I've been looking at this website article https://www....
3
votes
1answer
10k views

Duration of a floating rate note

I have the following C# code for calculating the modified duration of fixed coupon bonds: ...
1
vote
0answers
66 views

Framework for analyzing transaction history

After many years of being discretionary trader I'm finally moving to systematized trading. I have all the transaction history from my broker I want to be the basis of my models. Is there a framework ...
0
votes
0answers
96 views

Where can I get alerts for future delisting of stocks/ETFs?

I scan / trade a universe of 1500 different European and US stocks and ETFs trading on many different exchanges. I would like to get notified before any of the tickers are delisted, so I can sell ...
1
vote
0answers
56 views

Matching the yield on a bond with the zeroRate on a curve in Quantlib

I am using QuantLib to generate a US Treasury curve from 1y, 3y, 5y, and 10y yield quotes. However, after building the curve and running zeroRate on it, it ...
24
votes
3answers
3k views

Tools in R for estimating time-varying copulas?

Are there libraries in R for estimating time-varying joint distributions via copulas? Hedibert Lopes has an excellent paper on the topic here. I know there is an existing packaged called copula but ...
2
votes
2answers
954 views

Portfolio Management in R

I’ve been looking around for a R-package that will allow me to track my stock portfolio - basically I would like to enter stocks that I own, track the trades I make, calculate my open position & ...
0
votes
0answers
37 views

Is this the right way to compute "realized daily market return variance, annualized, over the preceding 126 trading days”?

Realized.Variance<-rollapply((log(Fama.French.daily$Mkt+1)^2) ,126,sum,by=1) So Fama.French.dail$Mkt is my daily Market return. To calculate the realized ...
0
votes
4answers
279 views

Python libraries for Monte Carlo simulations?

I am learning about monte carlo simulations and I have found many blogs explaining its implementation in python. Because its a widely known and an important technique for structuring asset prices. I ...
0
votes
1answer
49 views

Calculate return for a set of securities downloaded using quantmod

I downloaded adjusted closing price using quantmod for a set of securities. I want to calculate daily/weekly/monthly return for all securities. Usual dailyReturn, weeklyReturn etc not working. What do ...
0
votes
0answers
29 views

How can i fit the following regression in R? Why is the coefficient [second Columns] for R so low?

'Rwml' is the monthly log return So the first column is clear, I got nearly the same values, at least the same magnitude. But: If I regress on the variance, my input values are way too low to get a ...
0
votes
1answer
52 views

Don't know if it is obvious, but how do I fit the following model in R?

From the Paper "momentum crashes", Daniel and Moskowitz $I_B$ is a dummy Variable which could be either one or zero Is it possible to regress on two intercepts? or do i get something wrong ? Are ...
0
votes
0answers
92 views

Free dividend data API for non-US stocks

Is there are any free API for dividend data that does also include non-US stocks? I know of this question from three years ago. However, the situation has changed since then apparently, as there are ...
6
votes
1answer
2k views

GARCH volatility modeling, squared returns, and convergence

After reading some more of Volatility Trading, I decided to try to make a simple volatility model using daily log returns of an ETF I follow. It turns out "simple" is sort of relative. Unfortunately, ...
0
votes
0answers
20 views

How to forecast monthly volatility with daily gjrGarch estimates

I'm currently writing a paper and need to regress the 22 days realized volatility of the following month on its GARCH estimate and the 126days realized volatility up to t=1 The paper im referring to ...
1
vote
1answer
2k views

Finding ETF Symbols for alpha vantange

I'd like to use the api of https://www.alphavantage.co/ which is pretty well documented, in terms of avaliable functions (but not parameters). However, in order to get an API response, one needs to ...