Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

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
0answers
34 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
30 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
50 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
52 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
16 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
43 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
88 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 ...
3
votes
2answers
173 views

How to interpret and define statistics of GBM output

I am trying to model the future prices of a number of commodities. For this, I am applying geometric Brownian motion, writing a Monte Carlo code in Python. Given that I want to estimate tommorows ...
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
176 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 ...
2
votes
1answer
301 views

Best way to buy and sell large volumes of crypto

I had a few questions about how to properly execute a large order of crypto currency without moving the price much. I know a lot of funds employ a TWAP/VWAP algorithm to liquidate or purchase a large ...
4
votes
0answers
57 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 ...
0
votes
1answer
42 views

Confidence Intervals for ARMA+GARCH forecasts

I have fitted an ARMA(1,1)+GARCH(1,1) model to my logreturns series. When it comes to my standarized error's distribution however, I have opted for a Skewed Generalized Error Distribution, because of ...
2
votes
1answer
245 views

Crossing the spread as a ML signal

In the optic of high-frequency trading, most of the standard trading algorithms work on the principle of mid-price prediction or mid-price movement prediction. However a big drawback of this technique ...
3
votes
1answer
103 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
47 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
458 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
383 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
38 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
21 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
40 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
22 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: ...
0
votes
1answer
88 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
45 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
21 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 ...
2
votes
0answers
69 views

Quantlib Bond PV01 by Tenor

Having built a fixed rate bond object, and looking at here and here , is there any way of retrieving the NPV impact of a repriced bond by bucket/tenor of the Spot Curve instead of getting a simple NPV ...
1
vote
0answers
116 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
103 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 ...
65
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
590 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
923 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
54 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
29 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
75 views

SARIMA+GARCH model

The model ARIMA+GARCH writing as this form with the rugarch package in R: ...
1
vote
0answers
93 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
399 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
584 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
285 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
504 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
406 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
732 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
135 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
15k 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
147 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 ...