# 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.

132 questions
Filter by
Sorted by
Tagged with
25k views

### How to derive the implied probability distribution from B-S volatilities?

The general problem I have is visualization of the implied distribution of returns of a currency pair. I usually use QQplots for historical returns, so for example versus the normal distribution: ...
90k views

### What programming languages are most commonly used in quantitative finance?

What programming languages are the most common in quantitative finance, and why are these languages used? Note: I do not mean, what languages are used to develop the accounting system at a hedge fund:...
5k views

4k views

### Use QuantLib Python to calculate Swap DV01

I would want to use QuantLib Python to calculate DV01 of an interest rate swap. Initially I was thinking of calculating the fixed leg DV01 and floating leg DV01 separately, then add both legs DV01 ...
570 views

### Detect pattern from OHLC data in Python

I'm trying to create a script that, from standard OHLC data, finds patterns. The specific pattern i'm looking for right now is sideways movement after a move up, here is an example: So basically my ...
3k views

### Issue Using QuantLib and Python to Calculate Price and Greeks for American Option With Discrete Dividends

I am having trouble using QuantLib with Python to calculate American options with discrete dividends. I am using Anaconda, Spyder, Python 3.6, and the most recent version of QuantLib. I created ...
478 views

### Estimation of Risk-Neutral Densities Using Positive Convolution Approximation - Python

I'm trying to estimate the risk-neutral density through positive convolution approximation (introduced by Bondarenko 2002: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=375781). I'm currently ...
2k views

### Is this the correct way to forecast stock price volatility using GARCH

I am attempting to make a forecast of a stock's volatility some time into the future (say 90 days). It seems that GARCH is a traditionally used model for this. I have implemented this below using ...
821 views

### SABR Model Pricing Engine in Python QuantLib

I am looking for a SABR model pricing engine in Python QuantLib setting. I do know that it exists in C++ version, but not sure if available in Python. Any suggestion/feedback with respect to Python ...
330 views

### Finite Difference method in Matlab for SABR volatility model fails to provide correct option values

Currently, I'm trying to implement a Finite Difference (FD) method in Matlab for my thesis (Quantitative Finance). I implemented the FD method for Black-Scholes already and got correct results. ...
776 views

### How to permanently add holidays to QuantLib calendars?

I am aware of QuantLib's functions addHoliday() and removeHoliday(), but I am wondering if there is a better way to edit the ...
2k views

### Efficient frontier doesn't look good

Hi I'm trying to draw an efficient frontier. Below is what I used. returns parameter consists of 9 column returns of portfolio. I selected 10,000 portfolios and this is how my efficient frontier ...
8k views

### Multivariate GARCH in Python

Is there a package to run simplified multivariate GARCH models in Python? I found the Arch package but that seems to work on only univariate models. I'd like to test out some of the more simple ...
2k views

### Python libraries for bloomberg?

I am very new with python, and I am used to work with bloomberg formulas for excel. I am starting to use a lot more python in my analysis, is there any library that performs same functions as bdp, bdh ...
249 views

### C++ textbook recommendation for quants

I work as a Quant Dev at a financial institution where I'm mostly using Python for development and thus I have a few years of Python programming experience. I'm planning on learning C++ and therefore ...
30k 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 ...
23k views

### Switching from C++ to R - limitations/applications

I've only recently begun exploring and learning R (especially since Dirk recommended RStudio and a lot of people in here speak highly of R). I'm rather C(++) oriented, so it got me thinking - what are ...
56k views

### Why is C++ still a very popular language in quantitative finance? [closed]

I had to ask this question after reading the answers to What programming languages are most commonly used in quantitative finance? I understand that C++ programs can be optimized pretty well and are ...
48k views

### Is there any thing out there as a substitute for KDB?

thanks a lot for your discussions on the original post. following your suggestions, let me re-phrase a bit : kdb is known for its efficiency, and such efficiency comes at a terrible price. However, ...
19k views

### What is the reference python library for portfolio optimization?

Does anyone know of a python library/source that is able to calculate the traditional mean-variance portfolio? To press my luck, any resources where the library/source also contains functions such as ...
25k views

### Correctly applying GARCH in Python

Problem: Correct usage of GARCH(1,1) Aim of research: Forecasting volatility/variance. Tools used: Python Instrument: SPX (specifically adjusted close prices) Reference material: On Estimation of ...
32k views

### Is the Interactive Brokers API suitable for hft?

By HFT here I mean anything with holding period less than 5 to 10 minutes. Any empirical/anecdotal evidence of using it successfully on even higher frequencies?
6k views

### How good is managed code for algo trading?

I am currently working in a firm that does algo trading. We do all of our stuff in Java. And we do make money out of it. We have debates all the time whether we would have made more money with native ...
13k views

### What is a good broker for HFT?

Currently I trade trough IB. I run my HFT strategies (100 roundtrips per hour) but I think that latency is killing me and my profits are shrinking. I need the fastest possible brokers out there which ...
9k views

### Implementing data-structures in a Limit order book

I'm working on implementing a 'LOB' and I'm being very careful about choosing my data-structures so as to maximize performance. Using F# as an example, I need to consider a List versus Array for ...
14k views

### Option trading API other than Interactive Brokers

I'm looking for an options broker that provides an execution API. I'd like to ideally test on a papertrading version of it before connecting to a real execution engine. I know IB offers that, but they ...
6k views

### Hidden Markov Model & Its Application

I have started reading about HMM it gives an intuitive idea about what HMM is all about. I am looking out for example where its applied to Equity model using R / Excel. The material which I read so ...
13k views

### Which brokers offer a .NET stock trading API?

I'm trying to make up my mind and choose a broker, however much of my choice depends on the trading API offered. I'm definitely not interested in FIX solutions and I'd very much like a .NET ...
13k views

### What is the best live options data API?

What is the best/cheapest service to get real-time (as real-time as you can get) on stock options? I'm looking for the fastest update on the ENTIRE market, with a few stocks prioritized, so I need ...
2k views

### Automated 10-K XBRL data grab using the SEC file structure

I would like to write a program that takes as input a list of CIK/year/quarter entries. The program should iterate through the list and, for each entry, grab XBRL financial data from the SEC website ...
2k views

### Use QuantLib Python to calculate roll-down of a swap

I would want to use QuantLib Python to calculate 6-month roll-down of a 5-year swap. I believe that the calculation I need to do is as follows: $Rolldown=r_{0,5Y}-r_{0,4.5Y}$ Where $r_{0,5Y}$ is ...
1k views

### Are there any tools or useful algos for identifying corner portfolios?

Let's say I am performing mean-variance optimization subject to some weight constraints. I'd like to identify the set of corner portfolios so that I can interpolate the entire efficient frontier. A ...