In the topic selection, we need to estimate the prices of bitcoin and gold according to the data given from 2001 to 2012. According to the estimated price, the initial amount is set as $1000, which is used as the principal for financial investment for a period of five years from 2016. In the whole modeling process, the main problems we need to solve are the following four points: the task 1 is the best investment strategy is given through the established model, and the investment value on October 9, 2021 is calculated. The task 2 is the best strategy of the model is proved. The task 3 is Determine the impact of transaction costs on transaction results. The last task is to Complete a memo with strategies, models, and results. In the whole modeling process, we first preprocess the data, which is arranged and classified in chronological order, and fill the data by interpolation fitting. LSMT algorithm is a neural network algorithm, which is suitable for the calculation of various long-term processes. The investment problem we study is a good application field. In the calculation process of the basic model, it is necessary to set the initial value, complete a series of processing, and process the hidden layer of LSTM unit. Take x as the output value, set the temporary hidden layer and new hidden layer, and verify that the size of the final output result is consistent with the label size. The hidden layer is transformed according to the sigmoid function proposed above. After calculating the hidden layer conversion, the error is back propagated, the input derivative of the file is obtained, and the overall error and record hidden layer are obtained. Then the calculated hidden layer difference is used to calculate the change of parameters and update parameters. Since bitcoin can be traded on any trading day, gold can only be traded on weekly trading days. For the convenience of calculation, we fix the transactions of bitcoin and gold as trading days every Friday. After receiving the benefits, the total assets of the cash flow as of the trading day are obtained by deducting the Commission to be paid. However, the model ignores the impact of bitcoin mining with different software and the fact that gold and bitcoin are not fixed on the same trading day, so there will be errors.