§ 瀏覽學位論文書目資料
系統識別號 U0002-0807202122595100
DOI 10.6846/TKU.2021.00206
論文名稱(中文) 利用彌因演算法建置技術指標為基礎的股票趨勢預測模型
論文名稱(英文) Using Memetic Algorithm for Constructing Stock Trend Prediction Model based on Technical indicators
第三語言論文名稱
校院名稱 淡江大學
系所名稱(中文) 資訊工程學系碩士在職專班
系所名稱(英文) Department of Computer Science and Information Engineering
外國學位學校名稱
外國學位學院名稱
外國學位研究所名稱
學年度 109
學期 2
出版年 110
研究生(中文) 陳柏庭
研究生(英文) Po-Ting Chen
學號 708410054
學位類別 碩士
語言別 繁體中文
第二語言別
口試日期 2021-06-25
論文頁數 60頁
口試委員 指導教授 - 黃心嘉(sjhwang@mail.tku.edu.tw)
共同指導教授 - 陳俊豪(chchen6814@gmail.com)
委員 - 陳洳瑾(jc.chen@nkust.edu.tw)
委員 - 林威成(linwc@nkust.edu.tw)
關鍵字(中) 基因演算法
彌因演算法
模擬退火演算法
交易策略
技術指標
關鍵字(英) genetic algorithm
memetic algorithm
simulated annealing algorithm
trading straregy
technical indicators
第三語言關鍵字
學科別分類
中文摘要
在股票市場,技術指標經常被使用來研判股價趨勢,但透過技術指標判斷股價趨勢必須具備長期且豐富的投資經驗,且技術指標的種類與用法不勝枚舉。常見的作法是使用單一技術指標產生交易策略與交易訊號進行股票買賣,因為單一技術指標通常都會有其使用限制,所以技術指標組合則進一步被用來產生交易訊號並達到風險規避之目的。然而,找出一組有效的技術指標組合,我們不僅需考慮使用哪些指標且需考量其的參數設定,換句話說,搜尋適合特定標的之技術指標組合是一件具挑戰的任務。故本論文提出一個方法,利用彌因演算法進行技術指標組合與指標參數的最佳化。首先,在染色體表示部份,每個技術指標與其參數分別使用一個位元與多個實數進行編碼,故一個染色體由位元字串與實數陣列表示。在區域搜尋部份,所提方法採用模擬退火演算法針對指標參數進行微調。每個染色體的適合度值則由其對應的交易策略所產生之報酬與風險來評估。經過演化,最佳適合度值之技術指標組合與其參數則提供給使用者進行投資規劃。實驗部份,透過三種不同趨勢進行驗證方法的有效性,包含:上漲、盤整與下跌趨勢。結果顯示所提方法不但可以在下跌趨勢規避風險,亦可在上漲與盤整趨勢有不錯的報酬。
英文摘要
In the stock market, technical indicators are often be used to identify stock price trends, but judging stock price trends through technical indicators must have long-term and lots of investment experiences and the types and uses of technical indicators to find stock trends are too numerous to enumerate. A common way is to use a technical indicator to form trading strategies and find trading signals for stock trading. Because using only a technical indicator usually has its limitations, a technical indicator portfolio is further used to generate trading signals and achieve risk aversion. However, to find an effective technical indicator portfolio, we should consider not only what indicators are used and their parameter setting. In other words, to search a technical indicator portfolio for a specific target is a challenging task. Therefore, this thesis proposes an approach to optimize the technical indicator portfolio and their parameters using the memetic algorithm. Firstly, in the chromosome representation, each technical indicator and its parameter are respectively encoded with a bit and real numbers. As a result, a chromosome is represented by a bit string and a real number array. In local searching, the simulated annealing algorithm is utilized to tune the parameters of indicators. The fitness value of a chromosome is evaluated by the return and risk generated by its corresponding trading strategy. After evolution, the technical indicator portfolio and their parameters with the highest fitness value are provided to users for investment planning. In the experiments, three real dataset with different trends are used to verify the effectiveness of the proposed approach, including uptrend, consolidation, and downtrend. The results show that the proposed approach can not only reach risk aversion in downtrends but also have good returns in uptrend and consolidation .
第三語言摘要
論文目次
第一章	緒論	1
1.1	研究背景	1
1.2	研究動機	2
1.3	研究目的	2
1.4	論文貢獻與閱讀指引	3
第二章	文獻探討與背景知識	4
2.1	技術分析相關研究	4
2.2	基因演算法	5
2.3	彌因演算法	6
第三章	研究方法	8
3.1	系統架構圖	8
3.2	資料預處理	9
3.2.1	股票相關資訊抓取	9
3.2.2	計算技術指標	9
3.2.3	標記買賣訊號	10
3.3	建立股票趨勢預測模型	11
3.3.1	流程方法	11
3.3.2	所提方法虛擬碼	18
3.3.3	流程範例	19
第四章	實驗分析與結果	25
4.1	實驗資料收集	25
4.2	實驗環境設定	31
4.3	實驗設計	31
4.4	不同走勢對所提方法的影響	32
4.4.1	上漲型態股票結果	32
4.4.2	盤整型態股票結果	35
4.4.3	下跌型態股票結果	37
4.5	與現有方法的比較	40
4.6	使用MA與GA的比較	46
4.7	不同走勢對所提方法的影響(二)	47
4.7.1	上漲型態股票結果	47
4.7.2	盤整型態股票結果	50
4.7.3	下跌型態股票結果	52
第五章 結論與改進	56
5.1	結論	56
5.2	改進與討論	57
5.3	未來工作計畫	57
參考文獻	58

圖目錄
圖1 基因演算法流程圖	6
圖2 所提方法流程圖	8
圖3 染色體編碼方式	12
圖4 選擇(菁英政策)	14
圖5 經過母(父)代染色體交配產生子代染色體	15
圖6 選取隨機個體中的某個基因並改變基因	15
圖7 區域搜尋找解方式	16
圖8 染色體編碼範例	20
圖9 使用技術指標參數報酬率比對(1)	22
圖10 使用技術指標參數報酬率比對(2)	23
圖11 實驗資料-2330台積電(上漲型態)	26
圖12 實驗資料-2492華新科(盤整型態)	27
圖13 實驗資料-2498宏達電(下跌型態)	28
圖14 台積電(2330)演化迭代過程	33
圖15 華新科(2492)演化迭代過程	35
圖16 宏達電(2498)演化迭代過程	38
圖17 台積電(2330)與Buy&Hold的評比結果	41
圖18 華新科(2492)與Buy&Hold的評比結果	42
圖19 宏達電(2498)與Buy&Hold的評比結果	43
圖20 台積電(2330)MA與GA的評比結果	44
圖21 華新科(2492)MA與GA的評比結果	45
圖22 宏達電(2498)MA與GA的評比結果	46
圖23 大亞(1609)演化迭代過程	48
圖24 友達(2409)演化迭代過程	50
圖25 永豐金(2890)演化迭代過程	53

表目錄
表1 抓取股價相關資訊	9
表2 計算所需之技術指標數值	10
表3 標記買賣訊號	10
表4 技術指標買賣訊號(預設參數)	12
表5 所提方法流程之虛擬碼	18
表6 染色體範例	20
表7 最佳染色體範例	24
表8 台積電(2330)股價相關資訊	25
表9 華新科(2492)股價相關資訊	26
表10 宏達電(2498)股價相關資訊	27
表11 台積電(2330)技術指標相關資訊	28
表12 華新科(2492)技術指標相關資訊	29
表13 宏達電(2498)技術指標相關資訊	29
表14 台積電(2330)買賣訊號	30
表15 華新科(2492)買賣訊號	30
表16 宏達電(2498)買賣訊號	30
表17 技術指標使用變數預設值	31
表18 實驗環境軟硬體工具清單	31
表19 台積電(2330)技術指標使用最佳變數	32
表20 台積電(2330)最佳技術指標組合	33
表21 台積電(2330)最佳投資組合	33
表22 台積電(2330)測試結果	34
表23 華新科(2492)技術指標使用最佳變數	35
表24 華新科(2492)最佳技術指標組合	36
表25 華新科(2492)最佳投資組合	36
表26 華新科(2492)測試結果	37
表27 宏達電(2498)技術指標使用最佳變數	37
表28 宏達電(2498)最佳技術指標組合	38
表29 宏達電(2498)最佳投資組合	39
表30 宏達電(2498)測試結果	39
表31 大亞(1609)技術指標使用最佳變數	47
表32 大亞(1609)最佳技術指標組合	48
表33 大亞(1609)最佳投資組合	49
表34 大亞(1609)測試結果	49
表35 友達(2409)技術指標使用最佳變數	50
表36 友達(2409)最佳技術指標組合	51
表37 友達(2409)最佳投資組合	51
表38 友達(2409)測試結果	52
表39 永豐金(2890)技術指標使用最佳變數	52
表40 永豐金(2890)最佳技術指標組合	53
表41 永豐金(2890)最佳投資組合	54
表42 永豐金(2890)測試結果	54
參考文獻
[1] Y. Alsubaie, K. E. Hindi and H. Alsalman, “Cost-Sensitive prediction of stock price direction: Selection of technical indicators, ” IEEE Access , Vol. 7, pp.146876 - 146892 October 2019.
[2] Y. Uygun, R. F. Oğuz, M. S. Aktaş and I. Aykurt, “On the use of technical analysis indicators for stock market price movement direction prediction, ” 2019 27th Signal Processing and Communications Applications Conference, 24-26 April 2019.
[3] G. S. Atsalakis, E. M. Dimitrakakis and C. D. Zopounidis, “Elliott wave theory and Neuro-Fuzzy systems, in stock market prediction: The WASP System,” Expert Systems with Applications, Vol. 38, No. 8, pp. 9196-9206, 2011.
[4] Y. Ni, M. Y. Day, P. Huang and S. R. Yu, “The profitability of Bollinger Bands: Evidence from the constituent stocks of Taiwan 50, ” Physica A: Statistical Mechanics and its Applications, Vol. 551, pp. 124144, 2020.
[5] M. Metghalchi, C. P. Chen and L. A. Hayes, “History of share prices and market efficiency of the Madrid general stock index, ” International Review of Financial Analysis, Vol. 40, pp.178-184, 2015.
[6] F. Ye, L. Zhang, D. Zhang, H. Fujita and Z. Gong, “A novel forecasting method based on multi-order fuzzy time series and technical analysis, ” Information Sciences, Vol. 367-368, pp.41-57, 2016.
[7] J. Wang, X. Shang, T. Guo, J.Zhou, S. Jia and C. Wang, “Optimal path planning based on hybrid Genetic-Cuckoo search algorithm, ” 2019 6th International Conference on Systems and Informatics (ICSAI), 2-4 February 2020.
[8] C. Tao, X. Wang, F. Gao and M. Wang, “Fault diagnosis of photovoltaic array based on deep belief network optimized by genetic algorithm, ” Chinese Journal of Electrical Engineering, vol.6, pp.106 - 114 October 2020.
[9] C. H. Chen, C. Y. Lu, T. P. Hong, J. C. W. Lin and M. Gaeta, “An effective approach for the diverse group stock portfolio optimization usinggrouping genetic algorithm, ” IEEE Access, vol.7, pp.155871 - 155884 October 2019.
[10] The selfish gene, Richard Dawkins, England, 1976
[11] X. Chen, P. Zhang, G. Du and Fang Li, “Ant colony optimization based memetic algorithm to solve Bi-Objective multiple traveling salesmen problem for Multi-Robot systems, ” IEEE Access, vol.6, pp.21745 - 21757 April 2018.
[12] T. Y. Yu and H. T. Haung, “Coupling a memetic algorithm to simulation models for promising multi-period asset allocations, ” Computers & Operations Research, vol.40, pp.2585-2597 October 2013
[13] L. Y. Wei, “A GA-weighted ANFIS model based on multiple stock market volatility causality for TAIEX forecasting, ” Applied Soft Computing, Vol. 13, pp.911 - 920, 2013.
[14] N. Ulku and E. Prodan, “Drivers of technical trend-following rules' profitability in world stock markets, ” International Review of Financial Analysis, Vol. 30, pp.214-229, 2013.
[15] L. X. Wang, “Dynamical models of stock prices based on technical trading rules Part I: The models, ” IEEE Access, Vol. 23, pp.787 - 801, 2015.  
[16] L. X. Wang, “Dynamical models of stock prices based on technical trading rules---Part II: Analysis of the model, ” IEEE Access, Vol. 23, pp.1127 - 1141, 2015.  
[17] Q. Huang, J, Yang, X. Feng, A. W. C. Liew and X. Li, “Automated trading point forecasting based on bicluster mining and fuzzy inference, ” IEEE Transactions on Fuzzy Systems, Vol. 28, pp.259 - 272, 2019.
[18] C. H. Chen and P. Shih, “A stock trend prediction approach based on Chinese news and technical indicator ssing genetic algorithms, ”  2019 IEEE Congress on Evolutionary Computation, 10-13 June 2019.
[19] C. M. Wu , S. C. Chou and H. T. Liaw , “Using genetic algorithm to construct investment decision system based on stock trend, ” Journal of Computer Science and Application, Vol.8 No.1, pp.71-88 June 2013.
[20] A. W. Li and G. S. Bastos, “Stock market forecasting using deep learning and technical analysis: A systematic review, ” IEEE Access, Vol. 8, pp.185232 - 185242, 2020.
論文全文使用權限
校內
校內紙本論文延後至2026-06-25公開
同意電子論文全文授權校園內公開
校內電子論文延後至2026-06-25公開
校內書目立即公開
校外
同意授權
校外電子論文延後至2026-06-25公開

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