Tech Or Treat: The Sentimental Stock Saga

INFO 523 - Fall 2023 - Project Final

Team Feature Finders Club - Eshaan Mathakari, Sanjay Bhargav Siddi, Likith Kumar Dundigalla, Aravind shrenivas Murali, Vamsi Vadala

Objective

  • Analyze sentiment in news headlines about Apple Inc. stock to assess public perception.

  • Explore correlation between sentiment analysis results and Apple’s stock performance for investor insights.

Question

  • How does sentiment analysis of news headlines provide insights into Apple Inc.’s stock price movements, revealing the influence of external factors on its market performance?

  • What valuable insights can be derived from correlating sentiment analysis of news headlines with Apple’s stock behavior, elucidating the impact of external factors on the broader market context?

Motivation

  • Uncover potential correlations between public perception, external factors on Apple Inc.’s stock performance

  • Understanding how sentiment influences market movements

Workflow

  1. Package Integration

  2. Data Acquisition

  3. Data Refinement

  4. Sentiment Analysis

  5. Plotted results and Interpretation

Apple Inc. Stock Price Data

The data is retrived from Yahoo-Finance python library in real-time.

Apple Inc. News Headlines Data

NewsAPI url- > https://newsapi.org/

Constructed API for data retrieval-> news_url = f”https://newsapi.org/v2/everything?q={stock_symbol}&apiKey={api_key}&from={from_date}&to={to_date}&language=en”

Apple News Headlines - WordCloud

vaderSentiment

VADER (Valence Aware Dictionary and sEntiment Reasoner)- is a rule-based sentiment analysis tool designed to assess the sentiment of text. It performs several operations to as piece of text:

- Tokenization- breaks input into words.

- Sentiment Intensity Scoring- sentiment intensity scores to individual words.

- Punctuation Emphasis - effect of punctuation in modifying the intensity of sentiment (e.g., “AMAZING!!!” might have higher intensity than “amazing”).

- Negation Handling - effect of negation words (like “not” or “don’t”) on reversing the polarity.

- Emoticon and Capitalization Awareness - Recognizes and interprets emoticons.

- Sentiment Score Calculation - Aggregates the individual word scores to generate an overall sentiment score for the entire text. The scores typically include positive, negative, neutral, and a compound score

Apple News Headlines - Sentiment Analysis

Competitors vs Apple

Correlation = -0.15

External Factors vs Apple

Correlation = 0.45

Conclusion

- Acquired data from yfinance and headlines from NewsAPI

- Explored intersection of finance and sentiment analysis focused on Apple stock using vaderSentiment in Python.

- Plotted sentiment scores against Apple’s stock price, visually highlighting the potential correlations between sentiments shifts and market trends.

Challenges faced

- Limitations of newsapi.org API to fetch real time news but this platform only lets us fetch data for the past 29 days which would stop us from training the model on a wider timescale.Another limitation of this API is that the API was limited to 100 pulls in 24 hours.

- For the past few months, market sentiment has stayed overtly positive which doesn’t help us in training the model well to fit in the Bear Market Scenario.

- Stock Market Analysis is a wide spectrum and all Investments should be done with caution. This is just a educational project to show the correlation between market sentiment and the stock price. Other factors such as Dollar Index, , external factors such as trading restrictions on products around the globe and the undergoing wars between different nations. DO NOT take the outcome of this project as financial advice. Please be careful before making any investments.

- Thank you for joining me on this exploration of sentiments in the world of Apple stocks.