簡易檢索 / 詳目顯示

研究生: 劉博宇
LIU, BO-YU
論文名稱: 技術型態辨識及其於股票趨勢預測之應用
Pattern recognition and its application for Stock price trend prediction
指導教授: 藍崑展
Lan, Kun-chan
學位類別: 碩士
Master
系所名稱: 電機資訊學院 - 資訊工程學系
Department of Computer Science and Information Engineering
論文出版年: 2026
畢業學年度: 114
語文別: 英文
論文頁數: 86
中文關鍵詞: 技術分析雙重底圖形型態辨識物件偵測多變量時間序列分類股票趨勢預測
外文關鍵詞: technical analysis, chart-pattern recognition, object detection, multivariate time series classification, stock trend prediction, double-bottom
相關次數: 點閱:3下載:0
分享至:
查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報
  • 技術分析常使用雙重底型態判斷股票價格是否可能反轉上漲。既有研究多著重於型態偵測或偵測後的平均報酬分析,較少進一步區分個別候選型態的可靠性,也可能忽略技術分析中常用來判斷突破是否可靠的資訊,例如量能配合與價格區間變化。
    本研究提出一個兩階段方法。第一階段使用 Two-Stage Deformable DETR 從股票走勢圖中偵測雙重底候選區域,並透過偽標籤生成擴大候選樣本規模。第二階段使用 ShapeFormer 對這些候選樣本進行後續結果分類。本研究比較三種輸入資料:僅使用收盤價、收盤價加成交量,以及完整的開盤價、最高價、最低價、收盤價與成交量,用來分析多變量市場資訊是否能提升分類效果。
    實驗結果顯示,在台灣上市與上櫃股票日線資料中,完整價格與成交量資訊取得最佳結果,Accuracy@0.5 為 63.06%,PR-AUC 為 67.49%,優於僅使用收盤價與 dummy baseline 的設定。結果說明偵測到的雙重底候選樣本之間存在模型可學習的後續結果差異,且多變量價格與成交量資訊對後續結果判斷具有輔助價值。

    Technical analysis often uses double-bottom patterns to judge whether stock prices may reverse upward. Existing studies mainly focus on pattern detection or average return analysis after detection. However, these studies rarely further distinguish the reliability of individual candidate patterns, and may ignore information commonly used in technical analysis to judge breakout reliability, such as volume confirmation and price-range behavior.
    This study proposes a two-stage method. In the first stage, Two-Stage Deformable DETR is used to detect candidate double-bottom regions from stock charts, and pseudo-label generation is used to expand the scale of candidate samples. In the second stage, ShapeFormer is used to classify these candidates into subsequent successful and failed outcomes. This study compares three input settings: closing price only, closing price with volume, and full open, high, low, close, and volume data, to analyze whether multivariate market information improves classification performance.
    Experimental results on daily data from Taiwan listed and OTC stocks show that the full price-and-volume setting achieves the best performance, with an Accuracy@0.5 of 63.06% and a PR-AUC of 67.49%, outperforming the closing-price-only setting and the dummy baseline. The results show that detected double-bottom candidates contain learnable differences in post-pattern outcomes, and that multivariate price and volume information provides auxiliary value for post-pattern outcome prediction.

    摘要 1 ABSTRACT 2 CONTENTS 3 LIST OF FIGURES 6 LIST OF TABLES 7 1. INTRODUCTION 9 1.1 Existing Methods for Stock Price Prediction 9 1.2 Why Use Chart Patterns for Stock Price Prediction and Their Limitations 9 1.3 Prior Pattern-Based Research and Its Limitations 10 1.4 Our Contributions 11 2. RELATED WORK 13 2.1 Existing Methods for Stock Price Prediction 13 2.2 Existing pattern-based methods for stock prediction 14 2.2.1 Why Two-Stage Deformable DETR for Candidate Generation 17 2.3 Existing Work on Time Series Classification 20 2.3.1 Why Multivariate Time Series Classification 20 2.3.2 Representative Time Series Classification Methods 21 2.3.3 Why ShapeFormer for Multivariate Time Series Classification 24 3. METHOD 26 3.1 Architecture 26 3.1.1 Double-Bottom Pattern Definition 26 3.1.2 Post-Pattern Outcome Definition 28 3.2 Detection-Based Candidate Generation 29 3.2.1 Detection Input Representation 30 3.2.2 Double-Bottom Detection Model 32 3.2.3 Pseudo-Label Generation by Detector Ensemble 34 3.3 Multivariate time series classification 36 3.3.1 Offline Shapelet Discovery 36 3.3.2 Class-Specific Transformer 38 3.3.3 Generic Transformer 40 4. Experiments and Results 42 4.1 Data collection 42 4.2 Data preprocessing 42 4.2.1 Detection Dataset Construction 42 4.2.2 Classification Dataset Construction 43 4.3 Performance metrics 44 4.3.1 Detection Metrics 44 4.3.2 Classification Metrics 45 4.4 Performance 46 4.4.1 Detection Performance 46 4.4.2 Classification Performance 47 4.5 Ablation Study 48 4.5.1 Effect of Pseudo-Labeled Data 49 4.5.2 Effect of Generic and Class-Specific Branches 50 4.5.3 Comparison with the SVP-T Baseline 52 5. Discussion 55 5.1 Why Multivariate Inputs Help 55 5.1.1 Analysis Hypothesis and Verification Design 55 5.1.2 Generic Transformer Attention Localization 56 5.1.3 Breakout-Day Confirmation Analysis 58 5.1.4 False Positive Analysis 60 5.1.5 Case Study 63 5.2 Candidate-Level Return Evaluation 64 5.2.1 Target-Stop Return Evaluation 64 5.2.2 Fixed-Horizon Benchmark-Adjusted Return Evaluation 66 5.2.3 Selected-versus-Rejected Candidate Analysis 68 5.3 Outcome Label Interpretation 71 6. Conclusion 73 7. Limitation and Future work 75 7.1 Limitations 75 7.2 Future Work 77 REFERENCE 80

    [1] O. Bustos and A. Pomares-Quimbaya, "Stock market movement forecast: A systematic review," Expert Systems with Applications, vol. 156, p. 113464, 2020.
    [2] R. C. Cavalcante, R. C. Brasileiro, V. L. Souza, J. P. Nobrega, and A. L. Oliveira, "Computational intelligence and financial markets: A survey and future directions," Expert Systems with Applications, vol. 55, pp. 194-211, 2016.
    [3] J. J. Murphy, Technical analysis of the financial markets: A comprehensive guide to trading methods and applications. Penguin, 1999.
    [4] A. W. Lo, H. Mamaysky, and J. Wang, "Foundations of technical analysis: Computational algorithms, statistical inference, and empirical implementation," The journal of finance, vol. 55, no. 4, pp. 1705-1765, 2000.
    [5] W. Leigh, C. J. Frohlich, S. Hornik, R. L. Purvis, and T. L. Roberts, "Trading with a stock chart heuristic," IEEE transactions on systems, man, and cybernetics-Part A: Systems and humans, vol. 38, no. 1, pp. 93-104, 2008.
    [6] G. Savin, P. Weller, and J. Zvingelis, "The predictive power of “head-and-shoulders” price patterns in the US stock market," Journal of Financial Econometrics, vol. 5, no. 2, pp. 243-265, 2007.
    [7] J.-L. Wang and S.-H. Chan, "Stock market trading rule discovery using pattern recognition and technical analysis," Expert Systems with Applications, vol. 33, no. 2, pp. 304-315, 2007.
    [8] C. D. Kirkpatrick II and J. R. Dahlquist, Technical analysis: the complete resource for financial market technicians. FT press, 2010.
    [9] C. H. Park and S. H. Irwin, "What do we know about the profitability of technical analysis?," Journal of Economic surveys, vol. 21, no. 4, pp. 786-826, 2007.
    [10] W. Brock, J. Lakonishok, and B. LeBaron, "Simple technical trading rules and the stochastic properties of stock returns," The Journal of finance, vol. 47, no. 5, pp. 1731-1764, 1992.
    [11] S. M. Mostafavi and A. R. Hooman, "Key technical indicators for stock market prediction," Machine Learning with Applications, vol. 20, p. 100631, 2025.
    [12] M. Saberironaghi, J. Ren, and A. Saberironaghi, "Stock market prediction using machine learning and deep learning techniques: A review," AppliedMath, vol. 5, no. 3, p. 76, 2025.
    [13] O. B. Sezer, M. U. Gudelek, and A. M. Ozbayoglu, "Financial time series forecasting with deep learning: A systematic literature review: 2005–2019," Applied soft computing, vol. 90, p. 106181, 2020.
    [14] W. Bao, J. Yue, and Y. Rao, "A deep learning framework for financial time series using stacked autoencoders and long-short term memory," PloS one, vol. 12, no. 7, p. e0180944, 2017.
    [15] D. T. Nguyen, B. Q. Tran, A. D. Tran, D. T. Than, and D. Q. Tran, "Object detection approach for stock chart patterns recognition in financial markets," in Proceedings of the 2023 12th International Conference on Software and Computer Applications, 2023, pp. 150-158.
    [16] M. Velay and F. Daniel, "Stock chart pattern recognition with deep learning," arXiv preprint arXiv:1808.00418, 2018.
    [17] R. Cervelló-Royo, F. Guijarro, and K. Michniuk, "Stock market trading rule based on pattern recognition and technical analysis: Forecasting the DJIA index with intraday data," Expert systems with Applications, vol. 42, no. 14, pp. 5963-5975, 2015.
    [18] J. Lobão, L. Pacheco, and A. Fernandes, "Trading rule discovery using technical analysis and a template matching technique for pattern recognition: Evidence from the Chinese stock market," International Studies of Economics, vol. 19, no. 2, pp. 168-185, 2024.
    [19] E. R. Mersal, K. M. Karaoğlan, and H. Kutucu, "Enhancing market trend prediction using convolutional neural networks on Japanese candlestick patterns," PeerJ Computer Science, vol. 11, p. e2719, 2025.
    [20] S. Ren, K. He, R. Girshick, and J. Sun, "Faster r-cnn: Towards real-time object detection with region proposal networks," Advances in neural information processing systems, vol. 28, 2015.
    [21] T.-Y. Lin, P. Dollár, R. Girshick, K. He, B. Hariharan, and S. Belongie, "Feature pyramid networks for object detection," in Proceedings of the IEEE conference on computer vision and pattern recognition, 2017, pp. 2117-2125.
    [22] N. Carion, F. Massa, G. Synnaeve, N. Usunier, A. Kirillov, and S. Zagoruyko, "End-to-end object detection with transformers," in European conference on computer vision, 2020: Springer, pp. 213-229.
    [23] X. Zhu, W. Su, L. Lu, B. Li, X. Wang, and J. Dai, "Deformable detr: Deformable transformers for end-to-end object detection," arXiv preprint arXiv:2010.04159, 2020.
    [24] H. Zhang et al., "Dino: Detr with improved denoising anchor boxes for end-to-end object detection," arXiv preprint arXiv:2203.03605, 2022.
    [25] A. Bagnall, J. Lines, A. Bostrom, J. Large, and E. Keogh, "The great time series classification bake off: a review and experimental evaluation of recent algorithmic advances," Data mining and knowledge discovery, vol. 31, no. 3, pp. 606-660, 2017.
    [26] J. Faouzi, "Time series classification: A review of algorithms and implementations," Time Series Analysis-Recent Advances, New Perspectives and Applications, p. 298, 2024.
    [27] A. P. Ruiz, M. Flynn, J. Large, M. Middlehurst, and A. Bagnall, "The great multivariate time series classification bake off: a review and experimental evaluation of recent algorithmic advances," Data mining and knowledge discovery, vol. 35, no. 2, pp. 401-449, 2021.
    [28] M. Shokoohi-Yekta, B. Hu, H. Jin, J. Wang, and E. Keogh, "Generalizing DTW to the multi-dimensional case requires an adaptive approach," Data mining and knowledge discovery, vol. 31, no. 1, pp. 1-31, 2017.
    [29] H. Deng, G. Runger, E. Tuv, and M. Vladimir, "A time series forest for classification and feature extraction," Information Sciences, vol. 239, pp. 142-153, 2013.
    [30] M. Flynn, J. Large, and T. Bagnall, "The contract random interval spectral ensemble (c-RISE): The effect of contracting a classifier on accuracy," in International Conference on Hybrid Artificial Intelligence Systems, 2019: Springer, pp. 381-392.
    [31] M. Middlehurst, J. Large, and A. Bagnall, "The canonical interval forest (CIF) classifier for time series classification," in 2020 IEEE international conference on big data (big data), 2020: IEEE, pp. 188-195.
    [32] M. Middlehurst, J. Large, M. Flynn, J. Lines, A. Bostrom, and A. Bagnall, "HIVE-COTE 2.0: a new meta ensemble for time series classification," Machine Learning, vol. 110, no. 11, pp. 3211-3243, 2021.
    [33] J. Lines, L. M. Davis, J. Hills, and A. Bagnall, "A shapelet transform for time series classification," in Proceedings of the 18th ACM SIGKDD international conference on Knowledge discovery and data mining, 2012, pp. 289-297.
    [34] J. Hills, J. Lines, E. Baranauskas, J. Mapp, and A. Bagnall, "Classification of time series by shapelet transformation," Data mining and knowledge discovery, vol. 28, no. 4, pp. 851-881, 2014.
    [35] I. Karlsson, P. Papapetrou, and H. Boström, "Generalized random shapelet forests," Data mining and knowledge discovery, vol. 30, no. 5, pp. 1053-1085, 2016.
    [36] A. Guillaume, C. Vrain, and W. Elloumi, "Random dilated shapelet transform: A new approach for time series shapelets," in International Conference on Pattern Recognition and Artificial Intelligence, 2022: Springer, pp. 653-664.
    [37] P. Schäfer, "The BOSS is concerned with time series classification in the presence of noise," Data Mining and Knowledge Discovery, vol. 29, no. 6, pp. 1505-1530, 2015.
    [38] P. Schäfer and U. Leser, "Fast and accurate time series classification with weasel," in Proceedings of the 2017 ACM on Conference on Information and Knowledge Management, 2017, pp. 637-646.
    [39] P. Schäfer and U. Leser, "Multivariate time series classification with WEASEL+ MUSE," arXiv preprint arXiv:1711.11343, 2017.
    [40] A. Dempster, F. Petitjean, and G. I. Webb, "ROCKET: exceptionally fast and accurate time series classification using random convolutional kernels," arXiv preprint arXiv:1910.13051, 2019.
    [41] A. Dempster, D. F. Schmidt, and G. I. Webb, "Minirocket: A very fast (almost) deterministic transform for time series classification," in Proceedings of the 27th ACM SIGKDD conference on knowledge discovery & data mining, 2021, pp. 248-257.
    [42] C. W. Tan, A. Dempster, C. Bergmeir, and G. I. Webb, "MultiRocket: multiple pooling operators and transformations for fast and effective time series classification: CW Tan," Data Mining and Knowledge Discovery, vol. 36, no. 5, pp. 1623-1646, 2022.
    [43] A. Dempster, D. F. Schmidt, and G. I. Webb, "Hydra: competing convolutional kernels for fast and accurate time series classification: A. Dempster et al," Data Mining and Knowledge Discovery, vol. 37, no. 5, pp. 1779-1805, 2023.
    [44] Z. Wang, W. Yan, and T. Oates, "Time series classification from scratch with deep neural networks: A strong baseline," in 2017 International joint conference on neural networks (IJCNN), 2017: IEEE, pp. 1578-1585.
    [45] Y. Zheng, Q. Liu, E. Chen, Y. Ge, and J. L. Zhao, "Time series classification using multi-channels deep convolutional neural networks," in International conference on web-age information management, 2014: Springer, pp. 298-310.
    [46] H. Ismail Fawaz et al., "Inceptiontime: Finding alexnet for time series classification," Data mining and knowledge discovery, vol. 34, no. 6, pp. 1936-1962, 2020.
    [47] S. Hochreiter and J. Schmidhuber, "Long short-term memory," Neural computation, vol. 9, no. 8, pp. 1735-1780, 1997.
    [48] K. Cho et al., "Learning phrase representations using RNN encoder–decoder for statistical machine translation," in Proceedings of the 2014 conference on empirical methods in natural language processing (EMNLP), 2014, pp. 1724-1734.
    [49] F. Karim, S. Majumdar, H. Darabi, and S. Harford, "Multivariate LSTM-FCNs for time series classification," Neural networks, vol. 116, pp. 237-245, 2019.
    [50] X. Zhang, Y. Gao, J. Lin, and C.-T. Lu, "Tapnet: Multivariate time series classification with attentional prototypical network," in Proceedings of the AAAI conference on artificial intelligence, 2020, vol. 34, no. 04, pp. 6845-6852.
    [51] J. Wang, C. Yang, X. Jiang, and J. Wu, "WHEN: A Wavelet-DTW hybrid attention network for heterogeneous time series analysis," in Proceedings of the 29th ACM SIGKDD conference on knowledge discovery and data mining, 2023, pp. 2361-2373.
    [52] G. Zerveas, S. Jayaraman, D. Patel, A. Bhamidipaty, and C. Eickhoff, "A transformer-based framework for multivariate time series representation learning," in Proceedings of the 27th ACM SIGKDD conference on knowledge discovery & data mining, 2021, pp. 2114-2124.
    [53] M. Liu et al., "Gated transformer networks for multivariate time series classification," arXiv preprint arXiv:2103.14438, 2021.
    [54] N. M. Foumani, C. W. Tan, G. I. Webb, and M. Salehi, "Improving position encoding of transformers for multivariate time series classification," arXiv preprint arXiv:2305.16642, 2023.
    [55] R. Zuo, G. Li, B. Choi, S. S. Bhowmick, D. N.-y. Mah, and G. L. Wong, "SVP-T: A shape-level variable-position transformer for multivariate time series classification," in Proceedings of the AAAI Conference on Artificial Intelligence, 2023, vol. 37, no. 9, pp. 11497-11505.
    [56] X.-M. Le, L. Luo, U. Aickelin, and M.-T. Tran, "Shapeformer: Shapelet transformer for multivariate time series classification," in Proceedings of the 30th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, 2024, pp. 1484-1494.
    [57] T. N. Bulkowski, Encyclopedia of chart patterns. John Wiley & Sons, 2021.
    [58] D.-H. Lee, "Pseudo-label: The simple and efficient semi-supervised learning method for deep neural networks," in Workshop on challenges in representation learning, ICML, 2013, vol. 3, no. 2: Atlanta, p. 896.
    [59] L. Ye and E. Keogh, "Time series shapelets: a new primitive for data mining," in Proceedings of the 15th ACM SIGKDD international conference on Knowledge discovery and data mining, 2009, pp. 947-956.

    QR CODE