簡易檢索 / 詳目顯示

研究生: 王羿
YI WANG
論文名稱: 結合注意力機制與技術分析 之時間序列預測股價模型
Predicting Stock Price Using RNN and CNN with Technical Indicators
指導教授: 呂永和
Yung-Ho Leu
口試委員: 楊維寧
Wei-Ning Yang
陳雲岫
Yun-Shiow Chen
學位類別: 碩士
Master
系所名稱: 管理學院 - 資訊管理系
Department of Information Management
論文出版年: 2020
畢業學年度: 108
語文別: 英文
論文頁數: 44
中文關鍵詞: 卷積神經網路長短期記憶網絡注意力機制股票技術指標
外文關鍵詞: CNN, LSTM, Attention, Stock, Technical Indicators
相關次數: 點閱:233下載:0
分享至:
查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報
  • 在深度學習中,股票市場的預測並不是一個新穎的問題。將每日股票價格輸入模型是最基本的預測模型架構,但是單次輸入無法及時反映股票價格反轉現象。研究表明,預測的股價只會隨前幾天的股價波動。當實際股價觸底反彈並走高時,我們預測的股價將繼續下跌。這種現象導致對股票市場的預測無法有效地找到最準確的市場時機。
    為了解決這個問題,我們希望除了股票價格之外,還可以將股票價格的未來趨勢納入模型。技術分析是預測未來股價趨勢的策略。它研究過去金融市場的信息,並將它們組成圖表,以確定股票買賣的時間。因此,我們在模型中添加了多種股票技術指標,這些技術指標將被轉換成三個指標,分別是上升趨勢,下降趨勢和不變。借助卷積神經網絡(CNN),我們可以從技術指標中獲取趨勢,並將其與現有股價連接起來,以訓練我們的第二種模型來預測股價。
    眾所周知,股票價格具有時間序列特徵,即前幾天的股票價格對今天的股票價格有一定影響。儘管原始的長期短期記憶(LSTM)模型符合時間序列體系結構,但是隨著時間的流逝,許多天前的信息在預測瞬間中的影響已經很小。這種現象將無視多日前技術指標帶來的股價趨勢,因此我們將注意力輸入到LSTM模型中,然後讓該模型判斷數據對實現預測市場的重要性,實現準確的市場時機。


    The prediction of the stock market is not a novel issue in deep learning. Enter the daily stock price into the model is the most basic prediction model architecture, but a single input does not have a way to reflect the phenomenon of stock price reversal in time. Research shows that the predicted stock price will only fluctuate with the stock price of the previous few days. When the real stock price has bottomed out and turned higher, the stock price we predicted continues to fall. This phenomenon leads to the prediction of the stock market cannot effectively find the most accurate market timing.
    In order to solve this problem, we hope that in addition to the stock price, the future trend of the stock price can be put into the model. Technical analysis is a strategy for predicting future stock price trends. It studies the information of the past financial markets and organizes them into charts to determine the timing of buying and selling of stocks. Therefore, we add a variety of technical indicators of stocks to the model, and these technical indicators will be converted into three labels of upward tendency, downward tendency and unchanged. With the help of Convolutional Neural Network (CNN), we can get the trends of stock from the technical indicators, and concatenate them with existing stock prices to train our second model to predict stock prices.
    We all know that the stock price has a time series characteristic, that is to say, the stock price of the previous few days has some influence on today's stock price. Although the original Long Short-Term Memory (LSTM) model conforms to the time series architecture, in the process with the passing of time, the influence of information from many days ago in predicting the moment is already very small. This phenomenon will ignore the stock price trend brought by the technical indicators many days ago, so we imported the Attention into the LSTM model and let the model judge the importance of the data to achieve the prediction market. Achieve accurate market timing.

    ABSTRACT i ACKNOWLEDGEMENT ii TABLE OF CONTENTS iii LIST OF FIGURES v LIST OF TABLES vi Chapter 1 Introduction 1 1.1 Research Background 1 1.2 Research Motivation 1 1.3 Research Purpose 2 1.4 Research Overview 3 Chapter 2 Related Work 4 2.1 Technical Indicators 4 2.1.1 Stochastic Oscillator 4 2.1.2 Moving Average Convergence / Divergence 5 2.1.3 Bollinger Bands 7 2.1.4 Williams %R 8 2.2 Technical Analysis Signal 9 2.3 Convolutional Neural Network 11 2.4 Attention Long Short-Term Memory 12 Chapter 3 Research Method 14 3.1 Experiment Flow 14 3.2 Dataset Description 15 3.2.1 Taiwan Stock Market Dataset 15 3.2.2 Technical Indicators Dataset 15 3.2.3 Technical Indicators Dataset Preprocessing 15 3.3 CNN Training 16 3.4 Attention LSTM Training 17 3.5 Evaluation Metrix 21 3.5.1 Confusion Matrix 21 3.5.2 MAPE 22 3.5.3 Original Directional symmetry 22 3.5.4 Fine Tune Directional symmetry 22 Chapter 4 Experiment Results 24 4.1 Experimental Environment 24 4.2 CNN Parameters Setting 24 4.3 CNN Model Results 25 4.4 Attention LSTM Parameters Setting 26 4.5 Attention LSTM Model Results 28 Chapter 5 Conclusion and Future Research 30 5.1 Conclusion 30 5.2 Future Research 30 Reference 32

    [1] Wong, W. K., Manzur, M., & Chew, B. K. (2003). How rewarding is technical analysis? Evidence from Singapore stock market. Applied Financial Economics, 13(7), 543-551.
    [2] Friesen, G. C., Weller, P. A., & Dunham, L. M. (2009). Price trends and patterns in technical analysis: A theoretical and empirical examination. Journal of Banking & Finance, 33(6), 1089-1100.
    [3] Chong, T. T. L., Ng, W. K., & Liew, V. K. S. (2014). Revisiting the Performance of MACD and RSI Oscillators. Journal of risk and financial management, 7(1), 1-12.
    [4] Leung, J. M. J., & Chong, T. T. L. (2003). An empirical comparison of moving average envelopes and Bollinger Bands. Applied Economics Letters, 10(6), 339-341.
    [5] Fukushima, K., & Miyake, S. (1982). Neocognitron: A self-organizing neural network model for a mechanism of visual pattern recognition. In Competition and cooperation in neural nets (pp. 267-285). Springer, Berlin, Heidelberg.
    [6] Fukushima, K. (1988). Neocognitron: A hierarchical neural network capable of visual pattern recognition. Neural networks, 1(2), 119-130.
    [7] LeCun, Y., Boser, B., Denker, J. S., Henderson, D., Howard, R. E., Hubbard, W., & Jackel, L. D. (1989). Backpropagation applied to handwritten zip code recognition. Neural computation, 1(4), 541-551.
    [8] Ho, T. Y., Lam, P. M., & Leung, C. S. (2008). Parallelization of cellular neural networks on GPU. Pattern Recognition, 41(8), 2684-2692.
    [9] Agostinelli, F., Hoffman, M., Sadowski, P., & Baldi, P. (2014). Learning activation functions to improve deep neural networks. arXiv preprint arXiv:1412.6830.
    [10] Krizhevsky, A., Sutskever, I., & Hinton, G. E. (2012). Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems (pp. 1097-1105).
    [11] He, K., Zhang, X., Ren, S., & Sun, J. (2016). Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition (pp. 770-778).
    [12] Sutskever, I., Vinyals, O., & Le, Q. V. (2014). Sequence to sequence learning with neural networks. In Advances in neural information processing systems (pp. 3104-3112).
    [13] Koutnik, J., Greff, K., Gomez, F., & Schmidhuber, J. (2014). A clockwork rnn. arXiv preprint arXiv:1402.3511.
    [14] Hochreiter, S., & Schmidhuber, J. (1997). Long short-term memory. Neural computation, 9(8), 1735-1780.
    [15] Mnih, V., Heess, N., & Graves, A. (2014). Recurrent models of visual attention. In Advances in neural information processing systems (pp. 2204-2212).
    [16] Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., ... & Polosukhin, I. (2017). Attention is all you need. In Advances in neural information processing systems (pp. 5998-6008).
    [17] Zhang, H., Goodfellow, I., Metaxas, D., & Odena, A. (2019, May). Self-attention generative adversarial networks. In International Conference on Machine Learning (pp. 7354-7363).
    [18] Chen, K., Zhou, Y., & Dai, F. (2015, October). A LSTM-based method for stock returns prediction: A case study of China stock market. In 2015 IEEE international conference on big data (big data) (pp. 2823-2824). IEEE.
    [19] LeCun, Y. (2015). LeNet-5, convolutional neural networks. URL: http://yann. lecun. com/exdb/lenet, 20(5), 14.
    [20] Iandola, F. N., Han, S., Moskewicz, M. W., Ashraf, K., Dally, W. J., & Keutzer, K. (2016). SqueezeNet: AlexNet-level accuracy with 50x fewer parameters and< 0.5 MB model size. arXiv preprint arXiv:1602.07360.
    [21] Zhong, Z., Jin, L., & Xie, Z. (2015, August). High performance offline handwritten chinese character recognition using googlenet and directional feature maps. In 2015 13th International Conference on Document Analysis and Recognition (ICDAR) (pp. 846-850). IEEE.

    無法下載圖示 全文公開日期 2025/08/21 (校內網路)
    全文公開日期 本全文未授權公開 (校外網路)
    全文公開日期 本全文未授權公開 (國家圖書館:臺灣博碩士論文系統)
    QR CODE