There is a current trend toward the use of artificial intelligence to get faster and more accurate results , and we have found that investments are one of the areas that tend to predict stock market prices. Therefore , the aim of this study was to predict the most profitable sectors in the stock market and, accordingly, to make recommendations to the best companies in this field. Depending on the stock price, closing price, opening price, and stock value. Making it easier for an investor to choose the best, most profitable sector of the year to invest. Dataset was selected from the famous site Kaggle and was characterized as being modern because it is updated in seconds. Dataset has contained many global companies, such as Apple and Microsoft. Furthermore , to predict the outcome number of machine learning algorithms, we have chosen the straight line algorithm, random forest, and support vector machine to compare the results and choose the best among them. The random forest algorithm had the most accurate (94.12%) success rate because we were able to increase the number of repeats in training, giving a higher accuracy ratio.