§ 瀏覽學位論文書目資料
  
系統識別號 U0002-2006202422510400
DOI 10.6846/tku202400291
論文名稱(中文) 利用差異化深度學習於股票漲跌預測
論文名稱(英文) Using differentiated deep learning to predict the stock trading strategy
第三語言論文名稱
校院名稱 淡江大學
系所名稱(中文) 資訊管理學系碩士班
系所名稱(英文) Department of Information Management
外國學位學校名稱
外國學位學院名稱
外國學位研究所名稱
學年度 112
學期 2
出版年 113
研究生(中文) 洪士淵
研究生(英文) Shih-Yuan Hung
學號 608630249
學位類別 碩士
語言別 繁體中文
第二語言別
口試日期 2024-06-01
論文頁數 48頁
口試委員 指導教授 - 張應華(yhchang@mail.tku.edu.tw)
口試委員 - 壽大衛
口試委員 - 陳有科
口試委員 - 張應華
關鍵字(中) 擇時
差異化
股票漲跌預測
深度學習
遺傳演算法
關鍵字(英) market timing
differentiation
stock price prediction
deep learning
genetic algorithm
第三語言關鍵字
學科別分類
中文摘要
   在金融市場中,股票價格預測一直是投資者和研究者關注的焦點。隨著深度學習技術的迅速發展,利用深度學習模型進行股票價格預測已經成為一種有效的方法。本研究旨在探索如何通過結合差異化深度學習技術和滑動窗口算法、遺傳演算法來提高股票價格預測的準確性,特別是針對台積電、鴻海及華碩三家公司的股票進行分析。

    我們針對歷史股票數據進行了全面的資料清洗,包括離群值處理、缺失值處理、每週差值計算和數據正規化。離群值處理採用了箱型圖和三倍標準差法來檢測和處理異常數據點;缺失值則通過線性插值和均值填補的方法來補全。此外,我們計算了每週的價格差值,以捕捉更長週期內的趨勢信息,並對數據進行了Min-Max正規化,消除不同特徵之間的資料差異,資料平滑化。

   在模型構建方面,我們結合了滑動窗口技術和遺傳演算法來優化LSTM模型。滑動窗口技術幫助我們將時間序列數據分割成固定長度的子序列,使模型能夠捕捉數據的時間依賴性。遺傳演算法則用於特徵篩選和時間窗口的優化,通過進化過程自動發現最優特徵組合和時間窗口大小,以提高模型的預測性能。

   實驗結果表明,經過資料清洗和特徵優化的LSTM模型在預測準確率和穩定性方面顯著優於基準模型。具體來說,經過優化後的模型在台積電、鴻海及華碩三家公司的股票預測中均顯示出更低的均方誤差(MSE)和更高的預測準確率,證實了滑動窗口技術和遺傳演算法的有效性。
   
   總結來說,本研究通過結合深度學習和進化計算技術,提出了一種高效的股票價格預測方法。實驗結果證實了該方法的有效性和優越性,為投資者在股票交易決策中提供了有力的技術支持。同時,本研究也為未來的股票價格預測研究提供了新的思路和方法。
英文摘要
   In the financial markets, stock price prediction has always been a focal point for investors and researchers. With the rapid development of deep learning technology, utilizing deep learning models for stock price prediction has become an effective approach. This study aims to explore how to enhance the accuracy of stock price prediction by combining differentiated deep learning techniques with sliding window algorithms and genetic algorithms, particularly by analyzing the stocks of TSMC, Foxconn, and ASUS.

   We performed comprehensive data cleaning on historical stock data, including outlier treatment, missing value handling, weekly difference calculation, and data normalization. Outlier treatment was conducted using box plots and the three-sigma rule to detect and handle abnormal data points. Missing values were filled using linear interpolation and mean imputation methods. Additionally, we calculated weekly price differences to capture trend information over longer periods and applied Min-Max normalization to the data to eliminate discrepancies between different features and smooth the data.

   In terms of model construction, we integrated sliding window techniques and genetic algorithms to optimize the LSTM model. The sliding window technique helped us segment time series data into fixed-length subsequences, enabling the model to capture temporal dependencies in the data. The genetic algorithm was used for feature selection and time window optimization, automatically discovering the optimal feature combinations and window sizes through an evolutionary process to enhance the model's predictive performance.

   Experimental results showed that the LSTM model, after data cleaning and feature optimization, significantly outperformed the baseline model in terms of prediction accuracy and stability. Specifically, the optimized model demonstrated lower mean squared error (MSE) and higher prediction accuracy in forecasting the price of TSMC, Foxconn, and ASUS, confirming the effectiveness of the sliding window technique and genetic algorithm.

   In conclusion, this study proposes an efficient stock price prediction method combining deep learning and evolutionary computation techniques. The experimental results validate the effectiveness and superiority of this method, providing strong technical support for investors in making stock trading decisions. Additionally, this study offers new perspectives and methodologies for future research in stock price prediction.
第三語言摘要
論文目次
目錄	iv
表目錄	vi
圖目錄	vii
公式目錄	viii
壹、 緒論	...1
第一節、 研究背景與動機	1
第二節、 研究目的	2
貳、文獻探討	3
第一節、 股票市場分析	3
一、 基本面分析	3
二、 籌碼面分析	3
三、 技術面分析	4
四、 投資面向比較	4
第二節、影響股價漲跌因素	5
第三節、投資研究分類	8
參、 研究材料與方法學	11
第一節、 研究樣本	11
第二節、 研究架構	12
第三節、 研究方法	13
一、 資料收集	13
二、 資料前處理	13
三、  移動視窗演算法	16
四、長短期記憶網路LSTM	16
五、 優化模型訓練方法	20
六、	基因演算法	21
肆、 實驗結果	25
第一節、 資料處理摘要	25
第二節、 離群值處理結果	25
第三節、 缺失值處理	26
第四節、 每週差值計算結果	27
第五節、 資料前處理總結	27
第六節、台積電研究結果	29
一、第一階段實驗	29
二、 第二階段實驗	32
第七節、華碩研究結果	33
一、第一階段實驗	33
二、 第二階段實驗	36
第八節、 鴻海研究結果	37
一、第一階段實驗	37
二、 第二階段實驗	40
伍、 結論與未來展望	41
第一節、 結論	41
第二節、討論與研究限制	42
一、	方法論的適用性與局限性	42
二、	模型性能與改進方向	42
三、 實際應用與未來研究	43
第三節、 總結	44
陸、參考文獻	45

表目錄
表 1 投資面向比較表	10
表 2 演化策略參數設定表	27

圖目錄
圖 1 Overfitting	15
圖 2 學習、偵測與決定流程	16
圖 3 長短期記憶架構圖	17
圖 4 Dropout前後之情形	20
圖 5 遺傳演算法編碼	21
圖 6 遺傳演算法輪盤法	22
圖 7 單點交替示意圖	23
圖 8 Mutation示意圖	24
圖 9 台積電資料每週差值計算結果	29
圖 10 台積電資料正規化結果	30
圖 11 台積電訓練次數即準確率	31
圖 12 台積電訓練次數及誤差率	31
圖 13 台積電模型驗證集預測表現	32
圖 14 華碩資料每週差值結果	33
圖 15 華碩資料正規化結果	34
圖 16 華碩訓練次數及準確率	35
圖 17 華碩訓練次數及誤差率	35
圖 18 華碩模型驗證集表現	36
圖 19 鴻海資料每週差值計算結果	37
圖 20 鴻海資料正規化結果	38
圖 21 鴻海訓練次數及準確率	39
圖 22 鴻海訓練次數及誤差率	39
圖 23 鴻海模型驗證及表現	40
 
公式目錄
式 1 遺忘門輸出值計算公式	24
式 2 輸入門輸出值計算公式	24
式 3 候選單元計算公式	24
式 4 新單元狀態計算公式	25
式 5 輸出門輸出值計算公式	25
式 6 隱藏狀態計算公式	25
參考文獻
中文文獻:
1.	林耀暄,模糊理論和基因演算法於股市買賣點決策及資金比例配置之研究,中華大學資訊工程學系碩士班碩士論文,2001年。
2.	陳柏年,應用遺傳演算法於財務指標選股策略之探討,國立中央大學資訊管理研究所碩士論文,2001年。
3.	蕭郁凱,遺傳演算法於股市資金分配策略應用上之研究,國立中央大學資訊管理研究所碩士論文,2001年。
4.	劉慧敏,多目標遺傳演算法於基本面選股策略之應用,國立中央大學資訊管理學系碩士論文,2002年。
5.	顏佳維,利用遺傳演算法發掘投資組合保險之調整策略,國立中央大學資訊管理學系碩士論文,2004年。
6.	陳與泳,組合式基金資金分配策略-蟻元合作系統與遺傳演算法之應用,國立台灣科技大學資訊管理學系碩士論文,2004年。
7.	蔡安燦,運用基因演算法以輔助股票市場投資人判斷進場時機之研究,國立台灣科技大學資訊管理學系碩士論文,2005年。
8.	陳振遠、張智堯、王蘭芬等,應用Ohlson 會計評價模型探究公司治理之價值攸關性—以台灣上市公司電子業為例,臺大管理論叢,第15卷,第2期,頁123-142,2005年。
9.	蔡建成,運用資料探勘技術進行選股決策,國立高雄科技大學商務經營研究所碩士論文,2007年。
10.	林玉萍,使用遺傳演算法建構不同風險承受度的基金投資組合與資產配置,國立中山大學資訊管理研究所碩士論文,2008年。
11.	林建財,遺傳演算法與擇時策略在投資組合建構之應用-以台灣中型100成份股為例,輔仁大學資訊管理學系在職專班碩士論文,2009年。
12.	蕭任淵,整合類神經網路與 Ohlson Model 以公司治理角度探索股市 擇時策略之研究,淡江大學資訊管理學系碩士論文,2013年。
13.	陳彬洲,基本面、籌碼面與總體面對股票報酬影響,亞洲大學財務金融學系在職專班碩士論文,2015年。
14.	段怡安,整合Ohlson 評價模型與Easton and Harris 報酬模型於股票交易決策實證研究,淡江大學資訊管理學系碩士班學位論文,2016年。
15.	陳振東、張羽欣、蘇子瑋、莊斯茜、詹茗淇,時間序列法與類神經網 路於股票漲跌預測比較之研究,管理資訊計算,2017年。
16.	沈沛瑄,以 LSTM 結合二次交易策略預測 ETF50 股價趨勢,國立台灣 大學工程科學與海洋工程學系,2020年。

英文文獻:
17.	Lev, B. and Thiagarajan, S. R. , "Fundamental Information Analysis " , Journal of Accounting Research Autumn,1993. 
18.	Chenoweth, T. , Obradovic, Z. , and Lee, S. S." Embedding Technical Analysis into Neural Network Based Trading System " , Applied Artificial Intelligence, Vol. 10, pp.523-541,1996. 
19.	Neely, C. J. , Weller, P. and Dittmar, R."Is Technical Analysis in the Foreign Exchange Market Profitable ? A Genetic Programming Approach " , Journal of Financial Quantitative Analysis,Vol. 32, 1997. 
20.	Shoaf, J. and Foster , J. A. ," The Efficient Set GA for Stock Portfolio " , in Proceedings of the 1998 IEEE International Conference on Evolutionary Computation (ICEC98), 1998, pp.354-359,1998.  
21.	Gold, S. and Lebowitz, P."Computerized Stock Screening Rules for Portfolio Selection ", Financial Service Review,1999.
22.	Kim, K. J. and Han, I. " Genetic algorithms approach to feature discretization in artificial neural networks for the prediction of stock price index ", Expert Systems with Applications 19, 2000. 
23.	Lazo, J. G., Vellasco, B. R., and Pacheco, A. C."A Hybrid Genetic-Neural System for Portfolio Selection and Management , Proceedings - Sixth International Conference on Engineering Applications of Neural Networks", Kingston Upon Thames,2000. 
24.	Xia, Y. , Liu, B. , Wang, S. and Lai, K. K., " A Model for Portfolio Selection with Order of Expected Returns " , Computer & Operations Research, pp.409-422,2000. 
25.	Orito, Y. and Yamazaki, G., " Index Fund Portfolio Selection by Using GA " , in Proceedings of the Fourth International Conference on Computational Intelligence and Multimedia Applications (ICCIMA),pp.118-122,2001. 
26.	Korczak, J. and Roger, P. "Stock timing using genetic algorithm ", Applied Stochastic Models in Business and Industry.18,2002. 
27.	Leigh, W., Purvis, R. and Ragusa, J. M. " Forecasting the NYSE composite index with technical analysis , pattern recognizer , neural network , and genetic algorithm : a case study in romantic decision support " ,Decision Support Systems 32 ,2002. 
28.	White, G.I., A.C. Sondhi and D. Fried, "The analysis and use of financial statement ", 3nd ed, John Wiley & Sons Inc, 2003. 
29.	Lam, M.,"Neural network techniques for financial performance prediction : integrating fundamental and technical analysis",Decision Support Systems 37 ,2004.
30.	Potvina, J. Y. , Sorianoa, P. and Vallee, M." Generating trading rules on the stock markets with genetic programming " , Computers & Operations Research 31, 2004. 
31.	Rafaely, B. and Bennell, J. A." Optimisation of FTSE100 tracker funds: Acomparison of genetic algorithms and quadratic , programming " , ManagerialFinance ; Vol.32, Issue6, 2006. 
32.	Chun, Q., John, C. S. and Tang " Foreign direct investment : A genetic algorithm approach" ,Socio-Economic Planning Sciences 40,pp.143-155,2006. 
33.	Lai, K. K., Yu, L., Wang, S. and Zhou, C."A Double-Stage Genetic Optimization Algorithm for Portfolio Selection" ,Lecture Notes in Computer Science, Vol.4234,pp.928-937,2006. 
34.	K. J. , Kim, T. Y. , Min, S. H. and Lee, H. Y."Portfolio algorithm based on portfolio beta using genetic algorithm ",Expert Systems with Applications 30,pp.52-534,2006.
35.	Kim, H. J. and Shin, K. S. " A hybrid approach based on neural networks and genetic algorithms for detecting temporal patterns in stock markets",Applied Soft Computing 7, 2007.
36.	Papadamou, S. and Stephanides, G. " Improving technical trading systems by using a new MATLAB-based genetic algorithm procedure " , Mathematical and Computer Modelling 46 , 2007. 
37.	Lin, C. C. and Liu, Y. T. " Genetic algorithms for portfolio selection problems with minimum transaction lots",European Journal of Operational Research 185 ,2008. 
38.	Chavarnakul, T. and Enke, D. " Intelligent technical analysis based equivolume charting for stocktrading using neural networks",Expert Systems with Applications34,pp.1004-1017,2008.
39.	Chen, J. S. and Lin, Y. T."A partitioned portfolio insurance strategy by a relational genetic algorithm " , Expert Systems with Applications 36,pp.2727-2734,2009. 
40.	Chang, T. J., Yang, S. C., and Chang, K.J."Portfolio optimization problems in different risk measures using genetic algorithm " , Expert Systems with Applications 36, pp.10529-10537, 2009. 
41.	Chen, Y. , Mabu, S. , Shimada, K. , and Hirasawa K. " A genetic network programming with learning approach for enhanced stock trading model ", Expert System. Appl.36(10) , pp. 12537-12546,2009. 
42.	Soleimani, H., Golmakani, H. R. and Salimi, M. H., " Markowitz-based portfolio selection with minimum transaction lots , cardinality constraints and regarding sector capitalization using genetic algorithm " , Expert Systems with Applications 36,pp.5058-5063,2009. 
43.	Erbo Zhao, Zhangang Han.(2010).Analyze Long & Mid-term Trends of Stock with Genetic Programming on Moving Average and Turning Points. IEEE.pp 87-91
44.	Tsai, T. J., Yang, C. B. and Peng, Y. H. , " Genetic algorithms for the investment of the mutual fund with global trend indicator ", Expert Systems with Applications 38,pp.1697-1701,2011. 
45.	Yeh, I. C., Lien, C. H. and Tsai, Y. C.,"Evaluation approach to stock trading system using evolutionary computation " , Expert Systems with Applications 38,pp.794-803,2011.
46.	Wei Bao, Jun Yue, Yulei Rao. " A Deep Learning Framework for Financial Time Series Using Stacked Autoencoders and Longshort Term Memory",PLoS ONE.pp 1-24,2017.
47.	Hyejung Chung, Kyung-shik Shin. "Genetic Algorithm-Optimized Long Short-Term Memory Network for Stock Market Prediction". Sustain- 30 ability.pp 1-18,2018. 
48.	DANG LIEN MINH (2018).Deep Learning Approach for Short-Term Stock Trends Prediction Based on Two-Stream Gated Recurrent Unit Network. IEEE Access.pp 55392-55404Sreelekshmy Selvin . "Stock Price Prediction Using LSTM ,RNN And CNN-Sliding Window Model".IEEE.pp 1643-1647 ,2018.
49.	Pragmatic Bookshelf (2019).Genetic Algorithms and Machine Learning for Programmers: Create AI Models and Evolve Solutions
論文全文使用權限
國家圖書館
同意無償授權國家圖書館,書目與全文電子檔於繳交授權書後, 於網際網路立即公開
校內
校內紙本論文立即公開
同意電子論文全文授權於全球公開
校內電子論文立即公開
校外
同意授權予資料庫廠商
校外電子論文立即公開

如有問題,歡迎洽詢!
圖書館數位資訊組 (02)2621-5656 轉 2487 或 來信