WO2022105016A1 - Stock price trend prediction method and system, terminal, and storage medium - Google Patents

Stock price trend prediction method and system, terminal, and storage medium Download PDF

Info

Publication number
WO2022105016A1
WO2022105016A1 PCT/CN2020/139674 CN2020139674W WO2022105016A1 WO 2022105016 A1 WO2022105016 A1 WO 2022105016A1 CN 2020139674 W CN2020139674 W CN 2020139674W WO 2022105016 A1 WO2022105016 A1 WO 2022105016A1
Authority
WO
WIPO (PCT)
Prior art keywords
stock
price
graph
feature
neural network
Prior art date
Application number
PCT/CN2020/139674
Other languages
French (fr)
Chinese (zh)
Inventor
叶洁瑕
赵娟娟
叶可江
须成忠
Original Assignee
中国科学院深圳先进技术研究院
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中国科学院深圳先进技术研究院 filed Critical 中国科学院深圳先进技术研究院
Publication of WO2022105016A1 publication Critical patent/WO2022105016A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/067Enterprise or organisation modelling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/06Asset management; Financial planning or analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Strategic Management (AREA)
  • Economics (AREA)
  • Human Resources & Organizations (AREA)
  • General Physics & Mathematics (AREA)
  • Development Economics (AREA)
  • Marketing (AREA)
  • General Business, Economics & Management (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Operations Research (AREA)
  • Game Theory and Decision Science (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Linguistics (AREA)
  • Mathematical Physics (AREA)
  • General Engineering & Computer Science (AREA)
  • Computing Systems (AREA)
  • Molecular Biology (AREA)
  • General Health & Medical Sciences (AREA)
  • Technology Law (AREA)
  • Evolutionary Computation (AREA)
  • Software Systems (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Quality & Reliability (AREA)
  • Tourism & Hospitality (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Educational Administration (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

A stock price trend prediction method and system, a terminal, and a storage medium. The method comprises: obtaining an original price feature of a stock set in a predetermined number of historical trading days; constructing a stock right network relationship graph of the stock set, each vertex of the stock right network relationship graph corresponding to one stock; inputting a historical price feature of the stock set and the stock right network relationship graph into a deep learning model, the deep learning model being used for performing feature aggregation and nonlinear transformation on vertices of the stock right network relationship graph by means of a graph convolutional neural network, extracting an interaction between the vertices of the stock right network relationship graph, and constructing a new price feature of the stock set; combining the new price feature and the original price feature of the stock set and then inputting same to a gated recurrent neural network, so as to obtain a new feature comprising a time series feature; and predicting a stock price trend of the stock set according to the new feature. The method can improve the accuracy of stock price trend prediction.

Description

一种股票价格走势预测方法、系统、终端以及存储介质A stock price trend prediction method, system, terminal and storage medium 技术领域technical field
本申请属于股票数据分析技术领域,特别涉及一种股票价格走势预测方法、系统、终端以及存储介质。The present application belongs to the technical field of stock data analysis, and in particular relates to a stock price trend prediction method, system, terminal and storage medium.
背景技术Background technique
随着中国经济的发展,股票市场随之不断壮大,越来越多的个人和机构投资者纷纷进入股票市场。股票市场的价格波动影响着投资者的收益,因而成为众多投资者的关注焦点。准确的股票价格预测能够带来巨大交易量和收益,然而股票市场异常复杂,股票价格变动受到多方面因素的影响,同时股票市场的数据繁多、冗杂,如何全面有效地挖掘出蕴藏在海量股票数据中的规律并准确预测股票价格走势成为一个热点技术问题。With the development of China's economy, the stock market has continued to grow, and more and more individual and institutional investors have entered the stock market. The price fluctuation of the stock market affects the income of investors, thus becoming the focus of many investors. Accurate stock price forecasts can bring huge trading volume and income. However, the stock market is extremely complex, and stock price changes are affected by many factors. At the same time, the stock market data is numerous and complicated. How to comprehensively and effectively mine the massive stock data contained in it? It has become a hot technical issue to accurately predict the trend of stock prices.
现有技术中,传统的股票数据分析方法主要包括:In the prior art, traditional stock data analysis methods mainly include:
(1)基本分析;基本分析基于传统经济学理论,通过详尽分析企业内在价值、宏观经济形势、行业发展前景、企业经营状态等信息,测算上市公司的长期投资价值和边际安全,形成投资建议。基本分析认为股价波动无法预测,只能在边际足够安全情况下买入股票并长期持有。(1) Fundamental analysis: Fundamental analysis is based on traditional economic theories, through detailed analysis of the company's intrinsic value, macroeconomic situation, industry development prospects, business status and other information, to calculate the long-term investment value and marginal safety of listed companies, and form investment recommendations. Fundamental analysis believes that stock price fluctuations are unpredictable, and stocks can only be bought with sufficient margins and held for a long time.
(2)技术分析;技术分析基于传统证券学理论,以股票价格为研究对象,研究股价变化的历史图表。它认为市场行为消化一切,股价波动可以定量分析和预测,主要理论有道氏理论、波浪理论、江恩理论等。(2) Technical analysis: Technical analysis is based on traditional securities theory, taking stock price as the research object, and studying the historical chart of stock price changes. It believes that market behavior digests everything, and stock price fluctuations can be quantitatively analyzed and predicted. The main theories are Dow Theory, Wave Theory, Gann Theory, etc.
(3)演化分析;演化分析基于演化证券学理论,将股市波动的生命运动特性作为研究对象,分析股市的代谢性、趋利性、可塑性等。它认为股价波动无法准确预测,转向为投资人建立一种全新的分析框架。(3) Evolutionary analysis: Based on evolutionary securities theory, evolutionary analysis takes the life movement characteristics of stock market fluctuations as the research object, and analyzes the metabolism, profit-seeking, and plasticity of the stock market. It believes that stock price volatility cannot be accurately predicted, and turned to a new analytical framework for investors.
上述的传统分析方法需要分析者具备专业的金融知识和丰富的股市交易经验。而大数据时代已经催生了一系列数理统计、机器学习、深度学习等新的方法和技术,这些技术降低了对专业知识的依赖,由数据驱动而挖掘出股票价格变动中隐藏的复杂规律,因而越来越受到关注。The above traditional analysis methods require analysts to have professional financial knowledge and rich stock market trading experience. The era of big data has spawned a series of new methods and technologies such as mathematical statistics, machine learning, and deep learning. These technologies have reduced the dependence on professional knowledge, and are driven by data to discover the hidden complex laws in stock price changes. more and more attention.
目前,常见的数理统计模型包括向量自回归(Vector autoregression,简称VAR)模型和条件自回归极差(Conditional autoregressive range,简称CARR)模型。但它们都需要分析股票的影响因素,一定程度上依赖于专家知识,同时它们只能简单拟合时间序列,无法处理更复杂的数据结构。At present, common mathematical statistical models include Vector autoregression (Vector autoregression, VAR for short) model and Conditional autoregressive range (Conditional autoregressive range, CARR for short) model. But they all need to analyze the influencing factors of stocks and rely on expert knowledge to a certain extent. At the same time, they can only simply fit time series and cannot handle more complex data structures.
传统的支持向量机、马尔科夫链等机器学习方法能对大量的历史数据建模训练,挖掘出隐藏于数据中的股价波动的高维非线性特征,实现对股票价格进行预测。然而它们无法模拟股票数据中的长期时序特征。Traditional machine learning methods such as support vector machines and Markov chains can model and train a large amount of historical data, mine high-dimensional nonlinear features of stock price fluctuations hidden in the data, and predict stock prices. However, they cannot simulate long-term time series characteristics in stock data.
深度学习方法中,循环神经网络(Recurrent Neural Network,简称RNN)及其变种可以对时间序列数据进行建模,提取股票数据中的长期依赖性。然而,该网络无法处理时序外的其他因素,比如股票之间由于各种经济业务的联系而产生的相互影响。Among deep learning methods, Recurrent Neural Network (RNN) and its variants can model time series data and extract long-term dependencies in stock data. However, the network cannot handle other factors outside the time series, such as the mutual influence between stocks due to the connection of various economic businesses.
发明内容SUMMARY OF THE INVENTION
本申请提供了一种股票价格走势预测方法、系统、终端以及存储介质,旨在至少在一定程度上解决现有技术中的上述技术问题之一。The present application provides a stock price trend prediction method, system, terminal and storage medium, aiming to solve one of the above technical problems in the prior art at least to a certain extent.
为了解决上述问题,本申请提供了如下技术方案:In order to solve the above problems, the application provides the following technical solutions:
一种股票价格走势预测方法,包括:A stock price trend prediction method, including:
获取股票集合在预定天数的历史交易日的原始价格特征;所述股票集合中至少包括两只股票;Obtain the original price characteristics of the stock set on the historical trading days of the predetermined number of days; the stock set includes at least two stocks;
基于先验知识构建所述股票集合的股权网络关系图,所述股权网络关系图中的每一个顶点分别对应一只股票;Construct an equity network relationship graph of the stock set based on prior knowledge, and each vertex in the equity network relationship graph corresponds to a stock respectively;
将所述股票集合的历史价格特征以及股权网络关系图输入深度学习模型,所述深度学习模型通过图卷积神经网络对所述股权网络关系图上的顶点进行特征聚合和非线性变换,提取所述股权网络关系图上各顶点之间的相互作用,并构建所述股票集合的新价格特征;The historical price features of the stock set and the equity network relationship graph are input into the deep learning model, and the deep learning model performs feature aggregation and nonlinear transformation on the vertices on the equity network relationship graph through the graph convolutional neural network, and extracts all the vertices. The interaction between the vertices on the equity network relationship graph, and construct the new price feature of the stock set;
将所述股票集合的新价格特征与原始价格特征拼接后输入门控循环神经网络,通过所述门控循环神经网络输出包含时间序列特征的新特征;After splicing the new price feature of the stock set with the original price feature, input the gated recurrent neural network, and output the new feature including the time series feature through the gated recurrent neural network;
根据所述包含时间序列特征的新特征对所述股票集合的股票价格走势进行预测。The stock price trend of the stock set is predicted according to the new feature including the time series feature.
本申请实施例采取的技术方案还包括:所述获取股票集合在预定天数个历史交易日的原始价格特征包括:The technical solution adopted in the embodiment of the present application further includes: the acquisition of the original price characteristics of the stock set in a predetermined number of historical trading days includes:
对所述原始价格特征进行Z-score归一化处理;Perform Z-score normalization processing on the original price feature;
所述原始价格特征包括收盘价、开盘价、交易量以及交易换手率。The original price characteristics include closing price, opening price, trading volume, and trading turnover.
本申请实施例采取的技术方案还包括:所述股权网络关系图包括股权关系图、行业关系图以及话题关系图,具体为:The technical solutions adopted in the embodiments of the present application further include: the equity network relationship diagram includes an equity relationship diagram, an industry relationship diagram, and a topic relationship diagram, specifically:
G S=(V,E S,A S) G S =(V,E S ,A S )
G I=(V,E I,A I) G I =(V,E I ,A I )
G T=(V,E T,A T) G T =(V,E T ,A T )
上述公式中,G S为股权关系图、G I为行业关系图,G T为话题关系图;V={v 1,…,v N}是图的顶点集,v i是第i th个顶点,共有N个顶点,每个图的顶点集都相同,为股票集合S;E是图边集,每条边表示股票之间的连接关系,不同的股票图边集不同;A=(a ij) N×N是图的邻接矩阵,矩阵的元素a ij是边的权重,代表股票i与股票j之间的影响因子。 In the above formula, G S is the equity relationship diagram, G I is the industry relationship diagram, and GT is the topic relationship diagram; V={v 1 ,...,v N } is the vertex set of the graph, and v i is the ith vertex , there are N vertices in total, and the vertex sets of each graph are the same, which is the stock set S; E is the graph edge set, each edge represents the connection relationship between stocks, and the edge sets of different stock graphs are different; A=(a ij ) N×N is the adjacency matrix of the graph, and the element a ij of the matrix is the weight of the edge, which represents the influence factor between stock i and stock j.
本申请实施例采取的技术方案还包括:所述图卷积神经网络对所述股权网络关系图上的顶点进行特征聚合和非线性变换具体为:The technical solutions adopted in the embodiments of the present application further include: the graph convolutional neural network performs feature aggregation and nonlinear transformation on the vertices on the equity network relationship graph, specifically:
根据所述股票网络关系图的拉普拉斯矩阵提取股票集合在各个关系图中的相互作用,所述图卷积神经网络的每一层公式为:The interaction of the stock set in each relation graph is extracted according to the Laplacian matrix of the stock network relation graph. The formula of each layer of the graph convolutional neural network is:
Figure PCTCN2020139674-appb-000001
Figure PCTCN2020139674-appb-000001
上述公式中,拉普拉斯矩阵{L S,L I,L T}对应的邻接矩阵为{A S,A I,A T},
Figure PCTCN2020139674-appb-000002
I N为单位矩阵,D是A的邻接矩阵;
Figure PCTCN2020139674-appb-000003
Figure PCTCN2020139674-appb-000004
为可训练参数,K是拉普拉斯矩阵的阶数,表示图卷积的半径,θ k是第k阶拉普拉斯矩阵的可训练系数;ρ是激活函数,
Figure PCTCN2020139674-appb-000005
是第l层的可训练参数,
Figure PCTCN2020139674-appb-000006
是图卷积神经网络的第l层,
Figure PCTCN2020139674-appb-000007
是股票集合S在第t天的原始价格特征,每只股票包括F个原始价格特征;
In the above formula, the adjacency matrix corresponding to the Laplacian matrix {L S , L I , L T } is {A S , A I , A T },
Figure PCTCN2020139674-appb-000002
I N is the identity matrix, D is the adjacency matrix of A;
Figure PCTCN2020139674-appb-000003
Figure PCTCN2020139674-appb-000004
is a trainable parameter, K is the order of the Laplacian matrix, indicating the radius of the graph convolution, θ k is the trainable coefficient of the k-th order Laplacian matrix; ρ is the activation function,
Figure PCTCN2020139674-appb-000005
are the trainable parameters of the lth layer,
Figure PCTCN2020139674-appb-000006
is the first layer of the graph convolutional neural network,
Figure PCTCN2020139674-appb-000007
is the original price feature of the stock set S on day t, and each stock includes F original price features;
所述原始价格特征
Figure PCTCN2020139674-appb-000008
经过图卷积神经网络后输出的新价格特征为
Figure PCTCN2020139674-appb-000009
每只股票包括C个新价格特征。
The original price feature
Figure PCTCN2020139674-appb-000008
The new price feature output after the graph convolutional neural network is
Figure PCTCN2020139674-appb-000009
Each stock includes C new price features.
本申请实施例采取的技术方案还包括:所述通过所述门控循环神经网络的隐藏层为:The technical solutions adopted in the embodiments of the present application further include: the hidden layer passing through the gated recurrent neural network is:
Figure PCTCN2020139674-appb-000010
Figure PCTCN2020139674-appb-000010
Figure PCTCN2020139674-appb-000011
Figure PCTCN2020139674-appb-000011
Figure PCTCN2020139674-appb-000012
Figure PCTCN2020139674-appb-000012
Figure PCTCN2020139674-appb-000013
Figure PCTCN2020139674-appb-000013
上述公式中,输入时间步t∈[d-P+1,…,d-1],
Figure PCTCN2020139674-appb-000014
是所述门控循环神经网络在输入时间步t-1的隐藏层状态,r t是复位门,u t是更新门;σ∈[0,1]是激活函数,·是矩阵乘法,⊙是哈夫曼乘积;{W r,W u,W h}是可训练的权重参数,{b r,b u,b h}是可训练的偏置项;所述门控循环神经网络的输出层是
Figure PCTCN2020139674-appb-000015
其中
Figure PCTCN2020139674-appb-000016
每只股票包括G个新特征。
In the above formula, the input time step t∈[d-P+1,...,d-1],
Figure PCTCN2020139674-appb-000014
is the hidden layer state of the gated recurrent neural network at the input time step t-1, r t is the reset gate, u t is the update gate; σ∈[0,1] is the activation function, ⋅ is the matrix multiplication, ⊙ is Huffman product; {W r ,W u ,W h } are trainable weight parameters, { br , bu ,b h } are trainable bias terms; the output layer of the gated recurrent neural network Yes
Figure PCTCN2020139674-appb-000015
in
Figure PCTCN2020139674-appb-000016
Each stock includes G new features.
本申请实施例采取的技术方案还包括:所述根据所述包含时间序列特征的新特征对所述股票集合的股票价格走势进行预测具体为:The technical solution adopted in the embodiment of the present application further includes: the prediction of the stock price trend of the stock set according to the new feature including the time series feature is specifically:
将所述门控循环神经网络输出的新特征输入到带有Sigmoid激活函数的全连接层,通过所述全连接层生成股票集合的涨跌概率,公式如下:The new features output by the gated recurrent neural network are input into the fully connected layer with the sigmoid activation function, and the probability of rising and falling of the stock set is generated through the fully connected layer. The formula is as follows:
Figure PCTCN2020139674-appb-000017
Figure PCTCN2020139674-appb-000017
上述公式中,
Figure PCTCN2020139674-appb-000018
是股票集合S在第d天的股票涨跌趋势,
Figure PCTCN2020139674-appb-000019
是对股票i在第d天的涨跌趋势预测;
Figure PCTCN2020139674-appb-000020
是可训练参数。
In the above formula,
Figure PCTCN2020139674-appb-000018
is the stock rise and fall trend of the stock set S on the d day,
Figure PCTCN2020139674-appb-000019
is the forecast of the rising and falling trend of stock i on the d day;
Figure PCTCN2020139674-appb-000020
are trainable parameters.
本申请实施例采取的技术方案还包括:所述深度学习模型使用交叉熵为损失函数,具体如下:The technical solutions adopted in the embodiments of the present application further include: the deep learning model uses cross-entropy as a loss function, specifically as follows:
Figure PCTCN2020139674-appb-000021
Figure PCTCN2020139674-appb-000021
上述公式中,
Figure PCTCN2020139674-appb-000022
是股票s在第d天的真实价格走势值,所述真实价格走势值为该股票在第t天的开盘价与前一天的开盘价的差距比例。
In the above formula,
Figure PCTCN2020139674-appb-000022
is the real price trend value of the stock s on the d day, and the real price trend value is the ratio of the gap between the opening price of the stock on the t day and the opening price of the previous day.
本申请实施例采取的另一技术方案为:一种股票价格走势预测系统,包括:Another technical solution adopted by the embodiment of the present application is: a stock price trend prediction system, comprising:
数据获取模块:用于获取股票集合在预定天数的历史交易日的原始价格特征;所述股票集合中至少包括两只股票;Data acquisition module: used to acquire the original price characteristics of a stock set on historical trading days of a predetermined number of days; the stock set includes at least two stocks;
关系图构建模块:用于基于先验知识构建所述股票集合的股权网络关系图,所述股权网络关系图中的每一个顶点分别对应一只股票;Relationship graph building module: used to construct an equity network relationship graph of the stock set based on prior knowledge, and each vertex in the equity network relationship graph corresponds to a stock respectively;
图卷积模块:用于将所述股票集合的历史价格特征以及股权网络关系图输入深度学习模型,所述深度学习模型通过图卷积神经网络对所述股权网络关系图上的顶点进行特征聚合和非线性变换,提取所述股权网络关系图上各顶点之间的相互作用,并构建所述股票集合的新价格特征;Graph convolution module: used to input the historical price features of the stock set and the equity network relationship graph into a deep learning model, and the deep learning model performs feature aggregation on the vertices on the equity network relationship graph through a graph convolutional neural network and nonlinear transformation, extract the interaction between the vertices on the equity network relationship graph, and construct the new price feature of the stock set;
时序特征提取模块:用于将所述股票集合的新价格特征与原始价格特征拼接后输入门控循环神经网络,通过所述门控循环神经网络输出包含时间序列特征的新特征;Time series feature extraction module: used to input the gated recurrent neural network after splicing the new price features of the stock set with the original price features, and output new features including time series features through the gated recurrent neural network;
结果输出模块:用于根据所述包含时间序列特征的新特征对所述股票集合的股票价格走势进行预测。Result output module: used to predict the stock price trend of the stock set according to the new feature including time series features.
本申请实施例采取的又一技术方案为:一种终端,所述终端包括处理器、与所述处理器耦接的存储器,其中,Another technical solution adopted by the embodiments of the present application is: a terminal, the terminal includes a processor and a memory coupled to the processor, wherein,
所述存储器存储有用于实现所述股票价格走势预测方法的程序指令;The memory stores program instructions for implementing the stock price trend prediction method;
所述处理器用于执行所述存储器存储的所述程序指令以控制股票价格走势预测。The processor is configured to execute the program instructions stored in the memory to control stock price trend prediction.
本申请实施例采取的又一技术方案为:一种存储介质,存储有处理器可运行的程序指令,所述程序指令用于执行所述股票价格走势预测方法。Another technical solution adopted by the embodiments of the present application is: a storage medium storing program instructions executable by a processor, where the program instructions are used to execute the stock price trend prediction method.
相对于现有技术,本申请实施例产生的有益效果在于:本申请实施例的股票 价格走势预测方法、系统、终端及存储介质通过多角度(股权、行业、话题)去刻画股票之间的关系,并结合股票的历史价格特征,使用图卷积神经网络提取股票价格之间的交叉影响,捕获股票价格之间的相互作用,并基于此构建新的价格特征。将新的价格特征和历史价格特征拼接后通过门控循环神经网络提取股票的时序特征和交叉影响特征,进而进行股票价格走势预测。本发明实施例充分考虑了股票价格之间的相互作用对股票涨跌的影响,并提取了价格数据中的时序特征和交叉影响特征,从而大大提高股票价格走势预测的精度。Compared with the prior art, the beneficial effects of the embodiments of the present application are: the stock price trend prediction method, system, terminal and storage medium of the embodiments of the present application describe the relationship between stocks from multiple perspectives (equity, industry, topic). , and combined with the historical price features of stocks, using graph convolutional neural network to extract the cross influence between stock prices, capture the interaction between stock prices, and build new price features based on this. After splicing the new price features and historical price features, the time series features and cross-influence features of the stock are extracted through the gated recurrent neural network, and then the stock price trend prediction is carried out. The embodiment of the present invention fully considers the influence of the interaction between stock prices on the ups and downs of stocks, and extracts the time series features and cross-influence features in the price data, thereby greatly improving the accuracy of stock price trend prediction.
附图说明Description of drawings
图1是本申请实施例基于图的深度学习模型的系统原理图;FIG. 1 is a system schematic diagram of a deep learning model based on a diagram in an embodiment of the present application;
图2是本申请实施例的股票价格走势预测方法的流程图;Fig. 2 is the flow chart of the stock price trend prediction method of the embodiment of the present application;
图3为本申请实施例的股票价格走势预测系统结构示意图;3 is a schematic structural diagram of a stock price trend prediction system according to an embodiment of the application;
图4为本申请实施例的终端结构示意图;FIG. 4 is a schematic structural diagram of a terminal according to an embodiment of the present application;
图5为本申请实施例的存储介质的结构示意图。FIG. 5 is a schematic structural diagram of a storage medium according to an embodiment of the present application.
具体实施方式Detailed ways
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application will be described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application.
针对现有技术的不足,本申请实施例的股票价格走势预测方法通过搭建一个基于图的深度学习模型,将相互影响的股票基于三种关系网络构建为股权关系图、行业关系图和话题关系图。在各个图上,结合股票的历史价格特征,使用图卷积 神经网络模拟股票价格之间的交叉影响,捕获股票价格之间的相互作用,并基于此构建新的价格特征。将新的价格特征和历史价格特征一起输入门控循环神经网络中提取股票的时序特征和交叉影响特征,进而进行股票价格走势预测。如图1所示,是本申请实施例基于图的深度学习模型的系统原理图。模型公式如下:In view of the deficiencies of the prior art, the stock price trend prediction method of the embodiment of the present application builds a deep learning model based on a graph, and constructs a stock relationship diagram, an industry relationship diagram and a topic relationship diagram based on three relationship networks for the stocks that affect each other. . On each graph, combined with the historical price features of the stock, a graph convolutional neural network is used to simulate the cross influence between stock prices, capture the interaction between stock prices, and build new price features based on this. The new price features and historical price features are input into the gated recurrent neural network to extract the time series features and cross-influence features of the stock, and then predict the stock price trend. As shown in FIG. 1 , it is a system schematic diagram of a graph-based deep learning model according to an embodiment of the present application. The model formula is as follows:
Figure PCTCN2020139674-appb-000023
Figure PCTCN2020139674-appb-000023
式(1)中,d为预测股票价格走势的交易日,P为用于预测的历史交易日天数,
Figure PCTCN2020139674-appb-000024
是模型输出的股票集合S在交易日d的股票价格走势预测结果。G为股票集合S的股权网络关系图,Θ为模型的可训练参数。
In formula (1), d is the trading day for predicting the stock price trend, P is the number of historical trading days used for prediction,
Figure PCTCN2020139674-appb-000024
is the prediction result of the stock price trend of the stock set S output by the model on the trading day d. G is the equity network relationship graph of the stock set S, and Θ is the trainable parameter of the model.
图1中,深度学习模型包括多关系驱动的图卷积神经网络Multi-GCN、门控循环神经网络GRU和全连接层FC。模型的输入为股票集合S在过去P个交易日的历史价格数据以及股票集合S的股权网络关系图,经过图卷积神经网络Multi-GCN聚合后输出股票集合S的新价格特征,将股票集合S的原始价格特征和新价格特征进行拼接后得到总价格特征,将总价格特征输入门控循环神经网络GRU提取股票的时间序列特征,并输出股票集合S的新特征,将新特征输入带有Sigmoid激活函数的全连接层FC,得到股票集合S在第d天的股票价格走势预测结果。In Figure 1, the deep learning model includes a multi-relation-driven graph convolutional neural network Multi-GCN, a gated recurrent neural network GRU, and a fully connected layer FC. The input of the model is the historical price data of the stock set S in the past P trading days and the equity network relationship diagram of the stock set S. After the graph convolutional neural network Multi-GCN aggregation, the new price features of the stock set S are output, and the stock set S is aggregated. After splicing the original price features and new price features of S, the total price features are obtained, and the total price features are input into the gated recurrent neural network GRU to extract the time series features of stocks, and the new features of the stock set S are output, and the new features are input with The fully connected layer FC of the sigmoid activation function obtains the prediction result of the stock price trend of the stock set S on the d day.
请参阅图2,是本申请实施例的股票价格走势预测方法的流程图。本申请实施例的股票价格走势预测方法包括以下步骤:Please refer to FIG. 2 , which is a flowchart of a method for predicting a stock price trend according to an embodiment of the present application. The stock price trend prediction method in the embodiment of the present application includes the following steps:
S10:获取股票集合S在过去P个历史交易日的原始价格特征,并对原始价格特征进行Z-score归一化处理;S10: Obtain the original price characteristics of the stock set S in the past P historical trading days, and perform Z-score normalization processing on the original price characteristics;
本步骤中,股票集合S中包括N只股票,每只股票有F个原始价格特征,原始价格特征包括但不限于收盘价、开盘价、交易量以及交易换手率等。In this step, the stock set S includes N stocks, each stock has F original price characteristics, and the original price characteristics include but are not limited to closing price, opening price, trading volume, and trading turnover rate.
S20:基于先验知识构建股票集合S中各只股票之间的影响关系,基于影响 关系构建股票集合S的股权网络关系图;S20: construct the influence relationship between the stocks in the stock set S based on the prior knowledge, and construct the equity network relationship diagram of the stock set S based on the influence relationship;
本步骤中,通过基于先验知识构建的股权网络关系图包括股权关系图、行业关系图以及话题关系图,可以刻画股票集合S中各只股票之间复杂的交叉影响。股权关系图、行业关系图以及话题关系图具体如下:In this step, through the equity network relationship diagram constructed based on prior knowledge, including the equity relationship diagram, the industry relationship diagram, and the topic relationship diagram, the complex cross-influence among the stocks in the stock set S can be depicted. The equity relationship diagram, industry relationship diagram and topic relationship diagram are as follows:
G S=(V,E S,A S)  (2) G S =(V,E S ,A S ) (2)
G I=(V,E I,A I)  (3) G I =(V,E I ,A I ) (3)
G T=(V,E T,A T)  (4) G T = (V, E T , A T ) (4)
公式(2)、(3)、(4)中,G S为股权关系图、G I为行业关系图,G T为话题关系图。V={v 1,…,v N}是图的顶点集,v i是第i th个顶点,每个顶点对应一支股票,共有N个顶点(即N只股票),每个图的顶点集都相同,为股票集合S。E是图边集,每条边表示股票之间的连接关系,不同的股票图边集不同。A=(a ij) N×N是图的邻接矩阵,矩阵的元素a ij是边的权重,代表股票i与股票j之间的影响因子,即价格相互影响的强度,不同的股票图的邻接矩阵也不同。 In formulas (2), (3) and (4), G S is the equity relationship diagram, G I is the industry relationship diagram, and G T is the topic relationship diagram. V={v 1 ,...,v N } is the vertex set of the graph, v i is the ith vertex, each vertex corresponds to a stock, there are a total of N vertices (ie N stocks), the vertex of each graph The sets are all the same, which is the stock set S. E is a graph edge set, each edge represents the connection relationship between stocks, and different stock graph edge sets are different. A=(a ij ) N×N is the adjacency matrix of the graph, the element a ij of the matrix is the weight of the edge, which represents the influence factor between stock i and stock j, that is, the strength of the mutual influence of prices, the adjacency of different stock graphs The matrix is also different.
进一步地,股权关系图用于反映股票之间由于其公司相互持股而产生的价格相互影响的现象。例如,如果两家上市公司i和j之间有股权关系,则i和j所对应的股票之间存在有向边,边的权重为持股比例;反之,如果两家上市公司之间没有股权关系,则它们之间不存在边。股权比例的取值是[0,1],边的取值也是a ij=[0,1]。 Further, the equity relationship diagram is used to reflect the phenomenon that the prices of stocks affect each other due to the mutual shareholding of their companies. For example, if there is an equity relationship between two listed companies i and j, there is a directed edge between the stocks corresponding to i and j, and the weight of the edge is the shareholding ratio; conversely, if there is no equity between the two listed companies relationship, there is no edge between them. The value of the equity ratio is [0,1], and the value of the edge is also a ij =[0,1].
行业关系图用于反映股票之间由于所在行业以及公司规模所带来的股票价格相互作用。股票市场存在著名的超前-滞后现象,即行业内一些龙头股票超前或滞后地对其他股票价格造成的影响。超前-滞后现象的一个理论解释是股票市场上新的信息一般会反映在龙头股票的交易中,然后再传导到其他股票,且在同 一个行业内,规模大的龙头股票价格一般引领着规模小的股票发生变化。基于该理论,本发明实施例根据以下规则分析股票之间由于所在行业以及公司规模所带来的股票价格相互作用:如果两家上市公司i和j位于不同行业,则它们的股票价格相互影响强度为a ij=0,否则影响强度为
Figure PCTCN2020139674-appb-000025
其中M为公司规模,可以用公司的注册资本进行衡量。同时,如果M i与M j之间的差值越高,表示公司i对公司j的影响强度a ij越高,而公司j对公司i的影响强度a ji越弱。
The industry relationship graph is used to reflect the stock price interaction between stocks due to their industry and company size. There is a well-known lead-lag phenomenon in the stock market, that is, the impact of some leading stocks in the industry on the prices of other stocks ahead or lags behind. A theoretical explanation for the lead-lag phenomenon is that new information in the stock market is generally reflected in the transactions of leading stocks, and then transmitted to other stocks, and in the same industry, the prices of large leading stocks generally lead the smaller stocks. stock changes. Based on this theory, the embodiment of the present invention analyzes the stock price interaction between stocks due to their industry and company size according to the following rules: If two listed companies i and j are located in different industries, then their stock price interaction strength is a ij =0, otherwise the influence strength is
Figure PCTCN2020139674-appb-000025
Among them, M is the size of the company, which can be measured by the company's registered capital. At the same time, if the difference between M i and M j is higher, it means that the influence intensity a ij of company i on company j is higher, and the influence intensity a ji of company j on company i is weaker.
话题关系图用于反映新闻等话题对股票价格的显著影响。通常,一只股票会对类似的、属于同一个话题的新闻作出反应。同时,同一话题的新闻会影响一群相关股票,引发股票相似的波动。例如,2019的新冠病毒新闻影响了医药类股票、娱乐类股票以及餐饮类股票。本发明实施例用股票的拥有的共同概念数目表示话题关系,从而刻画股票之间由于受到相同话题影响而在价格上出现的相似的波动趋势。具体为:如果上市公司i拥有M i个概念,上市公司j拥有M j个概念,它们的共同概念数目为T ij,那么公司i对公司j的影响因子
Figure PCTCN2020139674-appb-000026
公司j对公司i的影响因子为
Figure PCTCN2020139674-appb-000027
如果两个公司之间没有共同概念数目,则它们之间的相互影响因子为0。
Topic graphs are used to reflect the significant impact of topics such as news on stock prices. Often, a stock will react to similar news that belongs to the same topic. At the same time, news on the same topic can affect a group of related stocks, triggering similar volatility in the stocks. For example, the 2019 coronavirus news affected pharmaceutical stocks, entertainment stocks, and restaurant stocks. In the embodiment of the present invention, the topic relationship is represented by the number of common concepts owned by stocks, so as to describe the similar fluctuation trends in prices between stocks due to the influence of the same topic. Specifically: if listed company i has M i concepts and listed company j has M j concepts, and the number of their common concepts is T ij , then the impact factor of company i on company j
Figure PCTCN2020139674-appb-000026
The influence factor of company j on company i is
Figure PCTCN2020139674-appb-000027
If there is no number of concepts in common between two companies, the mutual influence factor between them is 0.
S30:将股票集合S在过去P个交易日的历史价格特征以及股票集合S的股权网络关系图输入深度学习模型,深度学习模型通过图卷积神经网络对各个图上的顶点进行特征聚合和非线性变换,提取到各个图上各顶点之间的相互作用,构建每个历史交易日t中包含股票之间相互作用的新价格特征;S30: Input the historical price features of the stock set S in the past P trading days and the equity network relationship graph of the stock set S into the deep learning model, and the deep learning model performs feature aggregation and non-discrimination on the vertices on each graph through the graph convolutional neural network. Linear transformation, extracting the interaction between the vertices on each graph, and constructing a new price feature including the interaction between stocks in each historical trading day t;
本步骤中,图卷积神经网络根据股票网络关系图的拉普拉斯矩阵提取股票在各种关系图中的相互作用,图卷积神经网络的每一层公式如下:In this step, the graph convolutional neural network extracts the interaction of stocks in various relational graphs according to the Laplacian matrix of the stock network relation graph. The formula of each layer of the graph convolutional neural network is as follows:
Figure PCTCN2020139674-appb-000028
Figure PCTCN2020139674-appb-000028
公式(5)中,拉普拉斯矩阵{L S,L I,L T}对应的邻接矩阵为{A S,A I,A T},
Figure PCTCN2020139674-appb-000029
I N为单位矩阵,D是A的邻接矩阵。
Figure PCTCN2020139674-appb-000030
Figure PCTCN2020139674-appb-000031
为可训练参数,K是拉普拉斯矩阵的阶数,表示图卷积的半径,θ k是第k阶拉普拉斯矩阵的可训练系数。ρ是激活函数,如ReLU,Sigmoid。
Figure PCTCN2020139674-appb-000032
是第l层的可训练参数。
Figure PCTCN2020139674-appb-000033
是图卷积神经网络的第l层,
Figure PCTCN2020139674-appb-000034
Figure PCTCN2020139674-appb-000035
是股票集合S在第t天的原始价格特征,每只股票包括F个原始价格特征。本发明实施例中,图卷积神经网络包括三层,拉普拉斯阶数K=3。
In formula (5), the adjacency matrix corresponding to the Laplacian matrix {L S , L I , L T } is {A S , A I , A T },
Figure PCTCN2020139674-appb-000029
I N is the identity matrix, and D is the adjacency matrix of A.
Figure PCTCN2020139674-appb-000030
Figure PCTCN2020139674-appb-000031
is the trainable parameter, K is the order of the Laplacian matrix, which represents the radius of the graph convolution, and θ k is the trainable coefficient of the k-th order Laplacian matrix. ρ is the activation function, such as ReLU, Sigmoid.
Figure PCTCN2020139674-appb-000032
are the trainable parameters of the lth layer.
Figure PCTCN2020139674-appb-000033
is the first layer of the graph convolutional neural network,
Figure PCTCN2020139674-appb-000034
Figure PCTCN2020139674-appb-000035
is the original price feature of the stock set S on day t, and each stock includes F original price features. In the embodiment of the present invention, the graph convolutional neural network includes three layers, and the Laplace order is K=3.
在第t个交易日的原始价格特征
Figure PCTCN2020139674-appb-000036
经过图卷积神经网络后输出的新价格特征为
Figure PCTCN2020139674-appb-000037
每只股票有C个新价格特征,该新价格特征包含了股票之间的相互作用。
Raw price characteristics on the t-th trading day
Figure PCTCN2020139674-appb-000036
The new price feature output after the graph convolutional neural network is
Figure PCTCN2020139674-appb-000037
Each stock has C new price features that incorporate interactions between stocks.
S40:将股票集合S的原始价格特征和新价格特征进行拼接后,输入门控循环神经网络提取股票集合S的时间序列特征,并输出包含时间序列特征的新特征;S40: After splicing the original price feature and the new price feature of the stock set S, input the gated recurrent neural network to extract the time series feature of the stock set S, and output the new feature including the time series feature;
本步骤中,使用门控循环神经网络GRU对过去P个历史交易日的原始价格特征X t和新价格特征
Figure PCTCN2020139674-appb-000038
进行时间序列特征的提取。GRU的隐藏层如下:
In this step, use the gated recurrent neural network GRU to analyze the original price features X t and new price features of the past P historical trading days
Figure PCTCN2020139674-appb-000038
Extract time series features. The hidden layer of GRU is as follows:
Figure PCTCN2020139674-appb-000039
Figure PCTCN2020139674-appb-000039
公式(6)中,输入时间步t∈[d-P+1,…,d-1]。
Figure PCTCN2020139674-appb-000040
是GRU在输入时间步t-1的隐藏层状态,r t是复位门,u t是更新门。σ∈[0,1]是激活函数,·是矩阵乘法,⊙是哈夫曼乘积。{W r,W u,W h}是可训练的权重参数,{b r,b u,b h}是可 训练的偏置项。GRU的输出层是
Figure PCTCN2020139674-appb-000041
其中
Figure PCTCN2020139674-appb-000042
每只股票包括G个新特征。
In Equation (6), the input time step t∈[d-P+1,…,d-1].
Figure PCTCN2020139674-appb-000040
is the hidden layer state of the GRU at input time step t-1, r t is the reset gate, and u t is the update gate. σ∈[0,1] is the activation function, · is the matrix multiplication, and ⊙ is the Huffman product. {W r ,W u ,W h } are trainable weight parameters, and { br ,b u , b h } are trainable bias terms. The output layer of the GRU is
Figure PCTCN2020139674-appb-000041
in
Figure PCTCN2020139674-appb-000042
Each stock includes G new features.
S50:将门控循环神经网络输出的新特征输入到带有Sigmoid激活函数的全连接层,得到股票集合S在交易日d的股票价格走势;S50: Input the new features output by the gated recurrent neural network into the fully connected layer with the Sigmoid activation function to obtain the stock price trend of the stock set S on the trading day d;
本步骤中,通过使用一个全连接层FC生成股票集合S的涨跌概率,公式如下:In this step, the probability of rising and falling of the stock set S is generated by using a fully connected layer FC, and the formula is as follows:
Figure PCTCN2020139674-appb-000043
Figure PCTCN2020139674-appb-000043
公式(7)中,
Figure PCTCN2020139674-appb-000044
是模型输出的股票集合S在第d天的股票涨跌趋势,
Figure PCTCN2020139674-appb-000045
是对股票i在第d天的涨跌趋势预测。
Figure PCTCN2020139674-appb-000046
是可训练参数。本发明实施例中使用交叉熵为损失函数,具体如下:
In formula (7),
Figure PCTCN2020139674-appb-000044
is the stock rise and fall trend of the stock set S output by the model on the d day,
Figure PCTCN2020139674-appb-000045
is the forecast of the up and down trend of stock i on the d day.
Figure PCTCN2020139674-appb-000046
are trainable parameters. In the embodiment of the present invention, the cross entropy is used as the loss function, and the details are as follows:
Figure PCTCN2020139674-appb-000047
Figure PCTCN2020139674-appb-000047
公式(8)中,
Figure PCTCN2020139674-appb-000048
是股票s在第d天的真实价格走势值,本发明通过计算该股票在第t天的开盘价与前一天的开盘价的差距比例来计算走势值,即
Figure PCTCN2020139674-appb-000049
In formula (8),
Figure PCTCN2020139674-appb-000048
is the real price trend value of the stock s on the d day. The present invention calculates the trend value by calculating the ratio of the gap between the opening price of the stock on the t day and the opening price of the previous day, that is,
Figure PCTCN2020139674-appb-000049
基于上述,本申请实施例的股票价格走势预测方法通过多角度(股权、行业、话题)去刻画股票之间的关系,并结合股票的历史价格特征,使用图卷积神经网络提取股票价格之间的交叉影响,捕获股票价格之间的相互作用,并基于此构建新的价格特征。将新的价格特征和历史价格特征拼接后通过门控循环神经网络提取股票的时序特征和交叉影响特征,进而进行股票价格走势预测。相对于现有技术,本发明实施例充分考虑了股票价格之间的相互作用对股票涨跌的影响,并提取了价格数据中的时序特征和交叉影响特征,从而大大提高股票价格走势预测的精度。Based on the above, the stock price trend prediction method of the embodiment of the present application depicts the relationship between stocks through multiple perspectives (equity, industry, topic), and combines the historical price characteristics of stocks to use graph convolutional neural network to extract the relationship between stock prices. to capture the interactions between stock prices and build new price features based on them. After splicing the new price features and historical price features, the time series features and cross-influence features of the stock are extracted through the gated recurrent neural network, and then the stock price trend prediction is carried out. Compared with the prior art, the embodiment of the present invention fully considers the influence of the interaction between stock prices on the ups and downs of stocks, and extracts the time series features and cross-influence features in the price data, thereby greatly improving the accuracy of stock price trend prediction. .
请参阅图3,是本申请实施例的股票价格走势预测系统的结构示意图。本申请实施例的股票价格走势预测系统40包括:Please refer to FIG. 3 , which is a schematic structural diagram of a stock price trend prediction system according to an embodiment of the present application. The stock price trend prediction system 40 in the embodiment of the present application includes:
数据获取模块41:用于获取股票集合在预定天数个历史交易日的原始价格特征;所述股票集合中至少包括两只股票;Data acquisition module 41: used to acquire the original price characteristics of a stock set in a predetermined number of historical trading days; the stock set includes at least two stocks;
关系图构建模块42:用于基于先验知识构建所述股票集合的股权网络关系图,所述股权网络关系图中的每一个顶点分别对应一只股票;Relationship graph construction module 42: used to construct an equity network relationship graph of the stock set based on prior knowledge, and each vertex in the equity network relationship graph corresponds to a stock respectively;
图卷积模块43:用于将所述股票集合的历史价格特征以及股权网络关系图输入深度学习模型,所述深度学习模型通过图卷积神经网络对所述股权网络关系图上的顶点进行特征聚合和非线性变换,提取所述股权网络关系图上各顶点之间的相互作用,并构建所述股票集合的新价格特征;Graph convolution module 43: used to input the historical price characteristics of the stock set and the equity network relationship graph into a deep learning model, and the deep learning model uses a graph convolutional neural network to characterize the vertices on the equity network relationship graph Aggregate and nonlinear transformation, extract the interaction between the vertices on the equity network relationship graph, and construct the new price feature of the stock set;
时序特征提取模块44:用于将所述股票集合的新价格特征与原始价格特征拼接后输入门控循环神经网络,通过所述门控循环神经网络输出包含时间序列特征的新特征;Time series feature extraction module 44: used to input the gated recurrent neural network after splicing the new price features of the stock set with the original price features, and output new features including time series features through the gated recurrent neural network;
结果输出模块45:用于根据所述包含时间序列特征的新特征对所述股票集合的股票价格走势进行预测。Result output module 45: used to predict the stock price trend of the stock set according to the new feature including the time series feature.
请参阅图4,为本申请实施例的终端结构示意图。该终端50包括处理器51、与处理器51耦接的存储器52。Please refer to FIG. 4 , which is a schematic structural diagram of a terminal according to an embodiment of the present application. The terminal 50 includes a processor 51 and a memory 52 coupled to the processor 51 .
存储器52存储有用于实现上述股票价格走势预测方法的程序指令。The memory 52 stores program instructions for implementing the above-mentioned stock price trend prediction method.
处理器51用于执行存储器52存储的程序指令以控制股票价格走势预测。The processor 51 is configured to execute the program instructions stored in the memory 52 to control the stock price trend prediction.
其中,处理器51还可以称为CPU(Central Processing Unit,中央处理单元)。处理器51可能是一种集成电路芯片,具有信号的处理能力。处理器51还可以是通用处理器、数字信号处理器(DSP)、专用集成电路(ASIC)、现成可编 程门阵列(FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The processor 51 may also be referred to as a CPU (Central Processing Unit, central processing unit). The processor 51 may be an integrated circuit chip with signal processing capability. The processor 51 may also be a general purpose processor, digital signal processor (DSP), application specific integrated circuit (ASIC), off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware component . A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
请参阅图5,为本申请实施例的存储介质的结构示意图。本申请实施例的存储介质存储有能够实现上述所有方法的程序文件61,其中,该程序文件61可以以软件产品的形式存储在上述存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本发明各个实施方式方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质,或者是计算机、服务器、手机、平板等终端设备。Please refer to FIG. 5 , which is a schematic structural diagram of a storage medium according to an embodiment of the present application. The storage medium of this embodiment of the present application stores a program file 61 capable of implementing all the above methods, wherein the program file 61 may be stored in the above-mentioned storage medium in the form of a software product, and includes several instructions to make a computer device (which may It is a personal computer, a server, or a network device, etc.) or a processor that executes all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, Read-Only Memory (ROM, Read-Only Memory), Random Access Memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program codes , or terminal devices such as computers, servers, mobile phones, and tablets.
对所公开的实施例的上述说明,使本领域专业技术人员能够实现或使用本申请。对这些实施例的多种修改对本领域的专业技术人员来说将是显而易见的,本申请中所定义的一般原理可以在不脱离本申请的精神或范围的情况下,在其它实施例中实现。因此,本申请将不会被限制于本申请所示的这些实施例,而是要符合与本申请所公开的原理和新颖特点相一致的最宽的范围。The above description of the disclosed embodiments enables any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined in this application may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

  1. 一种股票价格走势预测方法,其特征在于,包括:A stock price trend forecasting method, characterized in that it includes:
    获取股票集合在预定天数的历史交易日的原始价格特征;所述股票集合中至少包括两只股票;Obtain the original price characteristics of the stock set on the historical trading days of the predetermined number of days; the stock set includes at least two stocks;
    基于先验知识构建所述股票集合的股权网络关系图,所述股权网络关系图中的每一个顶点分别对应一只股票;Construct an equity network relationship graph of the stock set based on prior knowledge, and each vertex in the equity network relationship graph corresponds to a stock respectively;
    将所述股票集合的历史价格特征以及股权网络关系图输入深度学习模型,所述深度学习模型通过图卷积神经网络对所述股权网络关系图上的顶点进行特征聚合和非线性变换,提取所述股权网络关系图上各顶点之间的相互作用,并构建所述股票集合的新价格特征;The historical price features of the stock set and the equity network relationship graph are input into the deep learning model, and the deep learning model performs feature aggregation and nonlinear transformation on the vertices on the equity network relationship graph through the graph convolutional neural network, and extracts all the vertices. The interaction between the vertices on the equity network relationship graph, and construct the new price feature of the stock set;
    将所述股票集合的新价格特征与原始价格特征拼接后输入门控循环神经网络,通过所述门控循环神经网络输出包含时间序列特征的新特征;After splicing the new price feature of the stock set with the original price feature, input the gated recurrent neural network, and output the new feature including the time series feature through the gated recurrent neural network;
    根据所述包含时间序列特征的新特征对所述股票集合的股票价格走势进行预测。The stock price trend of the stock set is predicted according to the new feature including the time series feature.
  2. 根据权利要求1所述的股票价格走势预测方法,其特征在于,所述获取股票集合在预定天数个历史交易日的原始价格特征包括:The method for predicting a stock price trend according to claim 1, wherein the acquiring the original price characteristics of the stock set in a predetermined number of historical trading days includes:
    对所述原始价格特征进行Z-score归一化处理;Perform Z-score normalization processing on the original price feature;
    所述原始价格特征包括收盘价、开盘价、交易量以及交易换手率。The original price characteristics include closing price, opening price, trading volume, and trading turnover.
  3. 根据权利要求1所述的股票价格走势预测方法,其特征在于,所述股权网络关系图包括股权关系图、行业关系图以及话题关系图,具体为:The stock price trend prediction method according to claim 1, wherein the equity network relationship diagram includes an equity relationship diagram, an industry relationship diagram and a topic relationship diagram, specifically:
    G S=(V,E S,A S) G S =(V,E S ,A S )
    G I=(V,E I,A I) G I =(V,E I ,A I )
    G T=(V,E T,A T) G T =(V,E T ,A T )
    上述公式中,G S为股权关系图、G I为行业关系图,G T为话题关系图;V={v 1,…,v N}是图的顶点集,v i是第i th个顶点,共有N个顶点,每个图的顶点集都相同,为股票集合S;E是图边集,每条边表示股票之间的连接关系,不同的股票图边集不同;A=(a ij) N×N是图的邻接矩阵,矩阵的元素a ij是边的权重,代表股票i与股票j之间的影响因子。 In the above formula, G S is the equity relationship diagram, G I is the industry relationship diagram, and GT is the topic relationship diagram; V={v 1 ,...,v N } is the vertex set of the graph, and v i is the ith vertex , there are N vertices in total, and the vertex sets of each graph are the same, which is the stock set S; E is the graph edge set, each edge represents the connection relationship between stocks, and the edge sets of different stock graphs are different; A=(a ij ) N×N is the adjacency matrix of the graph, and the element a ij of the matrix is the weight of the edge, which represents the influence factor between stock i and stock j.
  4. 根据权利要求3所述的股票价格走势预测方法,其特征在于,所述图卷积神经网络对所述股权网络关系图上的顶点进行特征聚合和非线性变换具体为:The stock price trend prediction method according to claim 3, wherein the graph convolutional neural network performs feature aggregation and nonlinear transformation on the vertices on the equity network relationship graph, specifically:
    根据所述股票网络关系图的拉普拉斯矩阵提取股票集合在各个关系图中的相互作用,所述图卷积神经网络的每一层公式为:The interaction of the stock set in each relation graph is extracted according to the Laplacian matrix of the stock network relation graph. The formula of each layer of the graph convolutional neural network is:
    Figure PCTCN2020139674-appb-100001
    Figure PCTCN2020139674-appb-100001
    上述公式中,拉普拉斯矩阵{L S,L I,L T}对应的邻接矩阵为{A S,A I,A T},
    Figure PCTCN2020139674-appb-100002
    I N为单位矩阵,D是A的邻接矩阵;
    Figure PCTCN2020139674-appb-100003
    Figure PCTCN2020139674-appb-100004
    为可训练参数,K是拉普拉斯矩阵的阶数,表示图卷积的半径,θ k是第k阶拉普拉斯矩阵的可训练系数;ρ是激活函数,
    Figure PCTCN2020139674-appb-100005
    是第l层的可训练参数,
    Figure PCTCN2020139674-appb-100006
    是图卷积神经网络的第l层,
    Figure PCTCN2020139674-appb-100007
    是股票集合S在第t天的原始价格特征,每只股票包括F个原始价格特征;
    In the above formula, the adjacency matrix corresponding to the Laplacian matrix {L S , L I , L T } is {A S , A I , A T },
    Figure PCTCN2020139674-appb-100002
    I N is the identity matrix, D is the adjacency matrix of A;
    Figure PCTCN2020139674-appb-100003
    Figure PCTCN2020139674-appb-100004
    is a trainable parameter, K is the order of the Laplacian matrix, indicating the radius of the graph convolution, θ k is the trainable coefficient of the k-th order Laplacian matrix; ρ is the activation function,
    Figure PCTCN2020139674-appb-100005
    are the trainable parameters of the lth layer,
    Figure PCTCN2020139674-appb-100006
    is the first layer of the graph convolutional neural network,
    Figure PCTCN2020139674-appb-100007
    is the original price feature of the stock set S on day t, and each stock includes F original price features;
    所述原始价格特征
    Figure PCTCN2020139674-appb-100008
    经过图卷积神经网络后输出的新价格特征为
    Figure PCTCN2020139674-appb-100009
    每只股票包括C个新价格特征。
    The original price feature
    Figure PCTCN2020139674-appb-100008
    The new price feature output after the graph convolutional neural network is
    Figure PCTCN2020139674-appb-100009
    Each stock includes C new price features.
  5. 根据权利要求4所述的股票价格走势预测方法,其特征在于,所述通过所述门控循环神经网络的隐藏层为:The stock price trend prediction method according to claim 4, wherein the hidden layer passing through the gated recurrent neural network is:
    Figure PCTCN2020139674-appb-100010
    Figure PCTCN2020139674-appb-100010
    Figure PCTCN2020139674-appb-100011
    Figure PCTCN2020139674-appb-100011
    Figure PCTCN2020139674-appb-100012
    Figure PCTCN2020139674-appb-100012
    Figure PCTCN2020139674-appb-100013
    Figure PCTCN2020139674-appb-100013
    上述公式中,输入时间步t∈[d-P+1,…,d-1],
    Figure PCTCN2020139674-appb-100014
    是所述门控循环神经网络在输入时间步t-1的隐藏层状态,r t是复位门,u t是更新门;σ∈[0,1]是激活函数,·是矩阵乘法,⊙是哈夫曼乘积;{W r,W u,W h}是可训练的权重参数,{b r,b u,b h}是可训练的偏置项;所述门控循环神经网络的输出层是
    Figure PCTCN2020139674-appb-100015
    其中
    Figure PCTCN2020139674-appb-100016
    每只股票包括G个新特征。
    In the above formula, the input time step t∈[d-P+1,...,d-1],
    Figure PCTCN2020139674-appb-100014
    is the hidden layer state of the gated recurrent neural network at the input time step t-1, r t is the reset gate, u t is the update gate; σ∈[0,1] is the activation function, ⋅ is the matrix multiplication, ⊙ is Huffman product; {W r ,W u ,W h } are trainable weight parameters, { br , bu ,b h } are trainable bias terms; the output layer of the gated recurrent neural network Yes
    Figure PCTCN2020139674-appb-100015
    in
    Figure PCTCN2020139674-appb-100016
    Each stock includes G new features.
  6. 根据权利要求5所述的股票价格走势预测方法,其特征在于,所述根据所述包含时间序列特征的新特征对所述股票集合的股票价格走势进行预测具体为:The stock price trend prediction method according to claim 5, wherein the predicting the stock price trend of the stock set according to the new feature including the time series feature is specifically:
    将所述门控循环神经网络输出的新特征输入到带有Sigmoid激活函数的全连接层,通过所述全连接层生成股票集合的涨跌概率,公式如下:The new features output by the gated recurrent neural network are input into the fully connected layer with the sigmoid activation function, and the probability of rising and falling of the stock set is generated through the fully connected layer. The formula is as follows:
    Figure PCTCN2020139674-appb-100017
    Figure PCTCN2020139674-appb-100017
    上述公式中,
    Figure PCTCN2020139674-appb-100018
    是股票集合S在第d天的股票涨跌趋势,
    Figure PCTCN2020139674-appb-100019
    是对股票i在第d天的涨跌趋势预测;
    Figure PCTCN2020139674-appb-100020
    是可训练参数。
    In the above formula,
    Figure PCTCN2020139674-appb-100018
    is the stock rise and fall trend of the stock set S on the d day,
    Figure PCTCN2020139674-appb-100019
    is the forecast of the rising and falling trend of stock i on the d day;
    Figure PCTCN2020139674-appb-100020
    are trainable parameters.
  7. 根据权利要求1至6任一项所述的股票价格走势预测方法,其特征在于,所述深度学习模型使用交叉熵为损失函数,具体如下:The stock price trend prediction method according to any one of claims 1 to 6, wherein the deep learning model uses cross-entropy as a loss function, which is as follows:
    Figure PCTCN2020139674-appb-100021
    Figure PCTCN2020139674-appb-100021
    上述公式中,
    Figure PCTCN2020139674-appb-100022
    是股票s在第d天的真实价格走势值,所述真实价格走势值为该股票在第t天的开盘价与前一天的开盘价的差距比例。
    In the above formula,
    Figure PCTCN2020139674-appb-100022
    is the real price trend value of the stock s on the d day, and the real price trend value is the ratio of the gap between the opening price of the stock on the t day and the opening price of the previous day.
  8. 一种股票价格走势预测系统,其特征在于,包括:A stock price trend prediction system, characterized in that it includes:
    数据获取模块:用于获取股票集合在预定天数的历史交易日的原始价格特征;所述股票集合中至少包括两只股票;Data acquisition module: used to acquire the original price characteristics of a stock set on historical trading days of a predetermined number of days; the stock set includes at least two stocks;
    关系图构建模块:用于基于先验知识构建所述股票集合的股权网络关系图,所述股权网络关系图中的每一个顶点分别对应一只股票;Relationship graph building module: used to construct an equity network relationship graph of the stock set based on prior knowledge, and each vertex in the equity network relationship graph corresponds to a stock respectively;
    图卷积模块:用于将所述股票集合的历史价格特征以及股权网络关系图输入深度学习模型,所述深度学习模型通过图卷积神经网络对所述股权网络关系图上的顶点进行特征聚合和非线性变换,提取所述股权网络关系图上各顶点之间的相互作用,并构建所述股票集合的新价格特征;Graph convolution module: used to input the historical price features of the stock set and the equity network relationship graph into a deep learning model, and the deep learning model performs feature aggregation on the vertices on the equity network relationship graph through a graph convolutional neural network and nonlinear transformation, extract the interaction between the vertices on the equity network relationship graph, and construct the new price feature of the stock set;
    时序特征提取模块:用于将所述股票集合的新价格特征与原始价格特征拼接后输入门控循环神经网络,通过所述门控循环神经网络输出包含时间序列特征的新特征;Time series feature extraction module: used to input the gated recurrent neural network after splicing the new price features of the stock set with the original price features, and output new features including time series features through the gated recurrent neural network;
    结果输出模块:用于根据所述包含时间序列特征的新特征对所述股票集合的股票价格走势进行预测。Result output module: used to predict the stock price trend of the stock set according to the new feature including time series features.
  9. 一种终端,其特征在于,所述终端包括处理器、与所述处理器耦接的存储器,其中,A terminal, characterized in that the terminal includes a processor and a memory coupled to the processor, wherein,
    所述存储器存储有用于实现权利要求1-7任一项所述的股票价格走势预测方法的程序指令;The memory stores program instructions for implementing the stock price trend prediction method according to any one of claims 1-7;
    所述处理器用于执行所述存储器存储的所述程序指令以控制股票价格走势预测。The processor is configured to execute the program instructions stored in the memory to control stock price trend prediction.
  10. 一种存储介质,其特征在于,存储有处理器可运行的程序指令,所述程序指令用于执行权利要求1至7任一项所述股票价格走势预测方法。A storage medium, characterized in that it stores program instructions executable by a processor, and the program instructions are used to execute the stock price trend prediction method according to any one of claims 1 to 7.
PCT/CN2020/139674 2020-11-19 2020-12-25 Stock price trend prediction method and system, terminal, and storage medium WO2022105016A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011301121.1A CN112365075A (en) 2020-11-19 2020-11-19 Stock price trend prediction method, system, terminal and storage medium
CN202011301121.1 2020-11-19

Publications (1)

Publication Number Publication Date
WO2022105016A1 true WO2022105016A1 (en) 2022-05-27

Family

ID=74533003

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/139674 WO2022105016A1 (en) 2020-11-19 2020-12-25 Stock price trend prediction method and system, terminal, and storage medium

Country Status (2)

Country Link
CN (1) CN112365075A (en)
WO (1) WO2022105016A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115858725A (en) * 2022-11-22 2023-03-28 广西壮族自治区通信产业服务有限公司技术服务分公司 Method and system for screening text noise based on unsupervised graph neural network

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112948442B (en) * 2021-03-26 2022-06-21 深圳先进技术研究院 Data stream theta connection optimization method, system, terminal and storage medium
CN114493883A (en) * 2022-02-14 2022-05-13 深圳市伊登软件有限公司 Multi-channel data summarizing method and system
CN114897607A (en) * 2022-04-02 2022-08-12 富途网络科技(深圳)有限公司 Data processing method and device for product resources, electronic equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190354836A1 (en) * 2018-05-17 2019-11-21 International Business Machines Corporation Dynamic discovery of dependencies among time series data using neural networks
CN110827544A (en) * 2019-11-11 2020-02-21 重庆邮电大学 Short-term traffic flow control method based on graph convolution recurrent neural network

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190354836A1 (en) * 2018-05-17 2019-11-21 International Business Machines Corporation Dynamic discovery of dependencies among time series data using neural networks
CN110827544A (en) * 2019-11-11 2020-02-21 重庆邮电大学 Short-term traffic flow control method based on graph convolution recurrent neural network

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
YE JIEXIA; ZHAO JUANJUAN; YE KEJIANG; XU CHENGZHONG: "Multi-Graph Convolutional Network for Relationship-Driven Stock Movement Prediction", 2020 25TH INTERNATIONAL CONFERENCE ON PATTERN RECOGNITION (ICPR), IEEE, 10 January 2021 (2021-01-10), pages 6702 - 6709, XP033909626, DOI: 10.1109/ICPR48806.2021.9412695 *
ZHAO HAOBO, XIZUO, LI: "Forecast of Stock Opening Price based on Fusion of Convolution and Recurrent Neural Network Models", INTELLIGENT COMPUTER AND APPLICATIONS, vol. 9, no. 6, 1 November 2019 (2019-11-01), pages 1 - 5, XP055932311, ISSN: 2095-2163 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115858725A (en) * 2022-11-22 2023-03-28 广西壮族自治区通信产业服务有限公司技术服务分公司 Method and system for screening text noise based on unsupervised graph neural network
CN115858725B (en) * 2022-11-22 2023-07-04 广西壮族自治区通信产业服务有限公司技术服务分公司 Text noise screening method and system based on unsupervised graph neural network

Also Published As

Publication number Publication date
CN112365075A (en) 2021-02-12

Similar Documents

Publication Publication Date Title
WO2022105016A1 (en) Stock price trend prediction method and system, terminal, and storage medium
Li et al. Risk prediction in financial management of listed companies based on optimized BP neural network under digital economy
Shah et al. A comprehensive review on multiple hybrid deep learning approaches for stock prediction
Yin et al. Graph-based stock correlation and prediction for high-frequency trading systems
Zheng et al. Share price prediction of aerospace relevant companies with recurrent neural networks based on pca
US11410242B1 (en) Artificial intelligence supported valuation platform
Koshiyama et al. Algorithms in future capital markets
Odegua Predicting bank loan default with extreme gradient boosting
Li Design a management information system for financial risk control
Yuan et al. A dynamic clustering ensemble learning approach for crude oil price forecasting
Alkhodhairi et al. Bitcoin candlestick prediction with deep neural networks based on real time data
Dai et al. An online portfolio strategy based on trend promote price tracing ensemble learning algorithm
Qiao et al. Prediction of stock return by LSTM neural network
James et al. A machine learning attack on illegal trading
Guo et al. Forecasting the mid-price movements with high-frequency lob: A dual-stage temporal attention-based deep learning architecture
WO2024021354A1 (en) Model training method, price prediction method, terminal device and storage medium
Zheng et al. Incorporating prior financial domain knowledge into neural networks for implied volatility surface prediction
Ta et al. Sustainable reuse strategies of enterprise financial management model following deep learning under big data
Aranha et al. Efficacies of artificial neural networks ushering improvement in the prediction of extant credit risk models
Chen et al. Impact of technical indicators and leading indicators on stock trends on the internet of things
Sun et al. Short-term stock price forecasting based on an svd-lstm model
Koshiyama et al. Algorithms in future capital markets: a survey on AI, ML and associated algorithms in capital markets
Zheng et al. Gated Neural Networks for Implied Volatility Surfaces
Siddesh et al. Forecasting stock market volume price using sentimental and technical analysis
Zhang et al. Comparison between Autoregression model and Gaussian Process model on stock price prediction: a case study with the Microsoft stock

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20962307

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20962307

Country of ref document: EP

Kind code of ref document: A1