This paper uses the daily prices of gold and bitcoin from September 2016 to September 2021 to discuss the optimal decision of market traders. LSTM algorithm is used to predict the future price trend of bitcoin and gold. Then, calculate the risk coefficient of Bitcoin and gold trading. Next, the expected returns of gold and bitcoin are obtained according to the determined price forecast value, and combined with the risk coefficient to construct the transaction function. Finally, because the objective function and constraint conditions are linear functions, the results are calculated by using the idea of linear programming. In the whole paper, considering the attitude of market traders in decision-making, three types of decision makers are discussed. Firstly, the time series model is used to predict the data of the same gold and bitcoin. Then, the data predicted by the LSTM model and the time series model are used to calculate the MAE and MSE. By comparing the numerical values, the LSTM model is significantly superior to the time series model, so that the optimal prediction method is proved. Next, for three different decision types of traders, respectively, using the decision model established in 6.1 to find whether the optimal decision point exists and meaningful. The results show that all three types of decision makers can make optimal decisions under the influence of the risk of the predicted data, that is, the risk of the decision model is controllable. Secondly, to demonstrate the sensitivity of transaction costs. Firstly, the fixed commission ratio in the requirements is adjusted, and the commission ratios of bitcoin and gold are adjusted respectively, floating up and down within 20 %. Then, it is brought into 6.1 to calculate the optimal decision-making profit value of traders of three decision-making types. Finally, it is found that the profit value of the optimal decision-making point is very stable. Compared with the profit value calculated by the given commission ratio, the deviation is less than 0.4 %, and the sensitivity analysis of transaction cost is well completed. Finally, but not the most important, it is hoped that the model studied in this paper can help market traders make optimal strategies when making decisions.