We’re rewarding the question askers & reputations are being recalculated! Read more.

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

CFH TOOLBOX MATLAB OPTION PRICING [on hold]

Does anybody know CFH (Characteristic Function Option Pricing) toolbox of matlab? How does this toolbox work? I've just intalled it into my matlab and I would like to use it to pricing option with ...
0
votes
1answer
38 views

Heston model with jumps in both variance and underlying dynamic

How can I build on Matlab a Heston model using characteristic function adding jumps in both variance and underlying dynamic ? Suppose that the number of jumps is Poisson-distributed but the jump size ...
2
votes
0answers
45 views

Dynamic Programming optimal saving-consumtion finite horizon problem

Let $w_t$ denote a consumer's wealth at time $t$ and $c_t$, the amount she chooses to consume, so her savings exiting this time period are $w_t-c_t$. Given this savings decision, her savings $w_{t+1}$ ...
0
votes
0answers
44 views

Solving for unknowns in Black-Scholes equation using Python

I have defined the Black-Scholes equation in Python as follows: ...
1
vote
0answers
40 views

machine-learning method to predict PCA weights

I have been using certain linear-regression to extract the PCA (top 3) weights relating to a certain data-set. I was wondering, instead of using linear-regression to generate the weights, I can use ...
1
vote
1answer
39 views

Calculating and visualising the future value of 100USD invested in fixed income securities and bonds in R

I have uploaded TB3MS to R and would like to visualise the future value if i invest 100USD in it. The interval is from 2014 to 2019, monthly frequency. I would like it to be comparable to a plot i ...
0
votes
0answers
27 views

How to get implied volatility from Heston Model? [on hold]

I calibrated it with DEoptim, I got the Heston Model price, but now I can't get the implied volatility.I'm using the bisection method and it isn't working because I got it wrong. Could you help me ...
1
vote
1answer
57 views

Portfolio/sub-portfolio optimization

I have a finite amount of 26 assets, the total amount of these assets needs to be allocated to 9 portfolios. Each portfolio has its own required return which needs to be met, using a min-variance ...
0
votes
1answer
50 views

setting up bloomberg api for python

I am trying to configure bloomberg api in python. I have used pip to install the api, i also downloaded the BloombergWindowsSDK. I am not sure where to go from here. Can i please get a step by step ...
0
votes
0answers
21 views

How to run VAR(1)-GARCH(1) model in Eviews/MATLAB/Python or R? [closed]

I have VAR(1)-GARCH(1) model but I don't know how to run it on programs. Does anybody have any documents or some code for this model? Thank you so much.
1
vote
0answers
68 views

How to correctly simulate volatility shocks?

I am working on the comparison of different volatility timing/target strategies on portfolios starting from different conditions (data, asset classes, calculation of realized volatility, different ...
1
vote
0answers
58 views

Annualizing Sharpe Ratio using small time frames

I have coded a strategy that works 5m time frame. I know you multiply it by 252 but i am using 5m or sometimes 1h time frame. Which number do i have to chose to multiply? There are 72576 five minutes ...
1
vote
0answers
44 views

Bloomberg C# / CS.NET SDK for STDY Functions

I have downloaded and installed the CS.NET SDK from STDY. I have installed this as admin and had no problems with the install. However, when I open VS2017 (last version supported by BBG) I do not see ...
0
votes
0answers
36 views

Automatically gathering closing prices for stocks listed on different exchanges

I am looking at the holdings for a particular ETF. A lot of the tickers represent stocks on different exchanges. For example for one of the holdings the stock appears on Yahoo Finance, but for another ...
1
vote
1answer
35 views

Is there a quicker algorithm for calculating 'drifted' portfolio weights? (R, Pandas/NumPy, MATLAB)

'Sup, QuantSX. BLOT (Bottom Line On Top): Is there a nice clean algorithm for rapidly calculating portfolio weight drift? In R, Python or MATLAB - I'm not fussed which. Details I'm in the final ...
0
votes
0answers
13 views

Zipline calendar spanning multiple days

I am trying to back test an algorithm using zipline and need to build a zipline calendar that maps to my brokers opening hours. My broker (FXCM) opens on Sunday at 17:00 and closes on Friday at 16:55. ...
4
votes
2answers
252 views

Best topics to begin Quantitative Finance Research/Programming

I have a background in mathematics (Functional Analysis and Probability Theory) and am looking to acquaint myself with research in quantitative finance, particularly with a programming component. ...
3
votes
1answer
121 views

Bootstrap ESTER and SOFR curves with Quantlib Python

Is it possible to bootstrap the new ESTER and SOFR term structures in Quantlib? More in general, does the process work as the usual one? Given these are simple indices that are published on a daily ...
2
votes
1answer
48 views

Heston calibration using Quantlib and Python: failure in BlackVarianceSurface function

I have an error when trying to use the fucntion BlackVarianceSurface from quantlib. Can you help me? the error is RunTime Error: dates must be sorted unique. ...
1
vote
1answer
56 views

Is my python solution good? : Global Minimum Variance portfolio with 'no-short sale' constraint

Question Is my python code an answer (at least a close answer) to get the weight vector of the Global Minimum Variance portfolio problem? My codes are shown below after some explanations. Details ...
2
votes
1answer
53 views

evaluating garch models

I used ugarchroll to backtest my garch model on S&P returns this is my code ...
0
votes
0answers
38 views

Fixed rate bond pricing issue in Quantlib

I cannot retrieve the same price for a fixed bond using quantlib. ...
2
votes
0answers
101 views

Using Python Quantlib's FittedBondDiscountCurve as Evaluator of Parametric Curve - Errors

I am using Quantlib's FittedBondDiscountCurve in Python 3.7 and setting MaxIterations to 0, and giving a guess_solution, which then turns the routine into an evaluator for the parametric form I choose,...
0
votes
0answers
21 views

Where to find the components of an index and how to replicate it by subset selection?

I am interested in replicating the performance of the eurostoxx 50 index using different statistical methods. That's what ETFs do, right? How to replicate an index using subset selection? I think I ...
3
votes
1answer
159 views

Finance: Portfolio - Long Short Portfolio construction

I am trying to construct a Long / Short portfolio in R. Say I have two portfolios Tech and Mature and I want to go long on the <...
1
vote
0answers
57 views

Why don't these betas match?

I am sure I am missing something simple, but I would expect my portfolio beta when regressed against the market to match my individual component betas multiplied by the portfolio weights. I have ...
6
votes
1answer
80 views

Error message when backtesting GARCH in R

I am trying to backtest my ARCH model using ugarchroll from rugarch package in R, but I am getting this warning message ...
2
votes
0answers
67 views

Understanding APR via programming [closed]

I am trying to better understand different types of interest rates. However, I am having difficulties complete, consistent and pedagogically-efficient explanations online. Thus, I have decided to ...
4
votes
1answer
233 views

R or Cpp for some finance work involved complex numbers?

I need to implement some pricing functions which involve complex numbers. The equations involve various expressions such as $Re$ and $Img$ (i.e the real and imaginary part of the complex number), and ...
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
2answers
116 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! ...
1
vote
0answers
28 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
51 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
42 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 ...
0
votes
0answers
11 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 ...
0
votes
0answers
31 views

How can I estimate a dynamic GARCH model using a Kalman filter methodology in R or MATLAB?

Does anyone know of any R or MATLAB packages for estimating GARCH models using Kalman filtering or any other state-space methodology? I would like to estimate a GARCH so that not only the variance, ...
4
votes
0answers
55 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
100 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
1answer
83 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 ...
1
vote
0answers
45 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, ...
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 ...
4
votes
1answer
173 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 ...
1
vote
0answers
39 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
75 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 ...