Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
How to Recreate the CNN Fear and Greed Index

CNN's "Fear and Greed Index" is a popular metric for measuring the general mood of investors. As we saw in Gus's popular community post (https://www.quantopian.com/posts/using-the-cnn-fear-and-greed-index-as-a-trading-signal), use of the Fear and Greed index as a trading signal varies. Mean reversion strategies buy stocks when the crowd is afraid. Momentum strategies buy when the crowd is greedy.

Unfortunately, CNN doesn't release the raw data sources used in their Fear and Greed index. They also don't provide CSV of index values, let alone an API, that would allow the index to be easily used as a signal in an algorithm.

My hope is to eventually evaluate the Fear and Greed Index as a trading signal. However, I don't want to rely on the hacky scraping of a chart from CNN.com. I'd like to recreate the Fear and Greed Index with a combination of Quantopian's price data and easy to access external data sources.

While I feel like I am on the right track, many parts my NB could certainly be improved. I could use some help finding the best way to equally weight all the metrics and account for the components' past values (as CNN does). Right now I am using rolling z-scores with decay.

Any suggestions on the best way to test the predictive power of this index and its components in a regression or ML algo are welcome! I'll keep posting what I find.

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.

10 responses

Truly a glorious tech trek. Thank you for your considerable efforts.

But, in the words of Will Geer, from the movie Jeremiah Johnson (my second most favorite movie), "Were it worth the trouble?"

Not sure yet! Hopefully I can get some signal out of it. Right now I'm seeing testing the predictive power of the index when it is +/- two z-scores away from its 3 month mean. A SVM is next... Will update...

i truly don't think u shud be using this lol. Totally not trying to be rude but ur chasing a fairy. We don't even watch the news.....(Proff Equities Desk NYC) just trying to save u some time and effort.

Are you just trying to find the closest thing to CNN's index or are you trying to build the most predicative index of Fear and Greed possible?

I'm interested in cloning the "Fear & Greed" index. Any updates about that? Did you made some progress to share?

Are you still interested in mimicking the F&G index? I recently got an interest in it and would be happy to help and/or pick up where you left off

Have followed/tracked for some years. I use 8/16/32 period moving avg and find it quite accurate in identifying trend reversals.

Shall you share some code to get reversal signal?

no code. when the 2DMA crosses the 8, its a probable reversal. Crossing the 16 confirms. Crossing the 32 DMA typically is a longer term trend.

hi, would it be possible to reuppload this one so that I can clone the notebook?