This paper aims to establish a quantitative trading strategy of commodity futures based on market money flows. Firstly, we use Accumulation/Distribution index to respectively construct the CMF index which represents the ratio of total capital flows to total volume, and the CHO index which represents the exponential moving average of the cumulative capital flows. In view of the different flows of money between buyers and sellers, the establishment of the transaction net volume index VTL is used to describe respectively the flow of money between buyers and sellers. On this basis, the HMM model is introduced, and the above three kinds of indexes are combined to choose the time, at which we execute the stop-loss operation and risk control. Finally, all performance index values of the strategy are as follows: the rate of initial capital return is 193.77%, the annual rate of return is 99.86%, the maximum retracement rate is 15.73%, the Sharpe rate is 2.05 and the price earnings ratio is 4.01.