Stock price forecasting is the most difficult field owing to irregularities. However, because stock prices sometimes show similar patterns and are determined by a variety of factors, we propose determining similar patterns in historical stock data to achieve daily stock prices with high prediction accuracy and potential rules for selecting the main factors that significantly affect the price, while simultaneously considering all factors. This study is intended at suggesting a new complex methodology that finds the optimal historical dataset with similar patterns according to various algorithms for each stock item and provides a more accurate prediction of daily stock price. First, we use a Dynamic Time Warping algorithm to find patterns with the most similar situation adjacent to a current pattern. Second, we select the determinants most affected by the stock price using feature selection based on Stepwise Regression Analysis. Moreover, we generate an artificial neural network model with selected features as training data for predicting the best stock price. Finally, we use Jaro–Winkler distance with Symbolic Aggregate approXimation (SAX) as a prediction accuracy measure to verify the accuracy of our model.