Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Feature request: algo code snapshot attached to backtests

It's not quite full version control, but if one is actively tinkering with an algo and repeatedly running backtests, it's a bit frustrating to go back through old backtests and be unable to reproduce them, since you've changed the code since then. It would be helpful if every backtest had an attachment, which was the exact algorithm code which generated it. Unless this already exists somehow and I've missed it?

7 responses

View the backtest results, click on the menu icon in the upper right corner, and select "View Code".

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.

Sweet, thanks, I completely missed that the last two years.

Thanks, I didn't know that either :)

Thanks Jonathan,

I found the drop-down menu, and selected "View Code" and got a box with the code, labelled "Algorithm code for backtest 2". Excellent!

Presumably, if I do a "Live Trade Algorithm" or "Share Results" the relevant code will be used (and not the present working revision in the IDE).

Also, I gather that the only way to revert to a prior back-tested revision of the code would be to copy the code from the box into the IDE, where the current revision is always displayed? Or no?

What are the numbers in the browser? For example, if I navigate to a particular algorithm, I have:

https://www.quantopian.com/algorithms/54f43b5102974c68b80001fc

Then, if I view specific backtest results, I get:

https://www.quantopian.com/algorithms/54f43b5102974c68b80001fc/54f6dec85c62a20f2429bc45

And then if I go back to the IDE, I'm at:

https://www.quantopian.com/algorithms/54f43b5102974c68b80001fc/54f6dec85c62a20f2429bc45#algorithm

So, am I now looking at the code associated with the specific backtest, or is it always the latest working revision displayed in the IDE? And how do I over-write the latest revision?

Sorry, still kinda confused how this backtest/revisioning system works.

Grant

Grant, to answer your questions,

  • When you press "Live Trade Algorithm" or "Share Results", you will trade or share the code from the last run full backtest
  • To revert back to a previous version of the code, you can copy/paste from a snapshot from a previous full backtest. Version control is high on our radar and we're looking to implement a better mechanism
  • The numbers are a unique ID
  • The IDE displays the latest working revision of the code

Another tip while we're on this topic: from a live trading algorithm, you can jump back to the IDE of the algo. From the live algo dashboard, go to Settings > Source Algorithm > Go to Algorithm.

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.

It would be great that, under the hood, each backtest was a commit to a git repo, like you see in Heroku, and that power users can interact with it.

It would be great that, under the hood, each backtest was a commit to a git repo, like you see in Heroku, and that power users can interact with it.

thumbs up