Sentdex Sentiment Analysis, how far it has come, and where it's going.

Posted June 21 2015 by Harrison Kinsley

Sentdex has come quite a way since inception in my college apartment back in 2011. The original purpose of Sentdex was to gauge sentiment analysis for a handful of companies. After a short stint as a trader myself, I began to see patterns in news reports that corresponded to price. My opinion was that it was quite simple to gauge short term sentiment as a human and to keep track of it for a wide range of companies, but the longer term trends of sentiment were very difficult to gauge even for just one company. I felt like computers could be the answer to this task.

At the time, I had no idea how to program, much less how to do natural language processing. After a year of work on the initial algorithm and learning to program, I ran my first bit of analysis on Apple.

I didn't have much to go off of, but my intial results gave me:

This was my first company to try, and was only after a very short period of sentiment, with the sentiment analysis on the left, and the stock price on the right.

My plans were more for long-term sentiment having an impact, but I immediately saw what looked like a very close pattern of sentiment and price, with sentiment leading the way in even the very short term.

Excited, and curious if these results could be replicated with more companies and on a longer time frame, I continued tracking data with Apple and began adding more companies for the algorithm to analyze.

Walmart Sentiment Analysis ($WMT) (top) compared to stock price (bottom):

Bank of America ($BAC) Sentiment Analysis (top) compared to stock price (bottom):

As more and more companies were added, it became clear that sentiment could be an extremely useful indication of where stock prices were headed. I also began to see evidence that my initial thoughts were possibly correct, in thinking that sentiment could be used not only for price movements, but also magnitude of movements could be predicted. Seeing that this was the case, it solidified my original thoughts that sentiment's possibly most powerful element might actually be for tracking longer term trends, and then possibly to be used for trading changes in the trends.

It became obvious, however, that I needed to place these graphs on the same charts. Up until now, I had been graphing my stock sentiment, and then grabbing a price chart for comparison. I needed the charts to at least line up.

From here, the first version of the Sentdex website was born, and more companies were added. In short order, the S&P 500 was being tracked.

I then began to add political sentiment analysis on a handful of topics, and some politicians, then got the idea that one could also track geographical sentiment by using something like Twitter.

As Sentdex grew, so did my programming abilities, and I began also sharing my knowledge on my YouTube channel as well as, and this enterprise has also been very rewarding. After some time, I got the idea to completely re-write, which had been a WordPress site up to that point. After re-writing, things have improved quite a bit. New stock charts have price, sentiment, and sentiment volume data:

There's also a Sentdex API, which can provide access to sentiment data, as well as sentiment signals for trading.

Sentiment signals are signals that people can use to directly trade sentiment with stocks. The sentiment signals are based on an algorithm that works purely with sentiment data, so people can either use them alone, or incorporate the sentiment signals with a more complex strategy.

The sentiment signals have been back-tested on a third party back-tester (Quantopian / Zipline), and, so far, have done quite well. For example, a strategy that buys and sells based on sentiment signals alone returned:

An algorithm that also incorporated shorting in some circumstances yielded and even more impressed 156.4% return compared to the market's 52.6%.

We're still tracking Geographical Sentiment Analysis,

...and will soon be adding the ability for users to search for key words to find global sentiment and surrounding related topics.

Finally, Political data also got quite the revamp:

We now include a simple recent sentiment indication, as well as related terms and sentiment for their terms. Also, if you click on those terms, you can see the news sources where they come from. While still having a lot of work to do in this area, I believe this is a major step forward, and similar updates are being done for stocks to have similar additions.

Along with these political updates, Sentdex also began tracking more than 500 politicians, mostly members of congress, which you can find under politician analysis.

Here's an example for Hillary Clinton:

Moving forward, the goal for Sentdex is to be a generalized sentiment search engine, with a homepage more like:

...where the results contain the current sentiment, the geographic sentiment, and related keywords, like what is done with politics.

Sentdex has made a lot of very exciting progress, and there is a lot more to come! Stay tuned.