The stock market is a financial marketplace where investors may participate through the acquisition and sale of stocks in publicly traded companies. Predicting stock prices in the securities sector may be challenging due to the intricate nature of the subject, which necessitates a comprehensive grasp of several interconnected factors. Numerous factors, including politics, society, as well as the economy, have an impact on the stock market. The primary objective of financial market investing is to exploit larger profits. Financial markets provide many opportunities for market analysts, investors, and researchers in several industries due to significant technology advancements. Conventional approaches encounter difficulties in capturing the complex, non-linear connections that exist in market data, which requires the implementation of sophisticated artificial intelligence models. This paper presents a new approach to tackling certain issues by suggesting a unique model. It combines the long short-term memory method and Empirical Mode Decomposition with the Manta Ray Foraging Optimization. When tested in the current study's dynamic stock market, the EMD-MRFO-LSTM model outperformed other models regarding performance and efficiency. The Nasdaq index data from January 2, 2015, to June 29, 2023, were used in this study. The findings demonstrate how the suggested model is capable of making precise stock price predictions. The suggested model offers a workable approach to studying and predicting stock price time series by obtaining values of 0.9973, 91.99, 71.54, and 0.57, for coefficient of determination (R-2), root means square error (RMSE), mean absolute error (MAE), and mean absolute percentage error (MAPE), respectively. Compared to other methods currently in use, the proposed model has a higher accuracy in forecasting and is more physically relevant to the dynamic stock market, according to the outcomes of the experiment.