The price of stocks is determined by the market, and the relationship between supply and demand affects the fluctuation of stock prices. However, the three main factors driving stock prices to rise or fall are fundamental factors, technical factors and market sentiment. The relationship between the market sentiment and investor sentiment is included. Therefore, this article will focus on the types of market sentiment and how investor sentiment affects the market. For example, when the market dries up, what background conditions will investors affect their risk tolerance? Next, this article will introduce a two-step principal component analysis method to construct an investor sentiment index based on the actual situation in China and the availability of data Sexual selection of five proxy variables. The five proxy variables are the number of newly opened stock accounts, turnover rate, margin balance, net active purchases and investor attention. The analytic method proves that as investor sentiment fluctuates, the five proxy variables will also fluctuate. Therefore, when these five proxy variables fluctuate violently, it proves that the market is also covered by investor sentiment. Finally, this article will use investment portfolios to reduce additional risk factors caused by emotions.