Volume 7 - Number 1 | March 2023

A novel approach for candlestick technical analysis using a combination of the support vector machine and particle swarm optimization

Armin Mahmoodi, Leila Hashemi, Milad Jasemi, Jeremy Laliberté, Richard C. Millar, and Hamed Noshadi

Abstract:

Purpose
In this research, the main purpose is to use a suitable structure to predict the trading signals of the stock market with high accuracy. For this purpose, two models for the analysis of technical adaptation were used in this study.
Design/methodology/approach
It can be seen that support vector machine (SVM) is used with particle swarm optimization (PSO) where PSO is used as a fast and accurate classification to search the problem-solving space and finally the results are compared with the neural network performance.
Findings
Based on the result, the authors can say that both new models are trustworthy in 6 days, however, SVM-PSO is better than basic research. The hit rate of SVM-PSO is 77.5%, but the hit rate of neural networks (basic research) is 74.2.
Originality/value
In this research, two approaches (raw-based and signal-based) have been developed to generate input data for the model: raw-based and signal-based. For comparison, the hit rate is considered the percentage of correct predictions for 16 days.

References:

  1. Abinaya, P., Kumar, V.S., Balasubramanian, P. and Menon, V.K. (2016), “Measuring stock price and trading volume causality among Nifty50 stocks: the Toda Yamamoto method”, 2016 International Conference on Advances in Computing, Communications and Informatics (ICACCI), pp. 1886-1890.
  2. Ahmadi, E., Abooie, M.H., Jasemi, M. and Zare Mehrjardi, Y. (2016), “A nonlinear autoregressive model with exogenous variables neural network for stock market timing: the candlestick technical analysis”, International Journal of Engineering, Vol. 29 No. 12, pp. 1717-1725.
  3. Ahmadi, E., Jasemi, M., Monplaisir, L., Nabavi, M., Mahmoodi, A. and Amini Jam, P. (2018), “New efficient hybrid candlestick technical analysis model for stock market timing on the basis of the Support Vector Machine and Heuristic Algorithms of Imperialist Competition and Genetic”, Expert Systems with Applications, Vol. 94, pp. 21-31, ISSN 0957-4174, doi: 10.1016/j.eswa.10.023.
  4. Ananthi, M. and Vijayakumar, K. (2021), “Stock market analysis using candlestick regression and market trend prediction (CKRM)”, Journal of Ambient Intelligence and Humanized Computing, Vol. 12, pp. 4819-4826, doi: 10.1007/s12652-020-01892-5.
  5. Anbalagan, T. and Maheswari, S.U. (2015), “Classification and prediction of stock market index based on fuzzy metagraph”, Procedia Computer Science, Vol. 47, pp. 214-221.
  6. Ardjani, F. and Sadouni, K. (2010), “Optimization of SVM multiclass by particle swarm (PSO-SVM). I.J”, Modern Education and Computer Science, Vol. 2, pp. 32-38.
  7. Atsalakis, G.S. and Valavanis, K.P. (2009), “Surveying stock market forecasting techniques–Part II: soft computing methods”, Expert Systems with Applications, Vol. 36 No. 3, pp. 5932-5941.
  8. Barak, S., Heidary, J. and Dahooie, T.T. (2015), “Wrapper ANFIS-ICA method to do stock market timing and feature selection on the basis of Japanese Candlestick”, Expert Systems with Applications, Vol. 42 No. 23, pp. 9221-9235.
  9. Ballings, M., Van den Poel, D., Hespeels, N. and Gryp, R. (2015), “Evaluating multiple classifiers for stock price direction prediction”, Expert systems with Applications, Vol. 42 No. 20, pp. 7046-7056.
  10. Barak, S., Arjmand, A. and Ortobelli, S. (2017), “Fusion of multiple diverse predictors in stock market”, Journal of Information Fusion, Vol. 36, pp. 90-102.
  11. Bartz-Beielstein, T. (2010). “SPOT: an R package for automatic and interactive tuning of optimization algorithms by sequential parameter optimization”, arXiv preprint arXiv:1006.4645.
  12. Basari, A.S.H., Hussin, B., Ananta, I.G.P. and Zeniarja, J. (2013), “Opinion mining of movie review using hybrid method of support vector machine and particle swarm optimization”, Procedia Engineering, Vol. 53, pp. 453-462, ISSN 1877-7058, doi: 10.1016/j.proeng.2013.02.059.
  13. Bashath, S. and Ismail, A.R. (2018), “Comparison of swarm intelligence algorithms for high dimensional optimization problems”, Indonesian Journal of Electrical Engineering and Computer Science, Vol. 11 No. 1, pp. 300-307.
  14. Boutte, D. and Santhanam, B. (2009), “A hybrid ICA-SVM approach to continuous phase modulation recognition”, IEEE Signal Processing Letters, Vol. 16 No. 5, pp. 402-405.
  15. Cao, M. (2021), “Predicting the link between stock prices and indices with machine learning in R programming language”, Journal of Mathematics, 1275637, doi: 10.1155/2021/1275637.
  16. Chen, Q.C.Q., Wu, Y.W.Y., Zhang, X.Z.X. and Chen, X.C.X. (2008), “Forecasting system based on wavelet transform and PSO-SVM”, 2nd International Conference on Anti-counterfeiting, Security, and Identification, Vol. 11, pp. 302-318.
  17. Cherkassky, V. and Ma, Y. (2004), “Practical selection of SVM parameters and noise estimation for SVM regression”, Neural Networks, Vol. 17 No. 1, pp. 113-126.
  18. Cortes, C. and Vapnik, V. (1995), “Support‐vector networks”, Machine Learning, Vol. 20, pp. 273-297.
  19. Dahal, K., Almejalli, K., Hossain, M.A. and Chen, W. (2015), “GA-based learning for rule identification in fuzzy neural networks”, Applied Soft Computing, Vol. 35, pp. 605-617.
  20. De Campos, L.M.L., de Oliveira, R.C.L. and Roisenberg, M. (2016), “Optimization of neural networks through grammatical evolution and a genetic algorithm”, Expert Systems with Applications, Vol. 56, pp. 368-384.
  21. Farahani, M. and Razavi Hajiagha, S.H. (2021), “Forecasting stock price using integrated artificial neural network and metaheuristic algorithms compared to time series models”, Soft Computing, Vol. 25 No. 13, pp. 8483-8513, doi: 10.1007/s00500-021-05775-5.
  22. Fernandez-Lozano, C., Canto, C., Gestal, M., Andrade-Garda, J.M., Rabuñal, J.R., Dorado, J. and Pazos, A. (2013), “Hybrid model based on genetic algorithms and SVM applied to variable selection within fruit juice classification”, The Scientific World Journal, Vol. 12 No. 2, pp. 36-48.
  23. Goel, A.K., Chakraborty, R., Agarwa, M.l., Ansari, M.D., Gupta, S.K. and Garg, D. (2019), “Profit or loss: a long short term memory based model for the prediction of share price of DLF group in India,”, 2019 IEEE 9th International Conference on Advanced Computing (IACC), pp. 120-124, doi: 10.1109/IACC48062.2019.8971601.
  24. Hegazy, O., Soliman, O. and Abdul Salam, M. (2013), “A machine learning model for stock market prediction”, International Journal of Computer Science and Telecommunications, Vol. 4 No. 12, pp. 21-40.
  25. Hong, W.C., Dong, Y., Zheng, F. and Lai, C.Y. (2011a), “Forecasting urban traffic flow by SVR with continuous ACO”, Applied Mathematical Modelling, Vol. 35 No. 3, pp. 1282-1291.
  26. Hong, W.C., Dong, Y., Chen, L.Y. and Wei, S.Y. (2011b), “SVR with hybrid chaotic genetic algorithms for tourism demand forecasting”, Applied Soft Computing, Vol. 11 No. 2, pp. 1881-1890.
  27. Huang, W., Nakamori, Y. and Wang, S.Y. (2005), “Forecasting stock market movement direction with support vector machine”, Computers & Operations Research, Vol. 32 No. 10, pp. 2513-2522.
  28. Huang, C.J., Yang, D.X. and Chuang, Y.T. (2008), “Application of wrapper approach and composite classifier to the stock trend prediction”, Expert Systems with Applications, Vol. 34 No. 4, pp. 2870-2878.
  29. Ito, K., Minami, K., Imajo, K. and Nakagawa, K. (2021). “Trader-company method: a metaheuristic for interpretable stock price prediction”, in Proc. of the 20th International Conference on Autonomous Agents and Multiagent Systems (AAMAS 2021), Online, May 3-7, 2021, IFAAMAS, p. 9.
  30. Jamous, R.A. (2015), “Modifications of particle swarm optimization techniques and its application on stock market”, A Survey, Vol. 6 No. 3, pp. 99-108.
  31. Jasemi, M., Kimiagari, A.M. and Memariani, A. (2011a), “A conceptual model for portfolio management sensitive to mass psychology of market”, International Journal of Industrial Engineering-Theory Application and Practice, Vol. 18 No. 1, pp. 1-15.
  32. Jasemi, M., Kimiagari, A.M. and Memariani, A. (2011b), “A modern neural network model to do stock market timing on the basis of the ancient investment technique of Japanese Candlestick”, Expert Systems with Applications, Vol. 38 No. 4, pp. 3884-3890.
  33. Kennedy, J. (2011), “Particle swarm optimization”, in Sammut, C. and Webb, G.I. (Eds), Encyclopedia of Machine Learning, Springer, Boston, MA, doi: 10.1007/978-0-387-30164-8_630.
  34. Kuo, S.C., Lin, C.J. and Liao, J.R. (2011), “3D reconstruction and face recognition using kernel-based ICA and neural networks”, Expert Systems with Applications, Vol. 38 No. 5, pp. 5406-5415.
  35. Lan, Q., Zhang, D. and Xiong, L. (2011), “Reversal pattern discovery in financial time series based on fuzzy candlestick lines”, Systems Engineering Procedia, Vol. 2, pp. 182-190.
  36. Lee, M.C. (2009), “Using support vector machine with a hybrid feature selection method to the stock trend prediction”, Expert Systems with Applications, Vol. 36 No. 8, pp. 10896-10904.
  37. Lee, K.H. and Jo, G.S. (1999), “Expert system for predicting stock market timing using a candlestick chart”, Expert Systems with Applications, Vol. 16 No. 4, pp. 357-364.
  38. Liu, Q., Chen, W., Hu, H., Zhu, Q. and Xie, Z. (2020), “An optimal NARX neural network identification model for a magnetorheological damper with force-distortion behavior”, Frontiers in Materials, Vol. 7, p. 10.
  39. Mackay, D.J.C. (1992), “A practical Bayesian framework for backpropagation networks”, Neural Computation, Vol. 4, pp. 448-472.
  40. Mahmoudi, A., Hashemi, L., Jasemi, M. and Pope, J. (2020), “A comparison on particle swarm optimization and genetic algorithm performances in deriving the efficient frontier of stocks portfolios based on a mean-lower partial moment model”, International Journal of Finance and Economics, pp. 1-7, doi: 10.1002/ijfe.2086.
  41. Pai, P.F. and Hong, W.C. (2005), “An improved neural network model in forecasting arrivals”, Annals of Tourism Research, Vol. 32 No. 4, pp. 1138-1141.
  42. Pai, P.F. and Hong, W.C. (2006), “Software reliability forecasting by support vector machines with simulated annealing algorithms”, Journal of Systems and Software, Vol. 79 No. 6, pp. 747-755.
  43. Pandith, T.S.N., “Development of PSO based hybrid LSSVM model for time series prediction” November, pp. 16-20.
  44. Rouf, N., Malik, M.B., Arif, T., Sharma, S., Singh, S., Aich, S. and Kim, H.C. (2021), “Stock market prediction using machine learning techniques: a decade survey on methodologies, recent developments, and future directions”, Electronics, Vol. 10, 2717, doi: 10.3390/electronics10212717.
  45. Sankar, C.P., Vidyaraj, R. and Kumar, K.S. (2015), “Trust based stock recommendation system–a social network analysis approach”, Procedia Computer Science, Vol. 46, pp. 299-305.
  46. Selvin, S., Ravi, V., Gopalakrishnan, E.A., Menon, V. and Soman, K. (2017), “Stock price prediction using LSTM, RNN and CNN-sliding window model”, pp. 1643-1647, doi: 10.1109/ICACCI.2017.8126078.
  47. Shen, Z., Yu, L., Zhao, Z., Jin, K., Pan, F., Hu, S., Li, S., Xu, Y., Xu, D. and Huang, M. (2020), “Gray matter volume and functional connectivity in hypochondriasis: a magnetic resonance imaging and support vector machine analysis”, Frontiers in Human Neuroscience, Vol. 2 No. 14, 596157, doi: 10.3389/fnhum.2020.596157.
  48. Singh, G. (2022), “Machine learning models in stock market prediction”, International Journal of Innovative Technology and Exploring Engineering, Blue Eyes Intelligence Engineering and Sciences Engineering and Sciences Publication - BEIESP, doi: 10.35940/ijitee.c9733.0111322.
  49. Tay, F.E. and Cao, L. (2001), “Application of support vector machines in financial time series forecasting”, Omega, Vol. 29 No. 4, pp. 309-317.
  50. Vapnik, V. (1995), The Nature of Statistical Learning Theory, Springer-Verlag, New York.
  51. Vapnik, V.N. (1998), Statistical Learning Theory, John Wiley & Sons, New York.
  52. Vapnik, V.N. and Chervonenkis, A.Y. (2013), “On the uniform convergence of the frequencies of occurrence of events to their probabilities”, in Schölkopf, B., Luo, Z. and Vovk, V. (Eds), Empirical Inference, Springer, Berlin, Heidelberg, doi: 10.1007/978-3-642-41136-6_2.
  53. Wang, G.L.G. (2017), “The performance of PSO-SVM in inflation forecasting”, 10th Int. Conf. Intell. Comput. Technol. Autom., Vol. 1 No. 1, pp. 259-262.
  54. Wang, W., Xu, Z. and Weizhen Lu, J. (2003), “Three improved neural network models for air quality forecasting”, Engineering Computations, Vol. 20 No. 2, pp. 192-210.
  55. Xiao, Y., Xiao, J. and Wang, S. (2012), “A hybrid forecasting model for non-stationary time series: an application to container throughput prediction”, International Journal of Knowledge and Systems Science (IJKSS), Vol. 3 No. 2, p. 16, doi: 10.4018/jkss.2012040105.
  56. Xie, H., Zhao, X. and Wang, S. (2012), “A comprehensive look at the predictive information in Japanese candlestick”, Procedia Computer Science, Vol. 9, pp. 1219-1227.
  57. Xue, S., Tan, J., Shi, L. and Deng, J. (2020), “Rope tension fault diagnosis in hoisting systems based on vibration signals using EEMD, improved permutation entropy, and PSO-SVM”, Entropy, Vol. 22 No. 2, p. 209, doi: 10.3390/e22020209.

Further reading

  1. Cristianini, N. and Shawe-Taylor, J. (2000), An Introduction to Support Vector Machines, Cambridge University Press, London.
  2. Demidova, L., Nikulchev, E. and Sokolova, Y. (2016), “The SVM classifier based on the modified particle swarm optimization”, (IJACSA) International Journal of Advanced Computer Science and Applications, Vol. 7 No. 2, pp. 18-32.
  3. Indra, G., Jemi gold, P., Pavithra, P. and Akila, K. (2021), “Applicability of svm & narx for prediction alayis of flood in humid and semi-humid regions”, Annals of the Romanian Society for Cell Biology, Vol. 25 No. 6, pp. 6282-6293.
  4. Majhi, B., Rout, M. and Baghel, V. (2014), “On the development and performance evaluation of a multiobjective GA-based RBF adaptive model for the prediction of stock indices”, Journal of King Saud University-Computer and Information Sciences, Vol. 26 No. 3, pp. 319-331.
  5. Nunno, F., de Marinis, G., Gargano, R. and Granata, F. (2021), “Tide prediction in the venice lagoon using nonlinear autoregressive exogenous (NARX) neural network”, Water, Vol. 13, p. 1173.
  6. Sahin, U. and Ozbayoglu, A.M. (2014), “TN-RSI: trend-normalized RSI indicator for stock trading systems with evolutionary computation”, Procedia Computer Science, Vol. 36, pp. 240-245.
  7. Xia, Y., Zhao, J., Ding, Q. and Jiang, A. (2021), “Incipient chiller fault diagnosis using an optimized Least squares support vector machine with gravitational search algorithm”, Frontiers in Energy Research, Vol. 9, 755649, doi: 10.3389/fenrg.2021.755649.