Quarterly Publication

Document Type : Original Article


1 Assistant Professor, Accounting Department, Petroleum Faculty of Tehran, Petroleum University of Technology, Iran

2 MSc Student in Finance, Accounting Department, Petroleum Faculty of Tehran, Petroleum University of Technology, Tehran, Iran.


Stock price prediction is one of the crucial concepts in finance area. Machine learning can provide the opportunity for traders and investors to predict stock prices more accurately. In this paper, Closing Price is dependent variable and First Price, Last Price, Opening Price, Today’s High, Today’s Low, Volume, Total Index of Tehran Stock Exchange, Brent Index, WTI Index and Exchange Rate are independent variables.
Seven different machine learning algorithms are implemented to predict stock prices. Those include Bayesian Linear, Boosted Tree, Decision Forest, Neural Network, Support Vector, and Ensemble Regression. The sample of the study is fifteen oil and gas companies active in the Tehran Stock Exchange. For each stock the data from the September 23, 2017 to September 23, 2019 gathered. Each algorithm provided two metrics for performance: Root Mean Square Error and Mean Absolute Error. By comparing the aforementioned metrics, the Bayesian Linear Regression had the best performance to predict stock price in the oil and gas industry in the Tehran Stock Exchange.


Main Subjects

Abbasi, E., & Abouec, A. (2008). Stock price forecast by Using neuro-fuzzy Inference System. Paper Presented at The Proceedings of World Academy of Science, Engineering and Technology.
Ajayi, R. A., & Mougouė, M. (1996). On the Dynamic Relation Between Stock Prices and Exchange Rates. Journal of Financial Research, 19(2), 193–207.
Apergis, N., & Miller, S. M. (2009). Do structural oil-Market Shocks Affect Stock Prices? Energy Economics, 31(4), 569–575.
Awad, M., & Khanna, R. (2015). Support Vector regression. In Efficient Learning Machines (pp. 67–80): Springer.
Bekiros, S. D., & Georgoutsos, D. A. (2007). Evaluating direction-of-change forecasting: Neurofuzzy Models vs. Neural Networks. Mathematical and Computer Modelling, 46(1–2), 38–46.
Beyaz, E., Tekiner, F., Zeng, X.-j., & Keane, J. (2018). Comparing Technical and Fundamental indicators in Stock Price Forecasting. Paper Presented at the 2018 IEEE 20th International Conference on High Performance Computing and Communications; IEEE 16th International Conference on Smart City; IEEE 4th International Conference on Data Science and Systems (HPCC/SmartCity/DSS).
Bhardwaj, N., & Ansari, M. A. (2019). Prediction of Stock Market Using Machine Learning Algorithms.
Bohn, T. A. (2017). Improving long Term Stock Market prediction with Text Analysis.
Bontempi, G., Taieb, S. B., & Le Borgne, Y.-A. (2012). Machine learning strategies for Time Series Forecasting. Paper Presented at The European Business Intelligence Summer School.
Castillo, I., Schmidt-Hieber, J., & Van Der Vaart, A. (2015). Bayesian Linear Regression with Sparse Priors. The Annals of Statistics, 43(5), 1986–2018.
Chen, Y., Yang, B., & Abraham, A. (2007). Flexible Neural Trees Ensemble for Stock Index Modeling. Neurocomputing, 70(4–6), 697–703.
Chong, E., Han, C., & Park, F. C. (2017). Deep Learning Networks for Stock Market Analysis and Prediction: Methodology, data Representations, and Case Studies. Expert Systems with Applications, 83, 187–205.
Cutler, D. M., Poterba, J. M., & Summers, L. H. (1988). What Moves Stock Prices? In: National Bureau of Economic Research Cambridge, Mass., USA.
Deshpande, R. (2017). Semi-Strong Form of Market Efficiency: Does all Critical Information Affect Stock Price Valuations? Indian Journal of Research in Capital Markets, 15.
Dua, S., & Du, X. (2016). Data Mining and Machine Learning in Cybersecurity: CRC Press.
Fama, E. F. (1965). The Behavior of Stock-Market Prices. The Journal of Business, 38(1), 34–105.
Fama, E. F. (1995). Random Walks in Stock Market Prices. Financial Analysts Journal, 51(1), 75–80.
Garakani, A. R., & Branch, S. T. (2018). Stock Price Prediction Using Multilayer Perceptron Neural Network by Monitoring Frog Leaping Algorithm. Journal of Intelligent Computing Volume, 9(1), 15.
Ghasemiyeh, R., Moghdani, R., & Sana, S. S. (2017). A Hybrid Artificial Neural Network with Metaheuristic Algorithms for Predicting Stock Price. Cybernetics and Systems, 48(4), 365–392.
Hadavandi, E., Shavandi, H., & Ghanbari, A. (2010). Integration of Genetic Fuzzy Systems and Artificial Neural Networks for Stock Price Forecasting. Knowledge-Based Systems, 23(8), 800–808.
Hamao, Y., Masulis, R. W., & Ng, V. (1990). Correlations in Price Changes and Volatility Across International Stock Markets. The Review of Financial Studies, 3(2), 281–307.
Huang, B., Ding, Q., Sun, G., & Li, H. (2018). Stock Prediction Based on Bayesian-LSTM. Paper Presented at The Proceedings of the 2018 10th International Conference on Machine Learning and Computing.
Huang, W., Nakamori, Y., & Wang, S.-Y. (2005). Forecasting Stock Market Movement Direction with Support Vector Machine. Computers & Operations Research, 32(10), 2513–2522.
Hui, M. (2019). Empirical Analysis of The Impact of Macro Factors on Stock Prices.
Jandaghi, G., Tehrani, R., Hosseinpour, D., Gholipour, R., & Shadkam, S. A. S. (2010). Application of Fuzzy-neural Networks in Multi-ahead Forecast of Stock Price. African Journal of Business Management, 4(6), 903.
Jiang, Q. (2019). Comparison of Black–Scholes Model and Monte-Carlo Simulation on Stock Price Modeling. Paper Presented at the 2019 International Conference on Economic Management and Cultural Industry (ICEMCI 2019).
Kimoto, T., Asakawa, K., Yoda, M., & Takeoka, M. (1990). Stock Market Prediction System with Modular Neural Networks. Paper Presented at the 1990 IJCNN International Joint Conference on Neural Networks.
Krawczyk, B., Minku, L. L., Gama, J., Stefanowski, J., & Woźniak, M. (2017). Ensemble Learning for Data Stream Analysis: A Survey. Information Fusion, 37, 132–156.
Langley, P. (2011). The Changing Science of Machine Learning. Machine Learning, 82(3), 275–279.
Liu, W., Wang, Z., Liu, X., Zeng, N., Liu, Y., & Alsaadi, F. E. (2017). A Survey of Deep Neural Network Architectures and Their Applications. Neurocomputing, 234, 11–26.
Lo, A. W., & MacKinlay, A. C. (1988). Stock Market Prices do not Follow Random Walks: Evidence from a Simple Specification Test. The Review of Financial Studies, 1(1), 41–66.
McQueen, G., & Roley, V. V. (1993). Stock Prices, News, and Business Conditions. The Review of Financial Studies, 6(3), 683–707.
Monfared, S. S., & Akın, F. (2017). The Relationship Between Exchange Rates and Inflation: The Case of Iran. European Journal of Sustainable Development, 6(4), 329.
Moukalled, M., El-Hajj, W., & Jaber, M. (2019). Automated Stock Price Prediction Using Machine Learning. Paper Presented at The Proceedings of The Second Financial Narrative Processing Workshop (FNP 2019), September 30, Turku Finland.
Patel, J., Shah, S., Thakkar, P., & Kotecha, K. (2015a). Predicting Stock and stock Price Index Movement Using Trend Deterministic Data Preparation and Machine Learning Techniques. Expert Systems with Applications, 42(1), 259–268.
Patel, J., Shah, S., Thakkar, P., & Kotecha, K. (2015b). Predicting Stock Market Index Using Fusion of Machine Learning Techniques. Expert Systems with Applications, 42(4), 2162–2172.
Rokach, L. (2016). Decision Forest: Twenty Years of Research. Information Fusion, 27, 111–125.
Si, S., Zhang, H., Keerthi, S. S., Mahajan, D., Dhillon, I. S., & Hsieh, C.-J. (2017). Gradient Boosted Decision Trees for High Dimensional Sparse output. Paper Presented at The Proceedings of the 34th International Conference on Machine Learning-Volume 70.
Vatanparast, M., & Mohammadi, S. (2019). Stock Price Prediction Based on LM-BP Neural network and Over-point Estimation by Counting Time Intervals: Evidence from the Stock Exchange.
Veretelnikova, E. L., & Elantseva, I. L. (2016). Selection of Factor for Root Mean Square Minimum Error Criterion. Paper Presented at the 2016 13th International Scientific-Technical Conference on Actual Problems of Electronics Instrument Engineering (APEIE).
Warner, J. B., Watts, R. L., & Wruck, K. H. (1988). Stock Prices and Top Management Changes. Journal of Financial Economics, 20, 461–492.
Wright, J. H. (2008). Bayesian Model Averaging and Exchange Rate forecasts. Journal of Econometrics, 146(2), 329–341.
Yu, L., Hu, L., & Tang, L. (2016). Stock Selection with a Novel Sigmoid-Based Mixed Discrete-Continuous Differential Evolution Algorithm. IEEE Transactions on Knowledge and Data Engineering, 28(7), 1891–1904.
Zuo, Y., & Kita, E. (2012). Stock Price Forecast Using Bayesian Network. Expert Systems with Applications, 39(8), 6729–6737.