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

1
vote
1answer
114 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
3answers
191 views

accuracy of Yahoo Finance stock data (Python module)

I am using the yahoo finance python module: https://pypi.python.org/pypi/yahoo-finance I am using it for a project and would like to see if anybody else uses data from this source and can vouch for ...
0
votes
0answers
18 views

Variance Ratio on Currency Pair, Validation

Can somebody tell me if my variance ratio (unit root test) test is correct? I don't want to rely on my results until I can find somebody that also has a variance ratio algo that confirms them? Here is ...
1
vote
3answers
119 views

Python everywhere but where do they execute orders?

About every introduction I've read about automatic trading writes about how well python is suited for the task. But looking around, I've been able to find just one brooker, Oanda, which has a python ...
1
vote
0answers
42 views

QuantLib FittedBondDiscountCurve fitResults [Error]

I try to use "FittedBondDiscountCurve" with "NelsonSiegelFitting", but I faced with such problem: ...
0
votes
2answers
30 views

Where to find sample intraday data? One to two days or more

I'm looking for some intraday stock data. Doesn't really matter what kind of security... I'm just looking for price, volume, bid, and ask. I'm looking to test a model based on the dynamics and ...
4
votes
1answer
208 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 ...
1
vote
1answer
55 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 ...
0
votes
0answers
4 views

Portfolio tracker in python [migrated]

I'm making a portfolio tracker using pandas remote data function, however, I'm running into a problem passing in multiple stock names and tickers. I would like to create separate data frames by the ...
2
votes
0answers
51 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. How to reproduce the problem: ...
22
votes
9answers
7k views

What tools exist for order book analysis and visualization?

What tools exist for order book analysis and visualization? In particular, if one wanted to examine a limit order book and understand how it changes throughout the day where would you turn for ...
-1
votes
0answers
35 views

Python Calculating Drawdowns?

Simple question for a newb quant. I'm writing a program to calculate drawdown and duration for any given strategy. The problem is, if my cumulative returns start at zero and go negative immediately, ...
1
vote
1answer
47 views

Calculating the greeks for Quantlib Python Swaptions

So I have created a Swaption object and can get the premium with the NPV() function. However, I would also like to calculate the greeks (eg. delta, vega). From some searching, I found that vega can ...
0
votes
1answer
260 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.
7
votes
2answers
150 views

Are there any integrated framework that I can back-test and paper/live trading in one place?

I'm trying to start working on a fully automated algorithmic trading system, and I'm a little struggling with the framework to use. The requirements I have in my mind are: Needs to support back-...
18
votes
9answers
14k views

Except Zipline, are there any other Pythonic algorithmic trading library I can choose?

Except Zipline, are there any other Pythonic algorithmic trading library I can choose? Especially, for backtesting?
3
votes
1answer
126 views

Quantlib FuturesRateHelper triggers not a valid IMM date error

I'm beginning to use QuantLib with Python SWIG, and trying to build a EUR yield curve. I face this error which frankly I don't understand; I looked at the code of bool IMM::isIMMdate in imm.cpp and ...
3
votes
2answers
144 views

Open source software for stock screening and scanning using technical analysis?

I am looking for open source software which can download stock data (yahoo/google finance etc) and used for screening/scanning stocks using technical analysis, for example: return stock list if ...
1
vote
0answers
60 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
40 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 ...
0
votes
1answer
36 views

Python statsmodel ARMA question

I am reading through the documentation of statsmodel package in python from the link The (p,q) order of the model for the number of AR parameters, differences, and MA parameters to use. How do I ...
1
vote
0answers
37 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: ...
5
votes
1answer
197 views

Which Algorithmic trading library would you recommend for trading Bitcoin?

I am starting to do Algorithmic trading in cryptocurrencies using Python libraries. Most exchanges have RESTful API that make it easy to write you own code and get started. However, I would like to ...
22
votes
11answers
13k 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 ...
1
vote
1answer
165 views

How to calculate bond yield in QuantLib - Python

I want to calculate yield of bond having market price and coupons. I try to replicate C++ from (https://mhittesdorf.wordpress.com/2013/03/03/introducing-quantlib-internal-rate-of-return/) in Python ...
1
vote
0answers
254 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 ...
2
votes
0answers
159 views

Finance Projects in Python [closed]

I am new to this forum. I work in the Market Risk Domain at a leading Investment Bank. I am currently learning Python. And the best way to learn is to experiment with some Real Live Analysis/Project(...
0
votes
1answer
222 views

Calculating half life of mean reverting series with python

I am currently attempting to calculate the halflife of a mean reverting series using python programming language and the theory of the Ornstein–Uhlenbeck process. I have a series which when plotted ...
1
vote
1answer
69 views

Strategies to merge bid, offer and trade price time series into a single price time series?

I'm doing intraday analysis on low volume stocks. There are just a few trades every day, but a whole host of bids and offers. In order to reduce the sparsity of the time series data I'd like to ...
0
votes
0answers
82 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
31 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
136 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
3answers
405 views

Quantlib with python on mac?

Is there anyone who knows a good guide to get quantlib working for python om mac? I have tried to search online and have not found any good guidance. I need to use quantlib for a project on python. ...
3
votes
0answers
119 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, ...
0
votes
1answer
69 views

What is the formula that determines when VIX futures expire?

Or a source that will allow me to just get the list of dates into a program, I'm trying to do this in python but I want it to be able to figure out the next expiration automatically, or something like ...
0
votes
1answer
118 views

Metastock end of day data to Python

I'm thinking of getting End of Day stock prices from Metastock, but was wondering if it would be possible to have Python to automatically extract the stock prices and store it in a SQL. Would that be ...
0
votes
0answers
119 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....
1
vote
2answers
63 views

How can I find stocks that have had a X% price swing within Y days, sorted by recency of said swing? [closed]

Let's say that I want to find stocks that have moved +-20% within a 10 day period. ABC would match if at t, ...
1
vote
0answers
76 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 ...
35
votes
7answers
7k 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 ...
7
votes
2answers
556 views

What time series database can be used with Python and Pandas?

I'm looking for a time series database that can be easily used with Python and Pandas objects such as DataFrame, Panel... But these objects will always contains time series. Ideally I'm looking for ...
2
votes
1answer
128 views

How to get the IMM dates in Python for a given symbol?

How can I get an IMM date from its 2 character symbol (eg. "U6", "Z8") in python? I have not been able to install the quantlib addin (it's hard if you aren't tech savy), so please don't point me in ...
0
votes
2answers
130 views

Is there a python code for estimating the parameters of geometric brownian motion?

I was trying to find the parameters of GBM but could not find a python code for the same.
2
votes
1answer
135 views

Bloomberg Python Question - How do you access PRTU via python?

I am having some trouble using python to access Bloomberg as I cant find much documentation. All I really need to do is a simple lookup of dates in the PRTU function of Bloomberg, PRTU via a python ...
1
vote
0answers
223 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 ...
0
votes
0answers
23 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 ...
2
votes
2answers
377 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 ...
3
votes
1answer
303 views

Shannon's entropy for financial times-series (return)

I'm looking at Shannon entropy, and generaly at ways to tell noise from signal when observing intraday returns (at the minute level for now). In python, e.g. I've implemented the fomula (sum of P(xi)*...
-2
votes
2answers
270 views

Modified or Macauley Duration in python

are there any existing python modules that can calculate Modified and/or Macauley Duration of a bond.