Starting last week, I began playing around with the Twitter API. I wrote an article on using it to analyze the general public’s sentiment on Black Friday. Analyzing the sentiment on Black Friday was cool, but had no real practical value to it. Personally, I’m interested in stocks so I wondered to myself, can Twitter sentiment predict stocks? On Monday I tested that out with Starbucks. It showed that the Twitter sentiment of 100 tweets from each of Saturday, Sunday, and Monday morning before market open, averaged out to a slight positive and Starbucks went up on Monday.
To extend that experiment, I decided to take the Twitter sentiment of 100 recent tweets before market open each day of this week and see how that sentiment corresponded to the price change. I used the same code as I did in the article about analyzing Twitter sentiment about Starbucks on Monday of this week so I won’t cover the code, if you want to read the code so you can reproduce this, check out the article: Twitter Sentiment for Stocks? Starbucks 11/29/21. Let’s get right into the actual results and how they compare. Here’s a picture of the last week of Starbucks trading, taken from MSN.
Twitter Sentiment of Starbucks on Tuesday
The image below shows what the Twitter sentiment of Starbucks was on Tuesday, 11/30/2021. Remember that these were 100 Tweets taken before market open. We can see from the graph that Tuesday was a rather boring day for $SBUX. It dipped slightly, opening at 110.74 and closing at 109.70.
Twitter sentiment on Monday was slightly positive, but the stock price fell 0.9%. Despite the fact that market sentiment was high that morning, we don’t even see the price start with an uptick.
Twitter Sentiment of Starbucks on Wednesday
The image below shows what the Twitter sentiment of Starbucks was on Wednesday, 12/1/2021. Remember that these were 100 Tweets taken before market open. From the graph, we can see a clear hump on Wednesday morning. On Wednesday, Starbucks stock opened at 110.73, reached a high of 113.23, and closed at 109.31.
Twitter sentiment on Tuesday was even higher than that of Monday but stock price fell 1.3% (actually 1.29%). However, we did see a pretty big uptick in stock price that morning.
Twitter Sentiment of Starbucks on Thursday
The image below shows what the Twitter sentiment of Starbucks was on Wednesday, 12/2/2021. Remember that these were 100 Tweets taken before market open. Thursday saw a slight rise in the Starbucks share price, opening at 110.11 and closing at 111.36.
Twitter sentiment on Thursday was quite high early that morning. In fact, Thursday morning saw the highest sentiment for Starbucks on Twitter all week. This one seems to make the most sense as we see that $SBUX rose 1.1% on Thursday.
Twitter Sentiment of Starbucks on Friday
The image below shows what the Twitter sentiment of Starbucks was on Wednesday, 12/3/2021. Remember that these were 100 Tweets taken before market open. We can see from the graph that the Starbucks stock price took a small tumble before recovering slightly before market close today. It opened at 112.51 and closed at 111.04.
Friday (today) saw the lowest sentiment about Starbucks on Twitter of any day of the week. We also saw the price drop 1.3%, the highest daily drop all week.
The Effect of Twitter Sentiment on Starbucks Stock Week of 11/29/2021
Alright, now that we’ve looked at Twitter Sentiment on Starbucks for a whole week and seen the numbers, let’s talk about the effects. Remember from the last post that Monday had a sentiment of about 0.160 and a percent change of 0.1%. One thing we’ve learned from this week’s experiment (including Sunday’s and Saturday’s sentiments) is that people on Twitter generally lean positive towards Starbucks. There has yet to be a single day where the general public’s sentiment towards Starbucks has been negative on Twitter.
It seems that the sentiment hovering around 0.160 has little effect on the price, even though Wednesday showed us that a higher sentiment than that doesn’t necessarily mean the price will go up. The price did spike that morning though, and the sentiment was taken that morning. Perhaps we need to take another look in the middle of the day. Perhaps we need to check for $SBUX on Twitter instead of just Starbucks. Thursday showed us that a higher than usual sentiment does mean a stock price jump though. Friday showed us that a lower than usual sentiment means a drop in price as well. Or maybe that was only this week, we’ll have to check back in next week for more information.
In addition to this, I realized that I should standardize the time in the morning I check for these sentiments. I am now going to check at 8:00am Eastern Time every morning for these experiments going forward.
|Percent Change||Twitter Sentiment|
I run this site to help you and others like you find cool projects and practice software skills. If this is helpful for you and you enjoy your ad free site, please help fund this site by donating below! If you can’t donate right now, please think of us next time.