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.

learn more… | top users | synonyms (9)

2
votes
0answers
39 views

Approximate asian geometric option with Heston

I am trying to implement Theorem 1 from this Journal in RStudio. The journal says the it is possible to find a approximate price of a geometric asian option in a Heston setup this way: ...
0
votes
0answers
12 views

C++: Derive a class template from QuantLib::PiecewiseYieldCurve [migrated]

I would like to derive a class template from QuantLib::PiecewiseYieldCurve. This is my derived class definition: ...
3
votes
2answers
140 views

Thesis using Momentum strategies in R, tips on good books, guidelines etc on how to do the programming?

I am quite new to R and will be doing an empirical analysis of momentum strategies in R using a dataset from the index OSEAX from 1980 to 2014. The momentum strategy will for the most part resemble ...
3
votes
1answer
54 views

Yahoo finance, interactive chart and historical prices are different

I am very new to the stocks. I checked the TNTE.AS stock on Yahoo Finance website. Here it provides "Interactive Chart" and "Historical Prices". But I found they are showing different values. For ...
0
votes
3answers
64 views

Realtime Exchange Rate Data API

There are various sources for real-time exchange rate data, e.g. Ariva EUR/USD. Is there also an API or other source which enables to automatically retrieve real-time exchange rates as a data stream ...
3
votes
2answers
78 views

Change periodicity on Rblpapi

So Dirk Eddelbuettel, Whit Armstrong, and John Laing released Rblpapi to CRAN recently, and it is awesome. I'm having some difficulty understanding how the overrides work though, hopefully someone can ...
1
vote
0answers
32 views

More cache friendly linked list or alternative with optimal append, delete, and ordered traversal for limit order book?

I am trying to implement a stock matching engine/order book in C++, and am searching for a more cache friendly architecture. Currently, my data structures are as follows: An intrusive rb-tree for the ...
0
votes
0answers
36 views

Is there a limit to the number of Spot rates than can be calculated from Par Yields

I am just trying to calculate Spot Rates from Par yields. I find that the code below gives very similar spot rates for the data here, yet if I increase the size of the ...
0
votes
1answer
46 views

Calculating Accrued Interest of Bonds

I am trying to calculate the accrued interest for a set of Treasury Bonds. I am comparing the answer from the code below with that for the 1st Bond(row) over here. In the link the AI is ...
0
votes
1answer
21 views

Correct Theoretical Discount Factors from Nelson-Siegel-Svensson?

I am calculating the theoretical discount factors associated with a bond that has 30 months to maturity from today with the parameters below obtained from here using the Nelson-Siegel-Svensson Model. ...
0
votes
1answer
75 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 ...
2
votes
0answers
74 views

How would it be possible to use Dynamic Programming to search a space of investment strategies to find an optimum?

As my question states, the problem I am having is finding a sensible way to search a large space. Any help or insight that could be provided would be hugely appreciated. Currently I am trying to ...
0
votes
0answers
35 views

Broker or source of intraday futures data for a python API?

I am looking for a broker that offers a python API for downloading historical intraday data on futures. So far I have only seen Interactive Brokers and Tradestation. Are there some other brokers ...
2
votes
1answer
82 views

What is the best data structure/implementation for representing a time series in C#?

I'm looking for a tick by tick high performance container. So far I've been using List where Tick is a simple struct with a DateTime and double field. I'm using Linq for date lookups but it's ...
0
votes
0answers
8 views

Is there any theoretical work to find an optimum size for the size of horizon in finite-horizon optimization or control?

we learn a lot about finite and infinite horizon control in dynamic programming. but I was wondering if we want to minimize the cost per time(discrete time) is there any work to find the optimum size ...
0
votes
1answer
89 views

ASX level 2 data via API

Is anybody aware of Java/C++/Python API's available for ASX stock market depth? I'm currently using IB which is ok but has a number of limitations / issues - the one I care most about is the limit of ...
1
vote
1answer
76 views

Test .mql4 (meta trader 4 editor) when the fx market offline

I am coding some simple .mql4 program, you know, the fx market is offline on weekend, and the market will be not shown in Meta trader 4 platform. I wanna test my program in meta trader 4 on weekend. ...
2
votes
0answers
115 views

Bloomberg scripting language (BLAN)

Did anyone work with Bloomberg scripting language (BLAN is the name I guess). If so is it really flexible and is it competitive with other valuation services (say Super Derivatives). Does it enable ...
2
votes
4answers
97 views

Obtaining intra-day values of the EUR-USD exchange

I need for my project the values of the EUR-USD exchange (both intra-day and ticker). I've been playing around with the Yahoo's YQL API and at this moment I can obtain the current value of the ...
0
votes
2answers
118 views

What is the current lowest possible latency for TCP communication?

I have two machines over a 10Gb network that need to communicate with each other through a TCP connection. In terms of technology, what is the current lowest latency possible for this to happen? What ...
2
votes
0answers
76 views

Calibration of Heston version of CIR

I'd like to calibrate a variant of Heston model for interest rates which is describe by this couple of SDE \begin{aligned}dr_t&=a(b-r_t)+\sqrt{r_t}\sigma_t dW_t^1 \\ ...
4
votes
3answers
149 views

Technical analysis - Calculating Aroon Indicator Serie

I'm trying to build a class to create Aroon series. But it seems I don't understand the steps well. I'm not sure about what purpose I have to use the period parameter. Here is my first attempt: ...
0
votes
0answers
95 views

Java Implied Volatility Solving with Newtons Method

Hi I am currently working on implementing my newtons method to guess implied volatility and I have the same code as you do. However, my vol result goes to infinity and I have not figured out why my ...
1
vote
1answer
347 views

Downloading Data from Interactive Brokers using IbPy

I am trying to download data from Interactive Broker using the code below and I am able to create the connection with the Trader Work Station (I get a "True" after ...
1
vote
1answer
111 views

What is an appropriate algorithm to use for tax loss harvesting?

I've been reading into how Betterment and Wealthfront have architected their tax loss harvesting algorithms, but they stop short of providing any real examples. Essentially, they both reduce to: ...
1
vote
2answers
468 views

The future language of quant programming? [closed]

Im just about to begin the programming aspect of my education towards being a Quant. I know what languages are currently being used and how popular they are. However, I have several good friends ...
2
votes
3answers
236 views

Dou you have an example of implementing Engle-Granger 2-step cointegration?

Does anyone know where to find an example of implementing Engle-Granger 2-step cointegration? Python's ideal, but any language will do. I've skimmed and read many articles, but understand little ...
2
votes
1answer
111 views

Why annualized return and cumultive return aren't equal over 1-year period with Performance Analytics package in R?

I use Performance Analytics package in R to compare annualized and cumulative return of a portfolio. My expectation is that both should be equal over a period of 1-year but results tell me I'm wrong. ...
3
votes
1answer
151 views

Do you have a good application example of Approximate Dynamic Programming?

Have you ever tackled a finance problem with Approximate Dynamic Programming? I have only used dynamic programming for simple examples like a optimal extraction in mining. Do you have canonical ...
0
votes
0answers
69 views

How to get get weekly returns from daily data

Good day I would like to get weekly returns data from daily data , I want to use the Wednesday-to-Wednesday approach – the returns (rt) are computed from the Wednesday closing prices Pt , i.e., rt = ...
0
votes
0answers
60 views

Fund Allocation Logic

I am writing a program which automatically calculates the trade allocations. Imagine we have a 3 funds, Fund A, B and C. They current asset allocations (so-far-percentages) are 10%, 20%, 70% ...
2
votes
2answers
86 views

Q regarding amortization of 500,000 loans

I am brand new to this forum. I asked this question on the main StackOverflow site and it was suggested that I ask here. My task is to find a method to quickly calculate the monthly cash flow on ...
0
votes
1answer
220 views

Bloomberg equity option volatility data

Using the Bloomberg open API, I am trying to program a C++ script that is able to download option volatility data from Bloomberg. I currently do not have access to Bloomberg, but in the coming week I ...
0
votes
0answers
48 views

Does anybody know how to use jquantlib with eclipse?

I'm currently beginning to work on my masters project in QF and I wanted to use jquantlib for my work. I've searched the internet quite a bit but couldn't find good understandable info on how to work ...
3
votes
1answer
216 views

Do you have a validation set for Libor Market Model implementation?

I'm trying to calibrate a Libor Market Model (LMM) in Matlab with my user-defined function, not their package. I already fitted the market volatilities using SABR but failed to simulate the ...
3
votes
1answer
268 views

API for after and pre market data

Is there an API or APIs similar to the Yahoo! or Quandl APIs, that give the same access to pre and after market data? I know I can scrape the Nasdaq or Yahoo! Finance sites to get a pre/after market ...
1
vote
1answer
99 views

Median value for geometric brownian motion simulation

I'm trying to simulate stock prices using GBM. I am using the following formula, and MATLAB function, to determine the stock prices: $\nu = \mu - \frac{\sigma^{2}}{2}$; $S = S0*\text{[ones(1,nsims); ...
1
vote
1answer
451 views

examples of c++ code with application to quant finance [closed]

I've some intermediate knowledge in C++. However, the knowledge is more of a theoretical nature and not applied to quant finance problems. I'm looking for good sources, code examples books blogs ...
1
vote
2answers
272 views

What Matlab packages to I need as a Risk Analyst?

What toolbox are more suitable for a risk analyst. I found this: Optimization toolbox Global optimization toolbox Econometrics toolbox Financial toolbox Statistics toolbox And also I have as a ...
0
votes
0answers
42 views

Web Based Market Profile Code

I am looking for someone who knows of or has access to web based charting code using Market Profile. Does this exist out there? I would prefer the source code so I can make changes to it. Any ...
2
votes
2answers
148 views

C# - Using Black Scholes Newton returns NaN occasionally

First caveat: I'm a programmer doing this for a client, and my knowledge of options probably has holes in it. So be a little forgiving here. =) The Issue: When I run Black Scholes Newton against ...
4
votes
3answers
507 views

What is an efficient method to find implied volatility?

I have a code that finds the implied volatility using the Newton-Raphson method. I set the number of trial to 1000 but sometimes it fails to converge and doesn't find the result. Is there a better ...
6
votes
1answer
216 views

What is a good Computer Algebra System for financial engineering?

I would like to know if there exists some computer algebra systems adapted to calculate pricing based on particular models, i.e. pricing YoY Inflation Swap under Jarrow Yildirim Model. I know that ...
0
votes
0answers
129 views

Book chart plotting library identification

can you help me identify how those charts are constructed? To your knowledge, is it generated from Python, R, Java, C++? What packages can you identify? I've tried the ggplot2 library in R and I have ...
0
votes
5answers
445 views

API-based equity screeners?

I know there are APIs from different brokers that allows you to trade and also obtain information about specific companies, but I wonder if there are equity/asset screeners that are API-based and can ...
6
votes
2answers
909 views

How do Return.portfolio and Return.rebalancing work in Performance Analytics in R?

I have a question about the function Return.portfolio/Return.rebalancing from the Performance Analytics package in R. I take ...
3
votes
3answers
171 views

Convergence of GBM mean after simulation?

As a follow up of my previous question, I am now simulating the GBM step by step for $n$ steps. I am using the following implementation for the simulation: $$S_{t+1} = S_t \exp \left[ ...
3
votes
1answer
146 views

What is wrong in this GBM simulation?

I am trying to generate a few samples of GBM using the following very simple MATLAB code: ...
0
votes
1answer
107 views

Choosing broker to run with Zipline

Which brokers offer Python integration/API? Which brokers offer R integration? I'm starting on trading, and I want to learn about algorithm trading. So I would like to know what brokers offers these ...
0
votes
3answers
2k views

Which library shall I use for time series analysis in Java?

I'm looking for a library to do some time series analysis in Java but I can't find anything suitable. I've found plenty of libraries such as Math3 of JSAT but there's much I can you for my problem. ...