# Tag Info

14

Sorry for not being able to give more than one hyperlink, please do some web search for the project pages. Portfolio optimization could be done in python using the cvxopt package which covers convex optimization. This includes quadratic programming as a special case for the risk-return optimization. In this sense, the following example could be of some ...

9

I don't know why it was removed, but the R package "orderbook" was available: http://journal.r-project.org/archive/2011-1/RJournal_2011-1_Kane~et~al.pdf http://cran.r-project.org/web/packages/orderbook/index.html In the IBrokers package, the function "reqMktDepth" is used for streaming order book data. ...

8

Aside from Zipline, there are a number of algorithmic trading libraries in various stages of development for Python. From the commercial side, RapidQuant looks very interesting though I haven't tried it yet. It's from some of same developers that brought us the excellent Pandas data analysis library. I think Wes McKinney (Pandas's main author) is ...

7

So one such visualization package is demonstrated in http://www.tradeworx.com/movie/booklet_demo/temp/booklet_demo2.mov. AFAICT it looks like a tk script. Trading Technologies (TT) sells another visualization tool. But TBH writing your own tool takes a few hours and allows you to focus on what information you are interested in finding.

6

I guess what they are trying to say here is that, assume you have two time series $X$ and $Y$ which are exactly the same i.e. $X=Y$, the correlation is : $$\rho_{X,Y}= \frac{Cov(X,Y)}{\sigma_X \sigma_Y}\overset{X=Y}{=}\frac{Cov(X,X)}{\sigma_X \sigma_X}=\frac{\sigma_X^2}{\sigma_X^2}=1$$ Now assume a time series $Z=2 \cdot X$, you have: \sigma_Z=2 ...

5

http://lobster.wiwi.hu-berlin.de/forum/viewtopic.php?f=4&t=30 R code, pictures and discussion, it's easy to modify it

3

You said:"I understand that the generated ticks will be generated using interpolation (so they won't be exacts)". You are very optimistic, they will not only be far away from being exact, they (the tick data) will be completely removed from reality, the only parameters known for the tick data will be boundary conditions, such as open high low close. You ...

3

TradeStation offers python support via their WebAPI. Check it out here: http://tradestation.github.io/webapi-docs/

3

I reproduced Ledoit and Wolf's experiment outlined in their paper "Honey I Shrunk the Covariance Matrix" in Python which includes an implementation of their method to shrink the covariance matrix (can be found here see the get_shrunk_covariance_matrix() method on line 417). All the code for the entire thing is on Github here. I make use of the cvxopt module ...

3

I know this is an old question, but Wes McKinney, the developer of pandas (mentioned in another answer) is releasing a new Python package called RapidQuant that I think might meet the OP's stated needs. It appears to include both non-standard risk definitions and portfolio optimization. However, it is not open source. While the OP didn't specifically mention ...

2

I came across B/View which is a Java application that visualizes the order book for a single stock on a single day. It encompasses some of the basic features I would expect in such a tool. It appears to be more a demonstration than a general purpose tool.

2

I know of no broker that provides an official, supported Python API. If you are at Interactive Brokers you can consider using their FIX gateway, but that comes with additional cost. QuickFix provides a Python API.

2

I'd put this down as a comment, but don't have the reputation to do so. There is (or at least used to be) a two part MOOC course over at Coursera by one of the developers of QuantSoftware Toolkit. This is not an endorsement of the course or the software, just a statement of fact (for the record, I did do a part of the course, but found it too simplistic and ...

1

As far as I know the Newton method is the preferred method for yield calculation. Two ideas to optimize the loop spring to mind: Run the loop in parallel. Use the last yield as starting value. If you have a good guess the number of iterations necessary per optimization is reduced significantly. How to get the most out of the previously calculated yield ...

1

If you don't know the meaning of the other matrices, I'd look more at the docs and the definition of the quadratic program: http://cvxopt.org/userguide/coneprog.html#quadratic-programming This is also an example from the book: http://www.ee.ucla.edu/~vandenbe/publications/mlbook.pdf And there is a good deal of explanation there. Finally, if you don't ...

1

I currently use a combination of matplotlib and Oanda's FX API. Their API is REST based, and would essentially allow for any type of library to handle calculations. A python wrapper for the Oanda API is on github

1

You can have a look at : TradingWithPython library (TWP Library) http://www.tradingwithpython.com/. Like Quantopian / Zipline it uses Python Pandas library. It includes an Interactive Brokers module to trade realtime.

1

You can check also QSTK It's an open source library developed by Georgia Tech and used in a Computational Investing course.

1