1. Work
  2. Market News Sentiment and Stock Correlation Tracker
  3. Docs

Market News Sentiment and Stock Correlation Tracker

Scrapes financial headlines for a ticker, scores sentiment with VADER and correlates it with price.

2 min read

Source on GitHub

Scrapes daily financial headlines for a ticker, scores their sentiment, and correlates the sentiment with the stock’s price movement.

How it works

  • scrape_news.py pulls headlines from Yahoo Finance’s public RSS feed via requests + BeautifulSoup. If the feed is unreachable it falls back to data/sample_headlines.json so the pipeline always has data to run on.
  • sentiment.py scores each headline with NLTK’s VADER (built for short, informal text, with no training or GPU needed).
  • correlate.py pulls daily close prices via yfinance, joins them with the daily average sentiment, and computes the Pearson correlation.
  • main.py wires it together and saves a dual-axis sentiment-vs-price chart to output/.

Run it

pip install -r requirements.txt
python main.py AAPL
python test_sentiment.py   # smoke test for the VADER scoring

Not included: Reddit scraping and a scheduler. The pipeline is ticker-parameterized, so a cron job (0 7 * * * python main.py AAPL) covers “daily” without adding a scheduling library. If you need Reddit chatter, add a PRAW-based source in scrape_news.py.

Support

Submit issues, questions, or bug reports to the GitHub issue tracker: https://github.com/ADM1SH/market-sentiment-stock-tracker/issues

Roadmap

  • Done: Core architecture and baseline implementation.
  • Done: Functional verification and test coverage.
  • To do: Add FinBERT sentiment model alternative
  • To do: Integrate SEC EDGAR 10-K filing sentiment scoring

Contributing

Contributions are welcome.

  1. Fork the repository.
  2. Create a feature branch: git checkout -b feature/improvement.
  3. Commit your changes: git commit -m "feat: enhance functionality".
  4. Push to the branch: git push origin feature/improvement.
  5. Open a Pull Request.

Authors and Acknowledgment

  • Adam Anwar (ADM1SH) - Lead architect and developer.
  • Built by Adam Anwar for quantitative sentiment correlation analysis.

License

Licensed under the MIT License. See LICENSE for details.

Project Status

Operational financial intelligence pipeline.

Back to top