Python is a dynamically and strongly typed programming language whose design philosophy emphasizes code readability. Two significantly different versions of Python (2 and 3) are in use. Please mention the version that you are using when asking a question about Python.

learn more… | top users | synonyms

4
votes
1answer
200 views

Wrong discount factors when finding Nelson Siegel Svensson model parameters

I am trying to determine the parameters for the Nelson Siegel Svensson model and am solving a Non- Linear Optimization problem to do this. Some of the code I have written is below and this is where my ...
4
votes
1answer
512 views

Moving window forecasting in Python

I am looking to create some code that will out-of-sample forecast the HAR-RV model. The model itself is formulated as the following, and the betas are estimated through HAC-OLS or Newey-West. ...
1
vote
1answer
33 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 ...
1
vote
1answer
108 views

quantlib python : missing methods?

I'm reading Introduction to Selected Classes of the QuantLib Library I by Dimitri Reiswich and tries to "convert" it to Python. It seems to me that some C++ possibilities aren't available in python. I'...
1
vote
1answer
1k views

estimate implied volatility using newton-raphson in python

I am trying to calculate the implied volatility using newton-raphson in python, but the value diverges instead of converge. What is wrong with the code? ...
0
votes
1answer
238 views

Can I use PyAlgoTrade for Forex?

Is it possible to use PyAlgoTrade for Forex related algorithms? If it is, please point me in the right direction on how to get PyAlgoTrade to work on Forex data.
4
votes
0answers
343 views

Rate Distortion Minimization in a Python Clustering Algorithm

I'm attempting to solve for $\hat{k}$ clusters, such that the rate distortion is minimized, as described here, however, the answers that I am getting from my algorithm are not following the "Jump" ...
3
votes
0answers
112 views

What is the best open source automated trading platform or options?

I would like a custom C++ Automated Trading Platform for Futures like Multicharts, or similar automated trading platform that I can put on my servers so its secure and fast. I have found this so far, ...
2
votes
0answers
52 views

Black-Scholes explicit Euler implementation python

I've written some code for the explicit finite difference method to solve the BS equation. For certain sets of parameters (time-steps and asset-steps) I get a stable but wrong solution. For others, ...
2
votes
0answers
93 views

Problem with Naive Bootstrapping (US Government Bonds)

I am using the formula here to determine the discount factor function and eventually the zero-coupon yields. I get the data for Coupons, Face Values and Closing Prices from Thomson Reuters, which I ...
1
vote
0answers
25 views

Changing timezones with historic forex data (Interactive Brokers API IBPy)

I would like to be able to change the timezone for my requests to the IB API, how can I do this? I am writing in Python, and thus use the IBPy wrapper found here. Supposedly, the third argument of ...
1
vote
0answers
54 views

Backtesting Long/Short Market Neutral Z-Score Strategy with Custom Factors and Custom Stock Universe

So I've managed to backtest simple strategies, like MA, RSI and some fundamental ones (P/E ratios etc) but Im stuck at my last strategy. Here is some information: Tools: Excel and Python (also a ...
1
vote
0answers
33 views

Model Free VIX Calculation in Python

I have previously seen this implementation and had meant to replicate it, but can't find it any longer. Does anyone know of a python implementation of the CBOE Volatility Index? Yes, the white paper ...
1
vote
0answers
28 views

Python regenerating ARMA params using statsmodels

I am trying to regenerate the ARMA parameters from statsmodel in python. The code I am using is: ...
1
vote
0answers
66 views

How to fit exogenous + GARCH Model In Python?

I am studying a textbook of statistics / econometrics, using Python for my computational needs. I have encountered GARCH models and my understanding is that this is a commonly used model. In an ...
1
vote
0answers
206 views

Formula behind pandas.Options() implied volatility

I noted that implied volatility (IV field) from pandas.Options class is very different (especially, for out of money options) than what I compute with Black-Scholes model. (risk free rate is pulled ...
1
vote
0answers
55 views

Issue with Naive Bootstrapping (US Government Bonds)

I am using the formula here to determine the discount factor function. I get the data for Coupons, Face Values and Closing Prices from Thomson Reuters, which I insert into the Dataframe ...
1
vote
0answers
108 views

bandwith portfolio rebalancing in python

I want to calculate a bandwith rebalancing machanism for a portfolio of two assets. As soon as the performance of one ov the assets gets bigger or smaller than the other one + a defined tolerance ...
1
vote
0answers
462 views

Implied volatility from American options using python

I am currently trying to construct volatility surface from american option prices (using Cox-Ross-Rubinstein tree) in Python 2.7. Below you can find the code I came up with. Any corrections would be ...
1
vote
0answers
247 views

How to implement the herding measure proposed by Lakonishok et. al (1992) in python

I would like to test for herding behaviour using the herding measure developed by Lakonishok et. al (1992) on a dataset containing trader transactions during 2013, however, i am having some trouble ...
1
vote
0answers
1k views

Black Scholes well coded Python

I have some trouble with the following code. Some jump and a decentered path are present but it's not the case, normally for Black Scholes diffusion ! Is anyone see a problem in my code ? ...
0
votes
0answers
65 views

First step of Black-Litterman portfolio

I tried to implement Black-Litterman model. I have a covariance matrix, market capitalization for each asset. I assume a risk aversion factor to be 10. First I use the following code to get ...
0
votes
0answers
30 views

Calculating returns when number of securities in a timeseries varies over time?

I have a timeseries of security returns in which the number of securities in the timeseries varies over time. More specifically, I have a universe of events where securities(their returns) are added ...
0
votes
0answers
114 views

QuantLib importing in Python

Since I am working with a thesis, QuantLib is a very new thing for me. I have installed and compiled QuantLib, including the QuantLib-SWIG. Everything was compiled and installed using the guidlines at ...
0
votes
0answers
112 views

Ideas for speeding up greek calculations

My current calculations using the vollib library averages 0.5 seconds. Is there any way to get it faster? Any tips/best practice notes will be helpful. This is for a scripting language such as python....
0
votes
0answers
22 views

Selling two uncorrelated OTM options lowers the over all probability of profit?

I am trying to simulate shorting two uncorrelated put options, I wrote a python program and used monte carlo method to simulate the PnL on expiration: gist It seems the probability of profit is ...
-1
votes
0answers
27 views

Anyone know how to build worldquant alpha 101 using pyalgotrade?

Anyone know how to build worldquant alpha 101 using pyalgotrade? Could someone give me the sample code? Or how could I start this project? Or there is another tool can simulate the worldquant alpha ...