Designing an Optimal Model for Predicting Stock Liquidity Using the Random Forest

Document Type : Research Paper

Authors

1 Department of Accounting, Ke.C., Islamic Azad University, Kerman, Iran.

2 Department of Accounting, Shahid Bahonar university of Kerman, Kerman, Iran.

10.22103/jak.2025.24973.4156

Abstract

Objective: Stock markets are inherently volatile and risky due to their dynamic nature, financial complexities, and the limited understanding of price determination among many investors. This study aims to design an optimal predictive model for stock liquidity to provide practical support for investors with insufficient knowledge of these complex dynamics
 
Method: A hybrid approach combining data analysis, machine learning, and predictive modeling was employed. Data related to stock liquidity were collected and preprocessed from various scientific sources. The Random Forest algorithm was then applied to develop an optimal model for predicting stock liquidity.
 
Results: The findings demonstrate that the Random Forest algorithm can provide a relatively accurate and efficient model for predicting stock liquidity. Beta, rate of change, and volatility in stock returns (Rmc) were identified as the most influential factors affecting liquidity. The model achieved higher predictive accuracy compared to previous approaches, as evidenced by its low mean squared error (MSE).
 
Conclusion: The low MSE confirms the suitability of the Random Forest algorithm for predicting stock liquidity. The results of this study can assist investors and financial analysts in making more informed and precise decisions.

Keywords

Main Subjects


احمدوند، میثم؛ تقوی فرد، محمدتقی؛ غائبی مهماندوست علیا، شایان و روحی، محمد (1403). نکول شرکتی و قیمت‌گذاری دارایی‌ها در بازار سهام. مجله دانش حسابداری، 15(1)، 47-82. DOI: 10.22103/jak.2023.21254.3868.
بادآور نهندی، یونس و ملکی نژاد، آمنه (1389). بررسی نقدشوندگی سهام در زمان انتشار گزارشهای مالی در بورس اوراق بهادار تهران. مجله دانش حسابداری، 1(3)، 99-115. DOI: 10.22103/jak.2010.42.
شفیعی، پریسا؛ میرعسکری جیلدانی، سید رضا و رضائی پیته نوئی، یاسر (1404). افشای اطلاعات زیست‌محیطی، اجتماعی و حاکمیتی و نقدشوندگی سهام. مجله دانش حسابداری، مقالات آماده انتشار. DOI: 10.22103/jak.2025.24844.4152.
هوشیار، محمدرضا؛ دارابی، رویا و فلاح، میرفیض (1402). ارائه الگوی اثر درجه شباهت گروهی و کیفیت اطلاعات حسابداری و کیفیت گزارشگری مالی بر ارزش‌گذاری عرضه عمومی اولیه سهام با استفاده از الگوریتم شبکه‌های عصبی مصنوعی. مجله دانش حسابداری، 14(4)، 53-80. DOI: 10.22103/jak.2023.20377.3790.
اسعدی، عبدالرضا و شادمهر، مریم (1394). اثر انتشار به موقع اطلاعات بر نقدشوندگی سهام در بورس اوراق بهادار تهران. بورس اوراق بهادار، 8(31)، 5-25. https://journal.seo.ir/article_11059.html.
ایزدی‌نیا، ناصر و رسائیان، امیر (1389). پراکندگی مالکیت و نقدشوندگی سهام. بررسی‌های حسابداری و حسابرسی، 17(2)، 3-22. https://acctgrev.ut.ac.ir/article_21205.html.
تقوی، مهدی و بیابانی، شاعر (1382). اثرات تغییر نرخ ارز بازار آزاد و جریان نقد آتی بر ارزش سهام شرکت‌های سهامی عام پذیرفته شده در بورس اوراق بهادار تهران. پژوهشنامه اقتصادی، 3(10)، 13-38. https://joer.atu.ac.ir/article_3094.html.
خلیفه سلطانی، سید احمد و بهرامی، ماندانا (1391). رابطه تغییرات ساختار سرمایه و تغییرات نقدشوندگی سهام. پژوهش‌های تجربی حسابداری، 2(2)، 35-53. https://doi.org/10.22051/jera.2013.545.
رضاپور، نرگس؛ حسینی، سید علی و رحمانی، علی (1389). رابطه مالکیت نهادی و نقد شوندگی سهام در ایران. بررسی‌های حسابداری و حسابرسی، 17(3)، 29-54. https://acctgrev.ut.ac.ir/article_21684.html.
رضایی، محمود؛ پناهیان، حسین؛ معدنچی زاج، مهدی و قدرتی، حسن (1401). تبیین عوامل مؤثر بر نقد شوندگی سهام با استفاده از الگوریتم ژنتیک و روش حداقل افزونگی و حداکثر ارتباط (MRMR). نشریه مهندسی مالی و مدیریت اوراق بهادار، 13(53)، 54-71. https://journals.iau.ir/article_693732.html.
رنجبر ناوی، رستم؛ حمیدیان، محسن و باغانی، علی (1400). تدوین الگو و تعیین اولویت‌های مؤثر بر معیارهای نوسان پایین به بالا و دوره سقوط قیمت سهام در بورس اوراق بهادار تهران با رویکرد پانل دیتا. فصلنامه دانش سرمایه گذاری، 10(38)، 105-134. http://www.jik-ifea.ir/article_17522.html.
صالحی، الله کرم (1400). تأثیر قدرت حاکمیت شرکتی بر نقدشوندگی بازار سهام: با تاکید بر معیارهای آمیهود، حجم معامله و شکاف قیمتی. فصلنامه دانش سرمایه گذاری، 10(37)، 37-55. https://sanad.iau.ir/Journal/jik/Article/841707.
صلواتی، شاپور و رسائیان، امیر (1386). بررسی رابطه بین ساختار سرمایه و نقدشوندگی سهام در ایران. دوفصلنامه علمی مطالعات و سیاست‌های اقتصادی، 12(63)، 143-163. https://economic.mofidu.ac.ir/article_47126.html.
قاسمیه، رحیم؛ سینایی، حسنعلی و صحرایی، صدیقه (1402). پیش بینی نقدشوندگی در بورس اوراق بهادار تهران با استفاده از الگوهای یادگیری. نشریه پژوهش‌های راهبردی بودجه و مالیه، 4(3)، 11-29. https://dor.isc.ac/dor/20.1001.1.27171809.1402.4.3.1.5.
نادری، ابراهیم و اسماعیل‌زاده مقری، علی (1399). برآورد اختلاف قیمت پیشنهادی خریدوفروش سهام با استفاده از الگوریتم کلونی زنبورعسل مصنوعی (ABC). نشریه پژوهش‌های حسابداری مالی و حسابرسی، 12(48)، 121-148. https://journals.iau.ir/article_680058.html.
نظامی، نصرت؛ محمدی نوده، فاضل و خردیار، سینا (1404). مدل یابی پیش بینی ورشکستگی با تأکید بر روش‌های نوین اندازه گیری شبکه‌های عصبی و ماشین بردار پشتیبان. دانش حسابداری و حسابرسی مدیریت، 14(55)، 265-278. https://www.jmaak.ir/article_23640.html.

References

Ahmadvand, M., Taghavifard, M.T., Ghaebi Mehmandoust Olya, S., & Rouhi, M. (2024). Corporate default and asset pricing in stock market. Journal of Accounting Knowledge, 15(1), 47-82. DOI: 10.22103/jak.2023.21254.3868 [In Persian].
Aliyu, S.U.R. (2012). Does inflation have an impact on stock returns and volatility? Evidence from Nigeria and Ghana. Applied financial economics, 22(6), 427-435. http://dx.doi.org/10.1080/09603107.2011.617691.
Amihud, Y. (2002). Illiquidity and stock returns: cross-section and time-series effects. Journal of Financial Markets, 5(1), 31-56. https://www.sciencedirect.com/science/article/pii/S1386418101000246.
Amihud, Y. and Mendelson, H. (1986). Asset pricing and bid ask spread. Journal of Financial Economics, 17, 223-249. https://doi.org/10.1016/0304-405X(86)90065-6.
Amihud, Y., & Noh, J. (2021). Illiquidity and stock returns II: Cross-section and time-series effects. The Review of Financial Studies, 34(4), 2101-2123. https://academic.oup.com/rfs/article-abstract/34/4/2101/5869447.
Andersen, T.G. (1996). Return volatility and trading volume: An information flow interpretation of stochastic volatility. The Journal of Finance, 51(1), 169-204. https://doi.org/10.1111/j.1540-6261.1996.tb05206.x.
Anifowose, M. (2012). Information asymmetric effect on the stock return volatility in Nigerian capital market. Accounting Frontier, 14(2), 47-64. https://dx.doi.org/10.2139/ssrn.2752915.
Asa’di, A., Shadmehr, M. (2015). The effect of timely information disclosure on stock liquidity in Tehran Stock Exchange. Stock Exchange, 8(31), 5-25. https://journal.seo.ir/article_11059.html [In Persian].
Badavar Nahandi, Y., & Maleki Nejad, A. (2010). Survey the stock liquidity at the time of issuing financial reports. Journal of Accounting Knowledge, 1(3), 99-115. DOI: 10.22103/jak.2010.42 [In Persian].
Barberis, N., & Thaler, R. (2003). A survey of behavioral finance. Handbook of the Economics of Finance, 1, 1053-1128. https://www.sciencedirect.com/science/article/pii/S1574010203010276.
Bhatia, S., Peri, S., Friedman, S., & Malen, M. (2024). High-frequency trading liquidity analysis| application of machine learning classification. arXiv preprint arXiv:2408.10016. https://arxiv.org/abs/2408.10016
Boubaker, S., Gounopoulos, D., Kallias, A., & Kallias, K. (2017). Management earnings forecasts and IPO performance: evidence of a regime change. Review of Quantitative Finance and Accounting, 48, 1083-1121. https://link.springer.com/article/10.1007/s11156-016-0579-8.
Cartea, Á., Jaimungal, S., & Sánchez-Betancourt, L. (2021). Latency and liquidity risk. International Journal of Theoretical and Applied Finance, 24(06n07), 2150035. [World Scientific].
Chang, Y.H., & Huang, C.W. (2024). Utilizing genetic algorithms in conjunction with ANN-based stock valuation models to enhance the optimization of stock investment decisions. AI, 5(3), 1011-1029. https://doi.org/10.3390/ai5030050.
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. https://doi.org/10.1016/j.eswa.2017.04.030.
Chordia, T., Roll, R., & Subrahmanyam, A. (2001). Market liquidity and trading activity. The Journal of Finance, 56(2), 501-530. https://onlinelibrary.wiley.com/doi/abs/10.1111/0022-1082.00335.
Cobandag Guloglu, Z., & Ekinci, C. (2022). Liquidity measurement: A comparative review of the literature with a focus on high frequency. Journal of Economic Surveys, 36(1), 41-74. [Wiley Online Library].
Datar, V.T., Naik, N.Y., & Radcliffe, R. (1998). Liquidity and stock returns: An alternative test. Journal of Financial Markets, 1(2), 203-219. https://doi.org/10.1016/S1386-4181(97)00004-9.
Depren, Ö., Kartal, M.T., & Kılıç Depren, S. (2021). Recent innovation in benchmark rates (BMR): Evidence from influential factors on Turkish Lira overnight reference interest Rate with machine learning algorithms. Financial Innovation, 7(1), 44. https://doi.org/10.1186/s40854-021-00245-1.
Dey, M. (2005). Liquidity, turnover, and return in global stock markets. Emerging Markets Review, 6(1), 45-67. https://doi.org/10.1016/j.ememar.2004.09.003.
Fama, E.F. (1970). Efficient capital markets. Journal of Finance, 25(2), 383-417. [De Gruyter].
Frieder, L., & Martell, R. (2006). On capital structure and the liquidity of a firm's stock. Available at SSRN 880421. http://dx.doi.org/10.2139/ssrn.880421.
Ghasemiyeh, R., Sinaei, H., & Sahraei, S. (2023). Liquidity prediction in Tehran stock exchange using learning models. Budget and Finance Strategic Research, 4(3), 11-29. https://fbarj.ihu.ac.ir/article_208569.html [In Persian].
Goyenko, R.Y., Holden, C.W., & Trzcinka, C.A. (2009). Do liquidity measures measure liquidity? Journal of Financial Economics, 92(2), 153-181. https://doi.org/10.1016/j.jfineco.2008.06.002.
Grossman, S.J., & Stiglitz, J.E. (1980). On the impossibility of informationally efficient markets. The American Economic Review, 70(3), 393-408. https://www.jstor.org/stable/1805228.
Hooshyar, M., Darabi, R., & Fallah, M. (2023). Presenting the model of the effect of the degree of group similarity on the quality of accounting information and the quality of financial reporting on the valuation of the initial public offering of shares using the algorithm of artificial neural networks. Journal of Accounting Knowledge, 14(4), 53-80. DOI: 10.22103/jak.2023.20377.3790 [In Persian].
Hu, S. Y. (1997). Trading turnover and expected stock returns: The trading frequency hypothesis and evidence from the Tokyo Stock Exchange. Available at SSRN 15133. https://dx.doi.org/10.2139/ssrn.15133.
Izadinia, N., & Rasaiian, A. (2010). Ownership dispersion and stock liquidity. Accounting and Auditing Review, 17(2), 3-22. https://acctgrev.ut.ac.ir/article_21205.html [In Persian].
Jeribi, F., Martin, R.J., Mittal, R., Jari, H., Alhazmi, A.H., Malik, V., ... & Singh, S.V. (2024). A deep learning based expert framework for portfolio prediction and forecasting. IEEE Access, https://ieeexplore.ieee.org/abstract/document/10613392.
Khalifeh Soltani, S.A., & Bahrami, M. (2012). The relationship between changes in capital structure and changes in equity liquidity. Empirical Research in Accounting, 2(2), 35-53. DOI: 10.22051/jera.2013.545 [In Persian].
Khang, P.Q., Kaczmarczyk, K., Tutak, P., Golec, P., Kuziak, K., Depczyński, R., ... & Rot, A. (2021). Machine learning for liquidity prediction on Vietnamese stock market. Procedia Computer Science, 192, 3590-3597. https://www.sciencedirect.com/science/article/pii/S1877050921018718.
Lang, M., & Maffett, M. (2011). Transparency and liquidity uncertainty in crisis periods. Journal of Accounting and Economics, 52(2-3), 101-125. https://doi.org/10.1016/j.jacceco.2011.07.001.
Liu, W., & Suzuki, Y. (2024). Stock liquidity, financial constraints, and innovation in Chinese SMEs. Financial Innovation, 10(1), 91. https://doi.org/10.1186/s40854-023-00597-w.
Lo, A.W. (2004). The adaptive markets hypothesis: Market efficiency from an evolutionary perspective. Journal of Portfolio Management, Forthcoming, 2004, 1-31. [PDF].
Makridakis, S., Spiliotis, E., & Assimakopoulos, V. (2018). Statistical and Machine Learning forecasting methods: Concerns and ways forward. PloS One, 13(3), e0194889. https://doi.org/10.1371/pone.0194889.
Malagrino, L.S., Roman, N.T., & Monteiro, A.M. (2018). Forecasting stock market index daily direction: A Bayesian Network approach. Expert Systems with Applications, 105, 11-22. https://doi.org/10.1016/03.039.
Marshall, B.R., & Young, M. (2003). Liquidity and stock returns in pure order-driven markets: evidence from the Australian stock market. International Review of Financial Analysis, 12(2), 173-188. http://dx.doi.org/10.1016/S1057-5219(03)00006-1.
Mohebbi, S., Fadaeinejad, M.E., & Hamidizadeh, M.R. (2021). The proposed algorithm to select appropriate features for predicting Tehran Stock Exchange index. Financial Management Perspective, 11(34), 35-67. https://doi.org/10.52547/jfmp.11.34.35.
Naderi, E., & Esmaeilzadeh Moqri, A. (2019). Estimating the difference between the bid and ask price of stocks using the Artificial Bee Colony (ABC) algorithm. Journal of Financial Accounting and Auditing Research, 12(48), 121-148. https://journals.iau.ir/article_680058.html [In Persian].
Nezami, N., Mohammadi Node, F., & Kheradyar, S. (2025). Predictive modeling of bankruptcy with an emphasis on modern measurement methods such as Neural Networks and support vector machines. Journal of Management Accounting and Auditing Knowledge, 14(55), 265-278. https://www.jmaak.ir/article_23640.html [In Persian].
Norvaišienė, R., & Stankevičienė, J. (2014). Impact of companies’ internal factors on stock liquidity in Baltic markets. Procedia-Social and Behavioral Sciences, 156, 543-547. https://doi.org/10.1016/11.237.
Oussar, Y., & Dreyfus, G. (2000). Initialization by selection for wavelet network training. Neurocomputing, 34(1-4), 131-143. https://hal.science/hal-00922196v1.
Peters, E. E. (1994). Fractal market analysis: Applying chaos theory to investment and economics. John Wiley & Sons. [Google Books].
Rahmani, A., Hosseini, S.A., & Rezapour, N. (2010). Institutional ownership and stock liquidity: Evidence from Iran. Accounting and Auditing Review, 17(3), 29-54. https://acctgrev.ut.ac.ir/article_21684.html [In Persian].
Ranjbar Navi, R., Hamidian, M., & Baghani, A. (2021). Modeling and identifying hierarchy of the effective measures of DUVOL criteria and the period of falling stock prices in Tehran Stock Exchange with panel data approach. Journal of Investment Knowledge, 10(38), 105-134. http://www.jik-ifea.ir/article_17522.html [In Persian].
Rezaei, M., Panahian, H., Madanchizaj, M., & Ghodrati, H. (2013). Explaining the factors affecting stock liquidity using genetic algorithm and minimum redundancy and maximum relevance (MRMR) method. Journal of Financial Engineering and Securities Management, 13(53), 54-71. https://journals.iau.ir/article_693732.html [In Persian].
Salavati, S., & Rasaiian, A. (2007). A survey on the relationship between capital structure and stock liquidity in Iran. The Journal of Economic Studies and Policies, 12(63), 143-163. https://economic.mofidu.ac.ir/47126.html [In Persian].
Salehi, A.K. (2021). The effect of corporate governance strength on stock market liquidity: with emphasis on Amihood criteria, trading volume and price gap. Quarterly Journal of Investment Knowledge, 10(37), 37-55. https://sanad.iau.ir/Journal/jik/Article/841707 [In Persian].
Salim Hadad, F.(2012). Stock liquidity and capital structure: An empirical study on Amman stock exchange. European Journal of Economics, Finance and Administrative Sciences, ISSN 1450-2275 Issue 47. http://dx.doi.org/10.13140/RG.2.1.1699.6240.
Sethy, T.K., & Tripathy, N. (2024). A new method for estimating liquidity and stock returns in Indian stock market. China Accounting and Finance Review. https://doi.org/10.1108/CAFR-05-2023-0052.
Shafiei, P., Miraskari Jildani, S.R., & Rezaei Pitenoei, Y. (2025). Disclosure of environmental, social and governance information and stock liquidity. Journal of Accounting Knowledge, Articles in Press. DOI: 10.22103/jak.2025.24844.4152 [In Persian].
Shiller, R.J. (2003). From efficient markets theory to behavioral finance. Journal of economic perspectives, 17(1), 83-104. https://www.aeaweb.org/articles?id=10.1257%2F089533003321164967&source=post_page.
Shleifer, A., & Vishny, R. W. (1992). Liquidation values and debt capacity: A market equilibrium approach. The Journal of Finance, 47(4), 1343-1366. https://doi.org/10.1111/j.1540-6261.1992.tb04661.x.
Subramaniam, R. K., Samuel, S. D., & Mahenthiran, S. (2016). Liquidity implications of corporate social responsibility disclosures: Malaysian evidence. Journal of International Accounting Research, 15(1), 133-153. https://doi.org/10.2308/jiar-51204.
Taghavi, M., & Biabani, Sh. (2003). The effects of changes in the free market exchange rate and future cash flow on the stock value of public joint stock companies listed on the Tehran Stock Exchange. Journal of Economic Research, 3(10), 13-38. https://joer.atu.ac.ir/article_3094.html [In Persian].
Tsai, K.H., & Wang, J.C. (2009). External technology sourcing and innovation performance in LMT sectors: An analysis based on the Taiwanese Technological Innovation Survey. Research Policy, 38(3), 518-526. http://dx.doi.org/10.1016/j.respol.2008.10.007.
Zhu, J. (2009). Pricing volatility of stock returns with volatile and persistent components. Financial Markets and Portfolio Management, 23, 243-269. https://doi.org/10.1007/s11408-009-0107-0.

Articles in Press, Accepted Manuscript
Available Online from 30 September 2025
  • Receive Date: 13 May 2025
  • Revise Date: 20 September 2025
  • Accept Date: 21 September 2025