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
1
vote
2answers
127 views

What are the best [free]resources to learn C++ particularly for quantitative finance?

What are the best free, online resources to learn C++ for quant finance? The course by quantnet seems too expensive for a broke student like me! If there are any free online resources, let me know! ...
0
votes
0answers
67 views

Which Python or C# backtesting framework supports multi-asset?

Is there any backtesting framework written in C# or Python that supports multiple assets? I'm trying to backtest a pair trading strategy that requires to
1
vote
0answers
39 views

Walk Forward Analysis Using Portfolio Analytics R

I am learning how to use the Portfolio Analytics package in R and I am concerned with overfitting the data for the optimization. The optimize.portfolio.rebalancing() function has 2 parameters that ...
1
vote
0answers
77 views

Extract list of tickers bloomberg api [closed]

Does anyone know what is the python equivalent to the BQL.Query/BSRCH functions from the Excel API? I am essentially trying to get a list of tickers for all government bonds from a certain country ...
1
vote
1answer
61 views

How to build a loop function for out-of-sample backtesting?

Many statistical libraries in R offer the possibility to fit a model and then use the results of optimization to predict values some periods ahead. However, many do not have the possibility to ...
0
votes
0answers
17 views

How can I download quarterly fundamentals of listed companies for the last 10 years+ using Python without charge? [duplicate]

There is a package in Python called yfinance which allows me to download the fundamentals of listed companies from yahoo for the last 5 years (Annual). However I would like to have data over a longer ...
2
votes
1answer
50 views

Compute Vega and Delta in R

I am trying to compute greeks for a large sample of CEO compensation contracts in R. However, my vega computations all result in a value of zero. In doing so, I follow Core and Guay [2002]: Here is ...
1
vote
1answer
123 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 ...
0
votes
0answers
13 views

How to compute reference share price and reference volatility in CreditGrade?

I'm trying to implement CreditGrade in python, from the msci Technical Notes (https://www.msci.com/documents/10199/dd31bcce-6fe3-47b7-9fb7-10c4c8f750ba) but I'm running into some comprehension trouble ...
4
votes
1answer
208 views

Valuing structured loans in QuantLib

I'm trying to figure out if it's possible to value structured products, mainly loans, in quantlib. The idea is to build a bond class with different cash flows. For example, a loan could have coupons ...
5
votes
0answers
174 views

How to calculate average entry price for perpetual swap contracts?

I'm trying to calculate the average entry price for perpetual swap contracts for use in back-testing a trading strategy, as per Bitmex's documentation: A Perpetual Contract is a derivative product ...
3
votes
1answer
179 views

Basis Swaps in Quantlib/Python

I am aware that I can create a IRS in Quantlib/Python by using the following function: ...
1
vote
0answers
55 views

Quantlib Python OISRateHelper using Quantlib Cookbook - hands on Quant Finance

I am completely new to Python, just trying to reference Quantlib Cookbook to construct eonia curve, here is my code. I didn't change much compared to the cookbook Eonia Curve BootStrapping chapter, ...
2
votes
1answer
478 views

Rblpapi millisecond resolution

I'm using Rblapi to get tick data, using the nice getTicks function. Much to my dismay the index is rounded to the second, while milliseconds time stamp could be provided. Tried returnsAs xts, fts(?) ...
2
votes
1answer
417 views

How to sample from a copula in matlab

I have two random variables (say, X and Y). Each of these rv's are defined by their CDFs (CDF_X and CDF_Y). These CDFs were obtained empirically, so they are a "stair" graph. I also have a copula C ...
0
votes
1answer
42 views

How to use ARMA GARCH to do forecasting in R?

How to use ARMA GARCH to do forecasting in R? I only know how to use ARMA to do the prediction and GARCH to do volatility forecasting but how can we use ARMA GARCH to do forecasting in R. Can anyone ...
0
votes
0answers
24 views

Searching for historical gold price intraday data

I'm searching for historical gold price intraday data. Can someone help me and tell me where I can get this data from? I need this data for a research project. I've only found data for historical ...
1
vote
0answers
55 views

How does the mean interest rate of a loan shift over time?

I have a loan dataset (300MB) that comes from the Lending Club and I would like to know how has the average interest rate of a loan varied over time. I have the int_rate column but I'm not familiar ...
1
vote
0answers
23 views

How to check if the people segmentation based on prime and sub prime loans is accurate?

Using Lending Club dataset I have a dataframe with characteristics of loans of some borrowers. Here is their distribution of the sub-grades: ...
1
vote
1answer
146 views

Calculate the historical simulation VaR of the portfolio using Python

Assume that we have 200 stocks in WeiBo (WB), 300 stocks in Netflix (NFLX), 250 stocks in Ford Motor Company (F) and 150 in Royal Dutch Shell (RDS-A) as of 31 August 2019 in the portfolio. I have ...
2
votes
0answers
46 views

Conceptual help - Machine Learning on finance data set [closed]

I am working on Anomaly detection model problem for a finance data set - set of gift card activation transactions. My team member suggested an idea that " First train the model with normal instances ...
0
votes
0answers
22 views

Getting index sectors historical weightings from Bloomberg using python

I want to know how to download an index sectors' historical weightings from Bloomberg. For example, S&P 500 is comprised of Telecom Svc, Materials, Utilities, Energy, Consumer Staples, ...
1
vote
1answer
1k views

Calculating Discount Margin on a floating rate bond using QuantLib

Going off Luigi's hint on this answer: Setting up Schedule for an amortizing floater in QuantLib I was able to cobble something together but I'm unable to verify if it's correct. TLDR: I was able to ...
1
vote
0answers
348 views

Using ISIN to identify stock at yahoo finance

I'm collecting stock data for private analysis. I found a very excessive list of stock at https://www.xetra.com/xetra-de/instrumente/alle-handelbaren-instrumente/boersefrankfurt but the problem is ...
1
vote
1answer
131 views

LIBOR Market Model implementation in R

Does anyone know an available LIBOR market model implementation in R? It should not be too sophisticated, as this is a smaller task of a larger work. I am rather thinking about a similar ...
66
votes
8answers
26k 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 ...
4
votes
2answers
811 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 ...
3
votes
0answers
55 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
34 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
114 views

SARIMA+GARCH model

The model ARIMA+GARCH writing as this form with the rugarch package in R: ...
1
vote
0answers
103 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
437 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 ...
2
votes
1answer
532 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
746 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
181 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 ...
2
votes
4answers
252 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
47 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
0answers
69 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
224 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
62 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 ...
1
vote
1answer
83 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
312 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
41 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
123 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
39 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?