Stock forecasting is a very complicated task due to its noise and volatile characteristics. How to effectively eliminate the noise has attracted attention from both investors and researchers. This report presents a novel de-noise technique named Line Segment Algorithm (LSA). Compared to those signal processing methods, LSA is based on the characteristic of financial time series. First, the algorithm identified the shape patterns of the historical stock price series and labeled them as turning points and false alarms. Then, a stock trend prediction framework was built and trained with the shape patterns extracted by the algorithm. Eventually, the model could predict whether a shape pattern is turning point or not. To evaluate its performance, experiments on the real stock data were carried out in LSTM and Random Forest, respectively. The results show that LSA demonstrates its effectiveness by better accuracy on prediction. It provides a new perspective for stock trend analysis and can be applied in the actual stock investment trading as well.