Back to Posts
Listen to Thread

In the old days, I used to go back and forth between the code, custom "indicators" and debugging on price graphs the entries and exits. I am finding it hard to visualize and debug what the systems are doing in backtests here, and missing some reflexivity in the idea generation->visualization->backtest->debug cycle...

Perhaps I should get a copy of matlab or something and do the idea generation in there, saving quantopian for final checks-and-balances backtesting? What are you all doing to mitigate this?

Simon.

ps - by "all" I mean all you users, I am not accusing quantopian themselves of not giving me enough stuff for free!

If you haven't had a chance to check it out, I highly recommend looking at the IPython notebook (http://ipython.org/).

Wes McKinney gave a nice demo of researching using the IPython Notebook at the Boston Algo Trading Meetup (http://www.meetup.com/Boston-Algorithmic-Trading/events/94376722/). We'll be posting a video of that meetup, along with the slides and notebook, in the not too distant future.

Hello Simon,

I echo your sentiment -- thanks to Quantopian for the free tools and workshop space!

You might also check out Spyder, which is a scientific IDE for Python. I've only used it for debugging some code for Quantopian, but it appears to be sophisticated. Regarding the IPython notebook, it is described in Wes McKinney's book, Python for Data Analysis. I haven't tried IPython yet, but one attractive feature is that it can be set up to embed plots inline with the code. Regarding MATLAB, my sense is that you'll be able to do more with Python, since there are lots of free, relevant Python modules available (e.g. see the Quantopian help page). With MATLAB, to get the same functionality, you'd have to buy various toolboxes. Also, you'd end up having to port your code over to Python to run it on the backtester.

Regarding the lack of "reflexivity" in using the Quantopian backtester, I agree that it is not so user-friendly in this area. Having been involved as a user/member for awhile, as I understand the situation, one of the fundamental constraints facing the Quantopian engineers is that unfortunately they can only provide limited access to the backtest data set (perhaps Fawce can comment on the agreement they have with their vendor). Under more typical circumstances, a chunk of the data would be available for free-wheeling exploration. As a side note, my understanding is that universities and institutions sometimes have access to CRSP data sets. I wonder how they handle the licensing and restricted access problem?

More directly responding to your question, I am realizing that it would be more efficient and effective for me to do some data exploration, algorithm development, and coding in Python outside of Quantopian, and then copy-and-paste into the online backtester. For a backtest idea, I need to write a basic function (utilizing a fast Fourier transform, or FFT), and I think that I'll try the IPython notebook to get it up and running first. Then, I'll paste it into the Quantopian backtester...stay tuned...eventually I'll post the algorithm to this forum.

To Fawce and all, in my mind, down the road, it would make a lot of sense to be able to to submit backtest jobs to an efficient and flexible Quantopian online "engine" that would be accessible via a few lines of code in a Python program running locally on my pc, and have the results returned in a file for analysis and display. This would be a complement to the online, browser-based backtester (which is very clever and fun to use, but not so flexible and scalable).

Cheers,

Grant

Yeah I decided MATLAB was an expensive dead end for the time being. I am going to start coding up an event study framework for home use, possibly based on the Computational Investing course code, and see where it leads me. After spending hours last night trying to update python/numpy/scipy on my OSX laptop, I've also decided to just install a Linux VM and do my work in there!

Hello Simon,

Last night, I installed IPython Notebook on Ubuntu Linux and tried a few lines of code and an inline plot. Worked just fine. I have Spyder installed on the same pc--works, too.

Grant

I run the whole gamut on mac, as do a few Quantopian teammates. If you want to run it natively, the best howto I know of is here: http://www.thisisthegreenroom.com/2011/installing-python-numpy-scipy-matplotlib-and-ipython-on-lion/

The blog is probably the best for pythonic finance practitioners, so I recommend the whole thing!

Ah hmm, perhaps I am making my life unnecessarily complex by having chosen to use python 3.3 ?

qtconsole looks sweeeet....

fyi I use python 3.3 (numpy/scipy/matplotlib/pandas etc ..) and have few problems. Generally get the dev version of modules from github and build those. Just as easy as using pip and you have the git repo to look through the code if you want.

I would be great if you could post Wes's video at the Boston Algo Trading Meetup

Log in to reply to this thread.
Not a member? Sign up!