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

Read full text
Authors: Passawan Noppakaew, Parit Wanitchatchawan, Kanchana Phuhoy, Natthasorn Seubwong
Cited by: 0

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.

Fields of Study & Subjects

Stock Market Forecasting Methods Forecasting Techniques and Applications Financial Markets and Investment Strategies

Publication details

Journal / source
International Journal of Advanced Computer Science and Applications
Volume
17
Issue
2
Publication date
1 January 2026
Language
EN