A structured multi-head attention prediction method based on heterogeneous financial data

PeerJ Comput Sci. 2023 Nov 17:9:e1653. doi: 10.7717/peerj-cs.1653. eCollection 2023.

Abstract

The diverse characteristics of heterogeneous data pose challenges in analyzing combined price and volume data. Therefore, appropriately handling heterogeneous financial data is crucial for accurate stock prediction. This article proposes a model that applies customized data processing methods tailored to the characteristics of different types of heterogeneous financial data, enabling finer granularity and improved feature extraction. By utilizing the structured multi-head attention mechanism, the model captures the impact of heterogeneous financial data on stock price trends by extracting data information from technical, financial, and sentiment indicators separately. Experimental results conducted on four representative individual stocks in China's A-share market demonstrate the effectiveness of the proposed method. The model achieves an average MAPE of 1.378%, which is 0.429% lower than the benchmark algorithm. Moreover, the backtesting return rate exhibits an average increase of 28.56%. These results validate that the customized preprocessing method and structured multi-head attention mechanism can enhance prediction accuracy by attending to different types of heterogeneous data individually.

Keywords: Heterogeneous financial dat; Stock prediction; Structured multi-head attention.

Grants and funding

This research was funded by the Major Humanities and Social Sciences Research Projects in Zhejiang Higher Education Institutions, Grant Number 2023QN082 and the National Natural Science Foundation of China, Grant Number 61902349. The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript.