Back to Community
get_backtest() fuction

You can find the ID of a backtest in the URL of its full results page, which will be of the form:

In notebooks/Tutorials and Documentations.. <----- doesnt work...

We can't find the page you requested: -----Errors...

4 responses

Hi John,

It's very difficult to understand your question, but I'll take a guess at the problem you are facing.

In the API Reference notebook, there is a section describing the get_backtest() method:

The get_backtest function provides programmatic access to the results of backtests run on the Quantopian platform. It takes a single parameter, the ID of a backtest for which results are desired.

You can find the ID of a backtest in the URL of its full results page, which will be of the form:<algorithm_id>/<backtest_id>.  

If you are saying here that the URL above in the last line of the excerpt doesn't work, you are correct. It will never work. That URL is explaining the structure of our URLs so you can find the backtest_id. Once you have the backtest_id you can use get_backtest() effectively.

The strings '' and '' used in the URL are placeholders. In reality each algorithm has a unique identifier.

Take one of my backtests. It has the URL:

In this case, my algorithm ID is 5522e99812b9a0e39f0003fa
my backtest ID is 5522ea0a6d85df0d2d007888

I hope I've correctly guessed the question you were asking. If I'm off base, just let me know and we'll try to help out further.


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.

how can i have the backtest_id ?? URL: --------- doesnt work either.... meaning dead link. if dats helps ;)

You are only entitled to view the backtests that either:

1) you have created
2) you are a collaborator on

Since I created that backtest above and you aren't a collaborator, you can't view that URL directly - nor will get_backtest() work on the backtest id.

You need to use your own backtests.

Navigate to one of your algorithms. Click on the "backtest" button on the top right.
If you have run a full backest, click on one of the backtests in the list (if you have any). The resulting URL will be of the form described above.

If you don't have any backtests in the list, you'll need to run a full backtest to get one.


Thanks josh... in your notes ev to ebita... Tobias Magic formula , Im trying to replecate... what you have done in your notes. since the backtest() didnt work and the notes are useless if the backtest function is not working... Im very puzzled.. on how to fix it or how to fix the bug ;)