Back to Community
Pyfolio

I am new to Python and Quantopian. Please guide.

In the following link as instructed (https://www.quantopian.com/research/notebooks/Cloned%20from%20%22New%20Feature%3A%20Comprehensive%20Backtest%20Analysis%22.ipynb)

Get backtest object

bt = get_backtest('55db2def35e3b00d9986aa99')

Create all tear sheets

bt.create_full_tear_sheet()

What is 55db2def35e3b00d9986aa99'?
And where am I supposed to run this code ? In python command ?

Do I have to run this code also before running the above code ?
import pyfolio as pf

6 responses

Hi Pankaj,

That code is the ID of the backtest for which you would like to create a tearsheet. You can see how to get it here. This code is meant to be run in the research environment, exactly like the code in the link you copied! Check out this post for more details.

I hope this helps!

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 Jamie,
Thanks for the response. I am going through these links to learn the basics to use Quantopian
As suggested on the link to run Backtesting the algorithm is

***# Get backtest object
bt = get_backtest('56667f153446741fa7000630')

Create all tear sheets

bt.create_full_tear_sheet()***

The ID I am just testing for example is https://www.quantopian.com/algorithms/56667f153446741fa7000630

When I run the code on the Research Notebook here
NoSuchAlgorithm: Algorithm with id '56667f153446741fa7000630' was not found.

What's the wrong with my code and ID ? Please help.

Thanks,
Pankaj

Has to be from the FULL backtest page, the second id in address line. (The first will be the one above).

Hi garyha,

This page is not FULL backtest page ? Please look at this page https://www.quantopian.com/algorithms/56668f963d6fd43780000019 > I think it must be the FULL one. as I am able to run the backtest using RUN FULL Backtest key. But when I run the following code using,it says invalid syntax ? Please correct me.
# Get backtest object
bt = get_backtest(56668f963d6fd43780000019'')

Create all tear sheets
bt.create_full_tear_sheet()***

Right, from that page, click the blue button toward the upper right that says 'Run Full Backtest'. It is termed Full because it serves up more information, otherwise it is the same time-frame and execution of our code. It is more code on their end, at the server. Then in the address bar (once it is running) you'll have something that looks like
https://www.quantopian.com/algorithms/56668f963d6fd43780000019/5666a7d4124ef11148b6e701#backtest.

You'll need to disregard the '#backtest' part at the tail end of it, and copy just the second id before it and after the last slash. That's the id that will work. In this case it is 5666a7d4124ef11148b6e701

Got it now. Thanks . So , whats the difference between what is running after clicking RUN FULL BACKTEST and the code output ?

How to send my output as a file and take hard copy of the output notebook ?