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
- Yonis Gulzar (ORCID: https://orcid.org/0000-0002-6515-1569)
- Badamasi Imam Ya’u (ORCID: https://orcid.org/0000-0002-2710-8973)
- Mohannad Alkanan (ORCID: https://orcid.org/0000-0003-3736-7749)
- Fatima Umar Zambuk (ORCID: https://orcid.org/0000-0003-4276-4490)
- Mohammad Shuaib Mir (ORCID: https://orcid.org/0009-0008-3212-5111)
- Osman Elwasila
- Hussaina Bala Malami
- Mohammed Nasir Danmalam Bawa
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
- King Faisal University