Week 11 - The Last Mile
May 10, 2024
Hello everybody and welcome back to Week 11 of my Senior Project! This week, I finished running my datasets through my sentiment analysis model and started on the final part of my project. As I mentioned before, I could definitely see a big difference between the results from the larger companies versus Sharps Technologies. For the larger companies, the dataset had much variation, between “Positive”, “Negative”, and “Neutral.” However, since I was unable to find data pertaining to Sharps Technology for most days, the model didn’t have much input and by default assigned each day “Neutral”.
Now, I had three datasets per company: one with my ARIMA model’s forecasting stock market values, one with the real stock market prices, and one with the sentiment of the news per day. The last step in this project is to now connect them. This week, I also spent time developing a program that would determine whether or not the tone of the news can account for the differences between the trends of the forecasted stock market prices or the real ones. Essentially, it would figure out the percentage of times where the tone of the news articles was able to account for the difference between the direction that the forecasted stock was moving versus the real stock.
In order to do this, I first had to import all three datasets into the program. Then, I had to figure out the trend of the stock prices in the forecasted prices dataset and actual prices. To do this, I parsed through the datasets, and if the stock price went up that day, I assigned it a value of 1 and if it went down, then I assigned it a value of 0. I did this for both the forecasted values dataset and the actual values one. Then, I parsed through the sentiment analysis results and wrote the following conditional:
This conditional essentially says that if the sentiment result is negative, the forecasted stock price goes up but the actual price goes down, then return 1. Additionally, if the sentiment result is positive, the forecasted stock price goes down but the actual stock price goes up, then return 1. Otherwise, return 0. In this situation, the value 1 means the news has influenced the stock prices and 0 means it didn’t.
In the coming week, I hope to run all of my datasets through this program to figure out how much these news articles can explain for the difference in the predicted versus actual stock prices and finally answer the question I had at the beginning of this project: How does the underlying tone of news articles affect the trends of the stock market? The end is near, and I can’t wait to see the results of this project. Stay tuned for next week to see what happens!
Leave a Reply
You must be logged in to post a comment.