| Portfolio selection is an important branch of the quantitative investment field,and its essence is to obtain high returns by allocating asset weights.At present,the process of economic integration is accelerating,financial data explosion and market fluctuations are frequent.Traditional investment decisions have problems such as weak pertinence and low accuracy,which can no longer meet the needs of investors.With the rapid development of online learning algorithms,how to construct online portfolio selection based on machine learning algorithms to achieve portfolio optimization with high yield and low risk has become the focus of quantitative investment.In this paper,an online portfolio optimization model based on machine learning is proposed to dynamically allocate asset weights and construct optimal portfolio strategies.In this paper,a long short-term memory neural network model based on particle swarm optimization is established to quantify stock returns and risks.Firstly,considering the stability of stocks and the factors affecting stocks,17 stocks and 16 indicators were screened,and the dimensionality reduction and characteristic information were extracted through principal component analysis.Secondly,the LSTM and PSO+LSTM were constructed to predict the logarithmic return of stocks,and the evaluation indicators ofR~2,MSE,EVAR and MAE models were compared and evaluated.It was found that the PSO effect was significant and the model accuracy was higher.Finally,the stock yield covariance matrix is adjusted by eigenvalues,and the effect is measured according to the deviation statistic defined by Barra.Based on the quantification of benefits and risks,the online portfolio strategy is constructed and empirically analyzed by the multi-armed gambling machine algorithm.Firstly,through the control experiments of FTL algorithm and UCB algorithm,it is found that UCB produces less cumulative regrets than FTL,which is more suitable for this study.Secondly,after constructing an online portfolio model based on UCB algorithm,this paper adds a benchmark strategy to empirically analyze the constituents of the SSE 50 Index.The study found that the cumulative return of the constructed online model increased by 13.6%,the annualized rate of return increased by 77.2%,the Sharpe ratio increased by 8 times,and the maximum drawdown rate was controlled within 15%.This paper has certain innovations in principal component dimensionality reduction multi-index,particle swarm optimization long short-term memory neural network,Monte Carlo simulation eigenvalue optimization covariance matrix,etc.The proposed online portfolio optimization model based on machine learning can better adapt to the real-time changing market and provide investors with appropriate investment decisions. |