基于SVM-KNN的股票价格预测
Stock Price Forecast Based on SVM-KNN
摘要: 本文利用支持向量机(Support Vector Machine, SVM)和K近邻(K-Nearest Neighbor, KNN)结合的算法研究股票价格的预测问题。选取反映股票变化的交易数据及其技术指标,包括成交量、收盘价、最高价、移动平均(MA)等,对上证综指进行涨跌趋势及收盘价格指数的预测。首先利用SVM对训练集进行预测,预测涨跌趋势,其次KNN对股票短期(1天),中期(7天)和长期(30天)的价格进行预测,由此形成基于交易数据和技术指标的预测模型。最后得出此模型的综合平均相对误差(MAPE)和均方根误差(RMSE)。为了验证模型的有效性,根据模型预测结果构建新的投资策略,并利用真实数据进行投资,对大盘股指进行为期一个月的模拟投资。
Abstract: In this paper, the support vector machine (SVM) and K-nearest neighbor (KNN) algorithm were used to study the stock price forecasting problem, select the transaction data reflecting the stock changes and its technical indicators, including volume, closing price, highest price, moving average (MA), etc., forecasting the ups and downs and the closing price of the Shanghai Composite Index. Firstly, the SVM was used to predict the training set’s ups and downs. Then the training set used KNN to predict the short-term (1 day), medium-term (7 days) and long-term (30 days) prices of the stock, thus forming a forecast model based on transaction data and technical indicators. Finally, the MAPE and RMSE of this model were obtained. In order to verify the validity of the model, a new investment strategy was constructed based on the model prediction results, and the real data was used for investment, and the large-cap stock index was subjected to a one-month simulation investment.
文章引用:张佩琪, 刘海军, 裴冬晓, 王喜月. 基于SVM-KNN的股票价格预测[J]. 统计学与应用, 2019, 8(6): 859-871. https://doi.org/10.12677/SA.2019.86097

参考文献

[1] Abdoh, T.H. and Jouhare, H. (1996) The Investigation of Efficiency of Stock Price Index of TSE. Journal of Financial Research, 13, 11-12.
[2] Chang, P.C., Liu, C.H., Lin, J.L., et al. (2009) A Neural Network with a Case Based Dynamic Window for Stock Trading Prediction. Expert Systems with Applications, 36, 6889-6898. [Google Scholar] [CrossRef
[3] Oliveira, F.A.D., Nobre, C.N. and Zárate, L.E. (2013) Applying Artificial Neural Networks to Prediction of Stock Price and Improvement of the Directional Prediction Index-Case Study of PETR4, Petrobras, Brazil. Expert Systems with Applications, 40, 7596-7606. [Google Scholar] [CrossRef
[4] Doeksen, B., Abraham, A., Thomas, J. and Paprzycki, M. (2005) Real Stock Trading Using Soft Computing Models. International Conference on Information Technology: Coding & Computing, Las Vegas, NV, 4-6 April 2005, 162-167. [Google Scholar] [CrossRef
[5] Kara, Y., Boyacioglu, M.A. and Baykan, K. (2011) Predicting Direction of Stock Price Index Movement Using Artificial Neural Networks and Support Vector Machines: The Sample of the Istanbul Stock Exchange. Expert Systems with Applications, 38, 5311-5319. [Google Scholar] [CrossRef
[6] Kamijo, K. and Tanigawa, T. (1990) Stock Price Pattern Recognition—A Recurrent Neural Network Approach. 1990 IJCNN International Joint Conference on Neural Networks, San Diego, CA, 17-21 June 1990, 215-221. [Google Scholar] [CrossRef
[7] Guresen, E., Kayakutlu, G. and Daim, T.U. (2011) Using Artificial Neural Network Models in Stock Market Index Prediction. Expert Systems with Applications, 38, 10389-10397. [Google Scholar] [CrossRef
[8] Sui, X.S., Qi, Z.Y., Yu, D.R., et al. (2008) A Novel Feature Selection Approach Using Classification Complexity for SVM of Stock Market Trend Prediction. 2007 International Conference on Management Science and Engineering, Harbin, 20-22 August 2007, 1654-1659.
[9] Chakravarty, S. and Dash, P.K. (2012) A PSO Based Integrated Functional Link Net and Interval Type-2 Fuzzy Logic System for Predicting Stock Market Indices. Applied Soft Computing, 12, 931-941. [Google Scholar] [CrossRef
[10] Shao, X.L., Ma, D., Liu, Y., et al. (2018) Short-Term Forecast of Stock Price of Multi-Branch LSTM Based on K-Means. 2017 4th International Conference on Systems and Informatics, Hangzhou, 11-13 November 2017, 1546-1551. [Google Scholar] [CrossRef
[11] Liu, Y.C. and Yeh, I.C. (2017) Using Mixture Design and Neural Networks to Build Stock Selection Decision Support Systems. Neural Computing & Applications, 28, 1-15. [Google Scholar] [CrossRef
[12] Kai, C., Yi, Z. and Dai, F. (2015) A LSTM-Based Method for Stock Returns Prediction: A Case Study of China Stock Market. 2015 IEEE International Conference on Big Data, Santa Clara, CA, 29 October-1 November 2015, 2823-2824.
[13] Lee, J.W., Hong, E. and Park, J. (2004) A Q-Learning Based Approach to Design of Intelligent Stock Trading Agents. 2004 IEEE International Engineering Management Conference, Singapore, 18-21 October 2004, 1289-1292.
[14] Utomo, D. (2017) Stock Price Prediction Using Back Propagation Neural Network Based on Gradient Descent with Momentum and Adaptive Learning Rate. Journal of Internet Banking and Commerce, 22, No. 3.
[15] Dai, H., Zhang, Y. and Wang, D. (2011) Price Prediction of Stock Index Futures Based on SVM. 2011 Fourth International Conference on Business Intelligence and Financial Engineering, Wuhan, 17-18 October 2011, 54-57. [Google Scholar] [CrossRef
[16] Yu, H., Chen, R. and Zhang, G. (2014) A SVM Stock Selection Model within PCA. Procedia Computer Science, 31, 406-412. [Google Scholar] [CrossRef
[17] Nayak, R.K., Mishra, D. and Rath, A.K. (2015) A Naïve SVM-KNN Based Stock Market Trend Reversal Analysis for Indian Benchmark Indices. Applied Soft Computing, 35, 670-680. [Google Scholar] [CrossRef
[18] Hsu, M.-W., Lessmann, S., Sung, M.-C., Ma, T. and Johnson, J.E. (2016) Bridging the Divide in Financial Market Forecasting: Machine Learners vs. Financial Economists. Expert Systems with Applications, 61, 215-234. [Google Scholar] [CrossRef
[19] Fama, E.F. and Blume, M.F. (1966) Filter Rules and Stock Market Trading. Journal of Business, 39, 226-241. [Google Scholar] [CrossRef
[20] Brock, W., Lakonishok, J. and LeBaron, B. (1992) Simple Technical Trading Rules and the Stochastic Properties of Stock Returns. Journal of Finance, 47, 1731-1764. [Google Scholar] [CrossRef
[21] Conrad, J. and Kaul, G. (1998) An Anatomy of Trading Strategies. Review of Financial Studies, 11, 489-515. [Google Scholar] [CrossRef
[22] Lo, A.W., Mamaysky, H. and Wang, J. (2000) Foundations of Technical Analysis: Computational Algorithms, Statistical Inference, and Empirical Implementation. Journal of Finance, 55, 1705-1765.
[23] Cortes, C. and Vapnik, V. (1995) Support-Vector Networks. Machine Learning, 20, 273-297. [Google Scholar] [CrossRef
[24] Press, H.W., Teukolsky, A.S., Vetterling, T.W. and Flannery, B.P. (2007) Section 16.5. Support Vector Machines, in: Numerical Recipes: The Art of Scientific Computing. 3rd Edition, Cambridge University Press, New York.