In order to optimize the inventory of auto aftermarket parts, the second weighted moving average method is used to forecast the demand of auto aftermarket parts. Compared with the traditional weighted moving average method, the results show that the improved method is better than the traditional method.