Stock Market Sentiment Classification and Backtesting via Fine-tuned BERT

Jiashu Lou
2023-09-21
Abstract:With the rapid development of big data and computing devices, low-latency automatic trading platforms based on real-time information acquisition have become the main components of the stock trading market, so the topic of quantitative trading has received widespread attention. And for non-strongly efficient trading markets, human emotions and expectations always dominate market trends and trading decisions. Therefore, this paper starts from the theory of emotion, taking East Money as an example, crawling user comment titles data from its corresponding stock bar and performing data cleaning. Subsequently, a natural language processing model BERT was constructed, and the BERT model was fine-tuned using existing annotated data sets. The experimental results show that the fine-tuned model has different degrees of performance improvement compared to the original model and the baseline model. Subsequently, based on the above model, the user comment data crawled is labeled with emotional polarity, and the obtained label information is combined with the Alpha191 model to participate in regression, and significant regression results are obtained. Subsequently, the regression model is used to predict the average price change for the next five days, and use it as a signal to guide automatic trading. The experimental results show that the incorporation of emotional factors increased the return rate by 73.8\% compared to the baseline during the trading period, and by 32.41\% compared to the original alpha191 model. Finally, we discuss the advantages and disadvantages of incorporating emotional factors into quantitative trading, and give possible directions for further research in the future.
Computational Finance,Computation and Language,Machine Learning
What problem does this paper attempt to address?
The main objective of this paper is to improve quantitative trading strategies in the stock market through sentiment analysis. Specifically, the authors utilize user comment title data from Eastmoney Stock Bar, applying natural language processing techniques and machine learning algorithms (such as the BERT model) for sentiment analysis. They use sentiment polarity values as trading signal factors to develop an automated trading system. The study finds that combining sentiment factors with the traditional Alpha191 factor model can significantly enhance investment returns. Compared to using the Alpha191 factor alone or an investment strategy based solely on sentiment factors, the hybrid strategy performs the best. This indicates that sentiment information plays a complementary role in stock trading decisions, helping investors better understand market conditions and formulate effective investment strategies. Additionally, the paper discusses the advantages and limitations of sentiment factors in quantitative trading and proposes future research directions.