Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Q Data Exposures

Here is a little notebook I made the other day. I was curious to see what the risk exposures of my algo are to a few of the datasets available in the Quantopian data store, e.g. gold. Included is also a sector exposure graph using sector ETFs. I think that as more datasets are added, things like: oil, baltic dry index, sales of Ford F-150s ;) this could give you a good insight into what your algo is exposed too. Enjoy.

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.

6 responses

I'm unable to plot the data in a cloned notebook. pf.timeseries.rolling_beta returns a dataframe containing NaNs
It appears pf.timeseries is deprecated (https://github.com/quantopian/pyfolio/blob/master/pyfolio/timeseries.py)

qrisk has a beta() function that can be used instead (https://github.com/quantopian/qrisk/blob/master/qrisk/stats.py)

While those functions are deprecated in the latest version of pyfolio, the version of pyfolio on research still contains them, whats more those functions will still be available in pyfolio, what we are doing is consolidating the risk metrics code so it doesn't have to be duplicated between different packages.

Also I haven't been able to replicate the issue you are seeing, I'd throw in a few print statements to make sure the data is looking correct before it is passed into the functions.

Here's what I see: pf.timeseries.rolling_beta receives a series and dataframe with both containing floats, yet outputs a dataframe of NaNs

Are you sure you attached the intended notebook? The 4th cell contains the following code

start = "2005-01-01"\  
end = "2016-01-01"  

which produces a syntax error due to the backslash. I didn't think it worth mentioning at first, but if you didn't come across the error when you tried to replicate the above issue, it would be an indication that you were using a different notebook.

James, how does this relate to alphalens?

This doesn't. I just put this together one day for evaluating a full on strategy and thought I'd share it. Alphalens is for evaluating a single alpha factor.

I somehow missed this post. Thanks James for the great notebook!