China's capital markets started late and there are still many problems with securities trading, adding to the risks for investors. Establishing a portfolio in the A-share market and reducing non-systemic risks through diversification of investment not only reduces the volatility faced by investors, but also stimulates the enthusiasm of investors and enhances the liquidity of the capital market. Therefore, six representative stocks of Yahoo Finance are selected in this paper, and the adjusted closing price of stocks is collected. The mean-variance model is used to find the optimal weight ratio of these six stock portfolios through training sets and test sets. The actual returns are compared with the market to evaluate the outcome of the portfolio. The model results demonstrate that the Sharpe ratio of the portfolio with the highest Sharpe ratio is 68.70%, and the weight of Wuliangye is the highest at 73.55%, while Shenzhen Fountain is only 0.16%. The volatility of the least volatile portfolio is 26.48%, of which YUNNAN BAIYAO has the highest weight (37.78%), and Hithink RoyalFlush has the lowest weight (0.73%). The minimum volatility portfolio yields less than the maximum Sharpe ratio portfolio, but both outperform the market. After excluding the smallest stocks in the portfolio, the portfolio remains stable. The results displays that the mean-variance model can play an effective role in constructing the portfolio of A-share market.