Market traders buy and sell volatile assets frequently, with a goal to maximize their total return. The price data of volatile assets is a typical time series data. In reality, traders often trade a variety of assets for portfolio, so the general unitary time series model cannot play a great role. In this case, traders want to invest in gold and bitcoin at the same time To do this, we developed a model that provides the best daily trading strategy based solely on the day's gold and Bitcoin prices. Our model is based on the five-year transaction data of gold and bitcoin from 2016 to 2021. The sliding window processing of the original data makes it more suitable for application in machine learning. Then, we choose the random forest regression model to complete the time series prediction, and achieve good prediction results Furthermore, the optimal daily trading strategy is solved according to the predicted price of gold and bitcoin on the second day. This is a typical goal programming problem, and its objective function is to maximize the total return. Here, we use genetic algorithm to solve this problem, so as to give the optimal daily trading strategy According to our strategy, the initial $1000 investment is worth about $270,000 after 5 years. Finally, we do some sensitivity analysis on the effect of transaction costs on the outcome of the strategy.
Keywords:时间序列预测;随机森林回归;量化交易;遗传算法