Back to Community
feature request: version control, branching capabilities for algos

I've been editing/tweaking a couple of algos and it would be nice if I can revert back to previous versions or make branches of pieces of code. Sometimes my tweaks blow away performance gains from previous tweaks, etc. Other times I'd like to simply run 2 similar (but for a few parameter changes) algos side-by-side.

12 responses

That's a request that we've heard before and I agree - it would be very helpful to debug and build strategies! I'm not sure when the feature will be delivered, but its on our to-do list.

Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.

you can keep your algos in git and copy&paste them into quantopian UI when you want to test them. You'll be able to reset your git repo to any revision you want and as a bonus you cant use your favorite editor to edit your algos.

Sure, but more integration would be nice. For instance I use SublimeText2, Eclipse, and VisualStudio for personal projects and work. ST2 has a plugin interface in Python. VS and Eclipse are both quite extendable as well. It'd be nice to hit the Quantopian backtesting services through a plugin or such from a desktop environment if implementing version tracking would take too long. That way we can use Git and Quantopian for what they do best respectively. Wuddya think?

yeah, it would be nice to have Quantopian integrated with git the way that algos are kept in git and UI can get any revision from git. However, it would complicate the UI I think. Having plugins for VS and Eclipse would be nice to have as well, but I can live without it as I don't use them.

I agree that have at least a basic VCS with the integrated IDE would be great. I have be copying and pasting a copy of the edits I make as I play with my algorithms into a git repository on my main computer -- it works, but having something similar (without the manual cut/paste would be terrific).

BTW, my guess most of the people here are familiar with Git and other VCSs, but just in case, here are some quick notes someone should be able to use to create and use a manual git like I'm doing above -- hopefully it's helpful to someone out there: :-)

Create a new git repo and check in starting version

1) Install git. This can depend on your OS. See her for some general notes: http://git-scm.com/book/ch1-4.html . Any Linux distro should have a fast easy way to install it. If you are using Windows, you might want to try TortoiseGit -- it's a pretty nice tool for people not familiar with Git or similar version control systems. The MacPorts installer works well in my experience if you have a Mac.

2) Create a new directory and move to that directory:
mkdir MyAlgos
cd MyAlgos

3) Initialize a local git repo:
git init
Note: You might want/need to also setup your user-specific info with:
git config --global user.name "Joe User"
git config --global user.email "[email protected]"
And "git config --global color.ui true" is a really nice option if you system setup supports it.

4) Put a starting copy of your algorithm in the directory (or a subdirectory) you created & initialized above

5) Add that file to Git
git add

6) Commit the starting version:
git commit -m "Starting version of my whatever algorithm"

Note that you can repeat steps 4-6 for as many files as you want (including as many subdirectories under your
starting directory as you want).

Save edits

1) Open the file above in your editor

2) Copy/paste the contents of the Quantopian IDE for your algorithm into your editor and save/exit in the editor

3) Add the changes to the "staging area" for git. There are two main options here:
a) git add
This will add all the changes in that file in one go
b) git add -p
This will go through an interactive set of prompts to add it in pieces/parts. This can be handy
if you made lots of changes and want to break it into multiple commits in your git log history.
Note that some systems may not support this options without some fiddling around.

View History

1) git log
Lots of options here. View git log help and lots of sites on the web. "git log -p" is a good one.

Hi everyone, improving the developer experience is very important to us and we plan on building some great features for this - we just can't promise a timetable for it yet.

I've wanted to build a command-line interface for Quantopian for a very long time - and then we could (or you guys could) build bindings to all the popular text editors, connect to other tools, etc. Just a matter of prioritizing, but hopefully we'll get to that sooner than later.

Thanks for all the ideas and please keep them coming.

thanks,
Jean

Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.

Hi Jean,

Thanks. Sounds great. I wasn't complaining or anything... just weighing in. :-) I total get it that you have take things in priority order.

Kennedy

Could you tell us when you plan to integrate git? Copy past isn't a viable option.
Have you considered adding a terminal access as sense.io? We can use git command line which is quite convenient + we can clone any other lib directly.
Is there a way for user to vote for features?

I haven't heard of sense.io, thanks for pointing it out. I'll check it out. We don't have a current timeline to integrate git or other version control; it's something that has been thought about, but the engineering resource haven't been dedicated. That being said, it's definitely something I want to see added to the platform.

The best way to vote for a feature is exactly like this - to ask for it in the forums or email us privately. The more popular the request, the higher it rises in our prioritization queue.

It would be great to be able to use git and my own IDE/toolchain to develop locally, but then to upload to the quantopian website to run backtests, without manually copy/pasting. All that would be needed would be for Quantopian to provide a minimal IDE API with two functions:

  1. a way to POST a new version of source code to update (overwrite) any
    algorithm in the user's library with the new version
  2. a URL template that you can point your web browser to which begins (and displays) a
    backtest on a given algorithm

That way, a user could program their local toolchain via commit hooks to POST the new version to Quantopian, and then to open a browser window to show a backtest.

I love this idea very much!

This plus being able to code and import your own modules in separate files (just in Python, not compiled, don't worry security team!)