Yes, the specific returns, along with a number of attributed returns, can easily be retrieved as a pandas dataframe from the backtest AlgorithmResult
object. There's documentation on this attributed_factor_returns
attribute in the docs (
https://www.quantopian.com/docs/api-reference/research-api-reference#quantopian.research.AlgorithmResult.attributed_factor_returns)
The first step is to get a reference to this object using the get_backtest
method. This returns a AlgorithmResult
object from which one can then reference the various attributes. For example, if one wanted a dataframe of the returns, something like this should work (make sure you use your own backtest ID) .
# replace with your backtest ID
my_backtest_id = '5dd3f9dc2c781c4bfeaae1b0'
bt = get_backtest(my_backtest_id)
attributed_returns = bt.attributed_factor_returns
specific_returns = attributed_returns.specific_returns
The above will fetch a dataframe with the attributed returns as columns. One of the columns is 'specific_returns'. The dataframe can be copied, manipulated, plotted, and analyzed as desired. There is a complete list of algorithm result attributes and methods in the docs (https://www.quantopian.com/docs/api-reference/research-api-reference#algorithm-results).
Hope that 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.