The Science and Information (SAI) Organization publishes open-access peer-reviewed journals in computer science and artificial intelligence.

Contact Info
Website thesai.org
Follow Us
Contact Info
Follow Us
Research Article | Open Access |

K-Nearest Neighbors Algorithm for Short-to-Medium Term Directional Stock Price Forecasting: An Analysis of Thailand’s Banking Sector

Author 1: Passawan Noppakaew Author 2: Parit Wanitchatchawan Author 3: Kanchana Phuhoy Author 4: Natthasorn Seubwong
International Journal of Advanced Computer Science and Applications (IJACSA) · Vol. 17, No. 2 · Published 2026

DOI: https://doi.org/10.14569/IJACSA.2026.0170274

Abstract

This research explores the efficacy of a parsimonious K-Nearest Neighbors (KNN) framework for short-to-medium term stock direction forecasting, focusing specifically on the banking sector within Thailand’s SET50 index. Prior preliminary analysis, aimed at determining the optimal prediction horizon, indicated that a 60-day forecast yielded the most effective results, establishing the scope of this study as medium-term prediction. The objective of this analysis is to determine if a 60-day directional movement can be effectively captured using a minimalist feature set limited to the current day’s Opening Price and the previous day’s 14-day Simple and Exponential Moving Averages. Employing a rolling-window validation methodology on seven key banking stocks during H1 2025, the KNN model demon-strated significant predictive capability. The average accuracy across the selected banking stocks reached 82.0%, with standout performance for TISCO and SCB. While results varied across stocks, our findings substantiate the theoretical and practical sufficiency of a simplicity-first approach. The research demonstrates that in high-noise emerging markets, feature sparsity and instance-based logic serve as an essential defense against overfitting, providing institutional practitioners with a transparent and robust alternative to complex methodologies.

Keywords

How to Cite this Article

Passawan Noppakaew, Parit Wanitchatchawan, Kanchana Phuhoy and Natthasorn Seubwong. "K-Nearest Neighbors Algorithm for Short-to-Medium Term Directional Stock Price Forecasting: An Analysis of Thailand’s Banking Sector". International Journal of Advanced Computer Science and Applications (IJACSA), Vol. 17, No. 2, 2026. https://doi.org/10.14569/IJACSA.2026.0170274

BibTeX

@article{Noppakaew2026,
  title     = {K-Nearest Neighbors Algorithm for Short-to-Medium Term Directional Stock Price Forecasting: An Analysis of Thailand’s Banking Sector},
  journal   = {International Journal of Advanced Computer Science and Applications},
  volume    = {17},
  number    = {2},
  year      = {2026},
  publisher = {The Science and Information Organization},
  author    = {Passawan Noppakaew and Parit Wanitchatchawan and Kanchana Phuhoy and Natthasorn Seubwong},
  doi       = {10.14569/IJACSA.2026.0170274},
  url       = {https://doi.org/10.14569/IJACSA.2026.0170274}
}

Open Access — licensed under a Creative Commons Attribution 4.0 International License. Unrestricted use, distribution, and reproduction in any medium, even commercially, as long as the original work is properly cited.