Stock prediction has been a focus of research in recent years. Traders are seeking to acquire an effective model to predict the stock prices in the future to make investments and earn arbitrages. Methods in machine learning and deep learning have been broadly used in economic model buildings. However, important factors like macroeconomic environments and government regulations were not considered effective in most cases. With different events happening in various situations, the influences can be extremely different. In this essay, we will use machine learning methods to analyze the impacts of various conditions and how this will optimize prediction accuracy. In the meantime, it will offer a new perspective of view to conduct technical and sentimental analysis based on the premise of fundamental analysis.