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
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.pypulls headlines from Yahoo Finance’s public RSS feed viarequests+BeautifulSoup. If the feed is unreachable it falls back todata/sample_headlines.jsonso the pipeline always has data to run on.sentiment.pyscores each headline with NLTK’s VADER (built for short, informal text, with no training or GPU needed).correlate.pypulls daily close prices viayfinance, joins them with the daily average sentiment, and computes the Pearson correlation.main.pywires it together and saves a dual-axis sentiment-vs-price chart tooutput/.
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.
- Fork the repository.
- Create a feature branch:
git checkout -b feature/improvement. - Commit your changes:
git commit -m "feat: enhance functionality". - Push to the branch:
git push origin feature/improvement. - 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.