← Back to VOLUME 15, ISSUE 10, OCTOBER 2026
This work is licensed under a Creative Commons Attribution 4.0 International License.
Enhanced Sentiment-Based Stock Market Recommendation System Using Machine Learning
Sanapala Ramesh
π 9 viewsπ₯ 4 downloads
Abstract: Stock prices are influenced not only by historical price movement but also by public sentiment expressed through financial news. Retail investors usually consult charting platforms and news platforms separately, with no automated bridge between them. This project presents an implemented, Flask-based web application that combines quantitative technical analysis of stock prices with machine-learning based sentiment analysis of financial news to produce a transparent BUY, HOLD or SELL recommendation.
Historical price data is sourced from Yahoo Finance and used to calculate the 20-day moving average, the 14-period Relative Strength Index (RSI) and the Moving Average Convergence Divergence (MACD). Financial news is gathered from NewsAPI, cleaned with NLTK, and converted into TF-IDF and hand-crafted sentiment features. Three classifiers, namely Random Forest, Linear Support Vector Machine and Multinomial Naive Bayes, are trained, and the best is selected by test-set accuracy. Article-level predictions are aggregated into a daily Sentiment Index, which is combined with a price-trend score using the weighted formula 0.6 x Sentiment + 0.4 x Trend. An RSI-based safety filter prevents extreme-market signals from being followed blindly. All data and results are stored in SQLite and displayed on an interactive Chart.js dashboard.
The system was run on 411 stored news articles covering seven US and Indian stocks. On an 80/20 split, the Linear SVM achieved the highest test accuracy (100.00%), followed by Random Forest (98.80%) and Naive Bayes (79.52%), and was selected automatically. Because the sentiment labels are generated by a financial keyword lexicon rather than by human annotators, these metrics measure agreement with that labelling heuristic and not validated real-world sentiment accuracy. This limitation is noted explicitly throughout the report.
Keywords: stock market, sentiment analysis, technical indicators, RSI, MACD, TF-IDF, Random Forest, SVM, Naive Bayes, Flask.
Historical price data is sourced from Yahoo Finance and used to calculate the 20-day moving average, the 14-period Relative Strength Index (RSI) and the Moving Average Convergence Divergence (MACD). Financial news is gathered from NewsAPI, cleaned with NLTK, and converted into TF-IDF and hand-crafted sentiment features. Three classifiers, namely Random Forest, Linear Support Vector Machine and Multinomial Naive Bayes, are trained, and the best is selected by test-set accuracy. Article-level predictions are aggregated into a daily Sentiment Index, which is combined with a price-trend score using the weighted formula 0.6 x Sentiment + 0.4 x Trend. An RSI-based safety filter prevents extreme-market signals from being followed blindly. All data and results are stored in SQLite and displayed on an interactive Chart.js dashboard.
The system was run on 411 stored news articles covering seven US and Indian stocks. On an 80/20 split, the Linear SVM achieved the highest test accuracy (100.00%), followed by Random Forest (98.80%) and Naive Bayes (79.52%), and was selected automatically. Because the sentiment labels are generated by a financial keyword lexicon rather than by human annotators, these metrics measure agreement with that labelling heuristic and not validated real-world sentiment accuracy. This limitation is noted explicitly throughout the report.
Keywords: stock market, sentiment analysis, technical indicators, RSI, MACD, TF-IDF, Random Forest, SVM, Naive Bayes, Flask.
How to Cite:
[1] Sanapala Ramesh, βEnhanced Sentiment-Based Stock Market Recommendation System Using Machine Learning,β International Journal of Advanced Research in Computer and Communication Engineering (IJARCCE), DOI: 10.17148/IJARCCE.2026.151002
