Generating a Trading Strategy Using Candlestick Patterns with Machine Learning

This study examines the application of machine learning (ML) algorithms for multi-day stock price prediction on the Nigerian Stock Exchange (NSE) from 2013 to 2023, to inform trading strategies. Utilizing candlestick patterns and technical indicators, including Simple Moving Average (SMA), Exponential Moving Average (EMA), and Volume Rate of Change (VROC), as input features, the models were trained to capture historical price dynamics. Among the evaluated algorithms, Ridge Regression demonstrated superior performance, achieving a Mean Absolute Error (MAE) of 0.0366 over a three-day forecasting horizon, while effectively mitigating overfitting and handling market volatility. In contrast, Decision Tree, Lasso, Support Vector Regressor (SVR), and K-Nearest Neighbors (KNN) models exhibited limitations due to sensitivity to data noise and overfitting. A recursive multi-step forecasting approach further enhanced prediction accuracy by incorporating temporal dependencies. However, backtesting revealed that predictive accuracy alone did not guarantee profitable trading outcomes, emphasizing the need to integrate market conditions, risk management, and strategy design. The findings underscore the importance of robust feature engineering and data preprocessing in financial ML applications. While Ridge Regression shows promise for stock price forecasting, successful trading strategies require a holistic framework that accounts for broader market factors. Future research should explore hybrid modeling techniques and additional exogenous variables to improve robustness.

Authors

Publication Details

Journal
International Journal of Advanced Computer Science and Applications
Published
2025-01-01
DOI
https://doi.org/10.14569/ijacsa.2025.0160931
Primary Topic
Big Data and Business Intelligence
Type
article
Field-Weighted Citation Impact
0.00

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Generating a Trading Strategy Using Candlestick Patterns with Machine Learning

Yonis Gulzar, Badamasi Imam Ya’u, Mohannad Alkanan, Fatima Umar Zambuk et al.
International Journal of Advanced Computer Science and Applications
Big Data and Business Intelligence
article

Generating a Trading Strategy Using Candlestick Patterns with Machine Learning

Yonis Gulzar, Badamasi Imam Ya’u, Mohannad Alkanan, Fatima Umar Zambuk, Mohammad Shuaib Mir, Osman Elwasila, Hussaina Bala Malami, Mohammed Nasir Danmalam Bawa
article en

Abstract

This study examines the application of machine learning (ML) algorithms for multi-day stock price prediction on the Nigerian Stock Exchange (NSE) from 2013 to 2023, to inform trading strategies. Utilizing candlestick patterns and technical indicators, including Simple Moving Average (SMA), Exponential Moving Average (EMA), and Volume Rate of Change (VROC), as input features, the models were trained to capture historical price dynamics. Among the evaluated algorithms, Ridge Regression demonstrated superior performance, achieving a Mean Absolute Error (MAE) of 0.0366 over a three-day forecasting horizon, while effectively mitigating overfitting and handling market volatility. In contrast, Decision Tree, Lasso, Support Vector Regressor (SVR), and K-Nearest Neighbors (KNN) models exhibited limitations due to sensitivity to data noise and overfitting. A recursive multi-step forecasting approach further enhanced prediction accuracy by incorporating temporal dependencies. However, backtesting revealed that predictive accuracy alone did not guarantee profitable trading outcomes, emphasizing the need to integrate market conditions, risk management, and strategy design. The findings underscore the importance of robust feature engineering and data preprocessing in financial ML applications. While Ridge Regression shows promise for stock price forecasting, successful trading strategies require a holistic framework that accounts for broader market factors. Future research should explore hybrid modeling techniques and additional exogenous variables to improve robustness.

International Journal of Advanced Computer Science and ApplicationsVol. 16(9)
King Faisal University
Openalex Percentile: Top 55%
Big Data and Business Intelligence
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Generating a Trading Strategy Using Candlestick Patterns with Machine Learning — Yonis Gulzar, Badamasi Imam Ya’u, et al. · International Journal of Advanced Computer Science and Applications (2025) | TGRS Research Map | TGRS