Candlestick Pattern Identification Utilizing Machine Learning Models: A Comparative Analysis Using Historical Stock Data
摘要
Candlestick patterns have long been an essential tool in technical analysis. Identifying candlestick patterns is crucial to the technical analysis of any trading instrument as one receives information about the projected actions in the market. However, their manual identification is both subjective and time intensive. This study investigates the efficacy of machine learning models in identifying twelve distinct candlestick patterns—‘Dragonfly Doji’, ‘Gravestone Doji’, ‘Bearish Engulfing’, ‘Bullish Engulfing’, ‘Bullish Marubozu’, ‘Bearish Marubozu’, ‘Hammer’, ‘Hanging Man’, ‘Inverted Hammer’, ‘Bullish Harami Pattern’, ‘Bearish Harami Pattern’ and Shooting Star’—within historical stock market data listed in the Dhaka Stock Exchange (DSE). To achieve this, historical data from five companies Brac Bank, GPH Ispat, Grameenphone, Padma Oil and Square Pharma representing diverse sectors within the DSE30 index have been considered. Given the inherent class imbalance often present in financial pattern recognition, the Synthetic Minority Oversampling Technique (SMOTE) will be applied to balance the dataset and prevent model bias towards the majority class. The performance of four robust machine learning algorithms—XGBoost Classifier, Random Forest Classifier, ANN and LSTM—will be comparatively analyzed to determine their effectiveness in accurately detecting these patterns. Random Forest has achieved the highest accuracy of 91%. The findings of this research aim to provide insights into the applicability of advanced machine learning techniques for technical analysis in the Bangladeshi stock market, potentially aiding traders and investors in their decision-making processes.