Prediction is defined as the expression of events that will occur in the future, before they occur, based on scientific and logical principles and rules. Due to the importance of financial markets for economic activists, prediction in this field has received much attention from scholars. Prediction of the stock market, as one of the largest financial markets can be very profitable to the predictors. The dynamic and complexity of the market has added to its appeal to researchers. To date, many researchers have reported good returns for prediction in this market using neural network methods. In this paper, we attempted to obtain better results on Tehran Stock Exchange by using their findings and by applying the Long Short-Term Memory (LSTM) deep neural network. In the area of feature engineering, we have tried to reduce the number of features using AutoEncoder-based feature selection to improve stock returns and reduce prediction error. To evaluate the proposed method, a return measure that is closer to the real world of stock trading was used. Experimental results showed that using the proposed method yielded a better output with a lower error mean.