Search for a command to run...
Aiming at the high volatility characteristics of gold and bitcoin, this paper proposes a quantitative trading framework of “Hierarchical Fusion Long and Short-term Memory Network (HFLSTM)-Dynamic Programming-Particle Swarm Optimization (PSO)”. We extract the short-term fluctuation (1-5 days), medium-term trend (1-2 weeks) and longterm cycle (<tex xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">$1-3$</tex> months) characteristics of the price through the three-layer LSTM network, and realize the price prediction in the next three days, and the predicted <tex xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">$\mathbf{R}^{\mathbf{2}}$</tex> of gold and bitcoin reaches 0.99 and 0.92 respectively. Based on the prediction results, we construct a dynamic planning model aiming to maximize the Sharpe ratio, and then use particle swarm algorithm to accelerate the dynamic planning model by combining the transaction cost, non-negative position, and other constraints, and use particle swarm algorithm to optimize the price. The particle swarm optimization algorithm is used to accelerate the solution of the daily optimal asset allocation, and design three types of strategies: aggressive, robust, and balanced through the risk preference coefficient <tex xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">$\mathbf{\alpha}$</tex>. The backtests in 20182021 show that the final returns of the initial <tex xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">$\mathbf{\$ 1,000}$</tex> investment in the three types of strategies are <tex xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">$\$20,560,265.49, \$1,237.22$</tex>, and <tex xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">$\$4,253.99$</tex>, respectively. It is found that every 0.5 % increase in transaction costs decreases final returns by 12.3 % on average, with high-frequency trading strategies being more sensitive to rates. Future research could introduce an attention mechanism to enhance the ability to predict extreme events and expand to multiple asset classes to enhance generalizability.