Individual stock multi-factor scoring ranking-based stock selection method and system
By processing heterogeneous data streams of individual stocks in the target market and generating feature matrices, combined with reinforcement learning and graph attention networks, dynamic position allocation and investment portfolios are generated. This solves the shortcomings of traditional stock selection methods in multi-source information fusion and market adaptability, and realizes dynamic position optimization and risk management.
Patent Information
- Application Number
- CN202511454250.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-13
- Publication Date
- 2025-11-11
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional stock selection methods struggle to fully integrate multi-source information for comprehensive evaluation, and lack adaptability and risk management capabilities in dynamic market environments. Existing multi-factor models are also unable to characterize market time-series changes and nonlinear relationships between factors.
By acquiring heterogeneous data streams of individual stocks in the target market, normalization and feature alignment are performed to generate a standardized multi-factor feature matrix. A reinforcement learning model is used to output dynamic position allocation ratios and market environment risk levels. Finally, a graph attention network and multi-objective optimization algorithm are combined to generate the final investment portfolio.
It enhances the intelligence level of stock selection strategies, optimizes dynamic position allocation, and enables better risk management and improved returns in dynamic market environments.
Smart Images

Figure CN120931400A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of financial technology, specifically a stock selection method and system based on multi-factor scoring and ranking of individual stocks. Background Technology
[0002] With the increasing complexity and diversification of financial markets, stock selection and asset allocation decisions in securities investment are facing unprecedented challenges. Traditional stock selection methods, such as fundamental analysis and technical analysis, often focus on a single data dimension, making it difficult to fully integrate multi-source information for a comprehensive evaluation of individual stocks. At the same time, with the dynamic changes in market microstructure and trading environment, investors are placing higher demands on the dynamic adaptability of stock selection methods and their risk management capabilities.
[0003] In recent years, multi-factor stock selection models have become an important research direction in the field of quantitative investment. Multi-factor stock selection refers to the process of identifying and constructing multiple characteristic factors (such as value, growth, momentum, volatility, and liquidity) that influence stock performance, comprehensively scoring and ranking individual stocks to select investment targets with excess return potential. Traditional multi-factor models often employ linear regression or weighted scoring methods, which struggle to characterize market temporal changes, nonlinear relationships between factors, and complex connections between sectors. Summary of the Invention
[0004] The purpose of this invention is to provide a stock selection method and system based on multi-factor scoring and ranking of individual stocks, in order to overcome the shortcomings of the existing technology, improve the intelligence level of stock selection strategies, and optimize dynamic position allocation.
[0005] One embodiment of this application provides a stock selection method based on multi-factor scoring ranking of individual stocks, the method comprising: Obtain heterogeneous data streams of individual stocks in the target market, normalize and align the heterogeneous data streams to generate a standardized multi-factor feature matrix, wherein the heterogeneous data streams include auction volume and price data, intraday multi-factor time series data and industry sector correlation maps; Based on the standardized multi-factor feature matrix, a reinforcement learning model is used to output the dynamic position allocation ratio and market environment risk level through the mapping relationship between historical market conditions and position returns. Based on the aforementioned market environment risk level, a graph attention network is used to score the sector direction. By aggregating the factor characteristics of individual stocks within a sector and the cross-sector correlation strength, a sector popularity distribution map and a priority ranking list are generated. Based on the aforementioned sector priority ranking list, pattern scores are performed on individual stocks within the target sector. By integrating multi-factor pattern labels of individual stocks with intraday capital flow data through a spatiotemporal attention mechanism, a pattern score matrix containing the strength of buy signals is output. Based on the dynamic position allocation ratio, the sector priority ranking list, and the pattern scoring matrix, a multi-objective optimization algorithm is used to generate the final investment portfolio. The multi-objective optimization algorithm simultaneously optimizes the risk-reward ratio and factor exposure, and outputs an interpretable stock selection decision chain through a visual interface.
[0006] Optionally, the step of acquiring heterogeneous data streams of individual stocks in the target market, normalizing and aligning the heterogeneous data streams to generate a standardized multi-factor feature matrix, wherein the heterogeneous data streams include pre-market auction volume and price data, intraday multi-factor time-series data, and industry sector correlation maps, including: The system acquires heterogeneous data streams of individual stocks in the target market. Based on the tick-by-tick transaction pulse signals of the pre-market auction volume and price data, it uses an event-triggered pulse encoder to convert volume and price fluctuations into a spatiotemporally marked pulse sequence, generating a volume and price feature pulse matrix. The encoder uses dynamic threshold filtering technology to suppress high-frequency noise and retain effective price breakout signals. The phase difference between the volume and price characteristic pulse matrix and the multi-factor time series data in the market is measured. A time-varying convolution kernel is constructed through an adaptive time series alignment algorithm to dynamically compensate for the sampling frequency differences of different factors and output a time-axis aligned multi-factor tensor. The industry sector association graph is input into a dynamic graph neural network, and the node feature space is reconstructed through an edge weight adaptive allocation algorithm to generate a standardized multi-factor feature matrix that matches the dimensions of the multi-factor tensor.
[0007] Optionally, based on the standardized multi-factor feature matrix, the step of using a reinforcement learning model to output a dynamic position allocation ratio and market environment risk level through the mapping relationship between historical market states and position returns includes: The standardized multi-factor feature matrix is input into the time-series pulse encoder, and historical market state segments are extracted through a sliding window to generate a spatiotemporal encoding vector containing volume, price, volatility, and turnover rate. Adversarial risk distillation is performed on the spatiotemporal encoded vector. Market environment noise and core risk features are separated through game training between the generator and the discriminator, and a purified risk feature vector is output. Based on the risk feature purification vector, a drift plus penalty reinforcement learning algorithm is adopted. By mapping the historical market state with the position return, and combining dynamic programming to solve the position allocation ratio, the optimized position allocation is obtained. The drift plus penalty reinforcement learning algorithm balances the return and drawdown through Lyapunov stability constraints. The optimized position allocation is subjected to risk level cluster analysis. The multidimensional risk characteristics are projected onto the discrete risk level space through a self-organizing mapping network, and the final dynamic position allocation ratio and market environment risk level are output.
[0008] Optionally, based on the market environment risk level, a graph attention network is used to score the sector direction, and by aggregating the factor characteristics of individual stocks within a sector and the cross-sector correlation strength, a sector popularity distribution map and priority ranking list are generated, including: Based on the risk level of the market environment, a heterogeneous graph convolutional network is used to reconstruct the industry sector correlation map. By integrating the factor features of individual stocks within the sector through node feature enhancement technology, an enhanced sector relationship map is generated. The enhanced plate relationship graph is processed by a multi-head graph attention mechanism to calculate the attention weight of the plate nodes and output the plate importance score vector. The cross-sector correlation strength algorithm quantifies the capital flow and industrial chain linkage effect between sectors, generating a sector correlation strength matrix; Input the sector importance score vector and correlation strength matrix into the heat diffusion model, simulate the flow of funds based on the heat conduction equation, and output a sector heat distribution map; Perform topological sorting on the heat distribution map of sectors, determine the sector rotation priority through critical path extraction algorithm, and generate a priority ranking list of sectors.
[0009] Optionally, based on the sector priority ranking list, pattern scoring is performed on individual stocks within the target sector. This involves fusing multi-factor pattern labels and intraday capital flow data using a spatiotemporal attention mechanism to output a pattern scoring matrix that includes the strength of buy signals, including: Based on the priority ranking list of sectors, a spatiotemporal convolutional network is used to extract multi-factor morphological features of individual stocks within the target sector, generating pattern feature vectors that include valuation, momentum, and volatility. The pattern feature vector is spatiotemporally attention aligned with the intraday capital flow data, and the capital flow impact signal is fused through a dynamic weight allocation mechanism to output a spatiotemporally fused feature tensor. The spatiotemporal fusion feature tensor is input into the pulse-triggered scoring model, and the buy signal strength is calculated based on the historical similar pattern return distribution to generate an initial signal strength matrix; Virtual extreme samples are generated from the initial signal intensity matrix. The robustness of the model is enhanced through adversarial training. The residual compensation algorithm is used to correct overfitting bias and output a signal intensity matrix with enhanced stability. The signal strength matrix and the sector heat distribution map are jointly calibrated, and the scoring deviation between sectors is eliminated by nonlinear interpolation technology. Finally, the pattern scoring matrix containing the buy signal strength is output.
[0010] Optionally, the final investment portfolio is generated using a multi-objective optimization algorithm based on the dynamic position allocation ratio, the sector priority ranking list, and the pattern scoring matrix. The multi-objective optimization algorithm simultaneously optimizes the risk-reward ratio and factor exposure, and outputs an interpretable stock selection decision chain through a visual interface, including: Based on the dynamic position allocation ratio and the sector priority ranking list, a dynamic threshold filtering algorithm is used to screen high-scoring stocks in the target sector to generate an initial investment candidate pool. The pattern score matrix of individual stocks in the initial investment candidate pool is input into the multi-objective optimizer, and the return-risk ratio and factor exposure are optimized simultaneously through dynamic weight allocation technology to construct a non-conflict optimization objective function; Gradient projection is used to solve the non-conflict optimization objective function. Pareto optimal solution set is generated by combining risk level constraints. Redundant combinations are removed by decision tree pruning algorithm, and the final portfolio is output. The process of generating the final portfolio is decomposed into interpretable feature paths. The stock selection decision logic chain is mapped through a spatiotemporal causal graph, and the factor contribution and risk transmission path are dynamically displayed in the visualization interface.
[0011] Another embodiment of this application provides a stock selection system based on multi-factor scoring and ranking of individual stocks, the system comprising: The acquisition module is used to acquire heterogeneous data streams of individual stocks in the target market, normalize and align the heterogeneous data streams to generate a standardized multi-factor feature matrix, wherein the heterogeneous data streams include auction volume and price data, intraday multi-factor time series data and industry sector correlation maps. The configuration module is used to output dynamic position allocation ratio and market environment risk level based on the standardized multi-factor feature matrix and using a reinforcement learning model, through the mapping relationship between historical market state and position returns. The sorting module is used to score the sector direction based on the risk level of the market environment using a graph attention network, and generate a sector heat distribution map and priority ranking list by aggregating the factor characteristics of individual stocks within the sector and the cross-sector correlation strength. The scoring module is used to score individual stocks within the target sector based on the sector priority ranking list. It integrates multi-factor pattern labels of individual stocks with intraday capital flow data through a spatiotemporal attention mechanism and outputs a pattern scoring matrix that includes the strength of buy signals. The generation module is used to generate a final investment portfolio based on the dynamic position allocation ratio, the sector priority ranking list, and the pattern scoring matrix using a multi-objective optimization algorithm. The multi-objective optimization algorithm simultaneously optimizes the return-risk ratio and factor exposure, and outputs an interpretable stock selection decision chain through a visual interface.
[0012] Another embodiment of this application provides a storage medium storing a computer program, wherein the computer program is configured to execute the method described in any of the preceding claims when running.
[0013] Another embodiment of this application provides an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the method described in any of the preceding claims.
[0014] Compared with existing technologies, this invention provides a stock selection method based on multi-factor scoring and ranking of individual stocks. It acquires heterogeneous data streams of individual stocks in the target market, normalizes and aligns these data streams to generate a standardized multi-factor feature matrix. Based on this matrix, it outputs dynamic position allocation ratios and market environment risk levels. According to the market environment risk levels, it uses a graph attention network to score sector directions, generating a sector popularity distribution map and a priority ranking list. Based on the sector priority ranking list, it performs pattern scoring on individual stocks within the target sector, outputting a pattern scoring matrix that includes buy signal strength. Finally, based on the dynamic position allocation ratios, the sector priority ranking list, and the pattern scoring matrix, it uses a multi-objective optimization algorithm to generate the final investment portfolio, thereby improving the intelligence level of the stock selection strategy and optimizing dynamic position allocation. Attached Figure Description
[0015] Figure 1 A hardware structure block diagram of a computer terminal for a stock selection method based on multi-factor scoring and ranking of individual stocks, provided in an embodiment of the present invention; Figure 2 A schematic flowchart illustrating a stock selection method based on multi-factor scoring and ranking of individual stocks, provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of a stock selection system based on multi-factor scoring and ranking of individual stocks, provided in an embodiment of the present invention. Detailed Implementation
[0016] The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0017] This invention first provides a stock selection method based on multi-factor scoring and ranking of individual stocks. This method can be applied to electronic devices, such as computer terminals, specifically ordinary computers.
[0018] The following detailed explanation uses a computer terminal as an example. Figure 1 This is a hardware structure block diagram of a computer terminal for a stock selection method based on multi-factor scoring and ranking of individual stocks, provided as an embodiment of the present invention. Figure 1As shown, the computer device includes a processor, memory, and network interface connected via a system bus, wherein the memory may include non-volatile storage media and internal memory.
[0019] Non-volatile storage media can store operating systems and computer programs. These computer programs include program instructions that, when executed, cause the processor to perform any stock selection method based on multi-factor scoring and ranking of individual stocks.
[0020] The processor provides computing and control capabilities, supporting the operation of the entire computer device.
[0021] Internal memory provides an environment for the execution of computer programs in non-volatile storage media. When the computer program is executed by the processor, it enables the processor to execute any stock selection method based on multi-factor scoring and ranking of individual stocks.
[0022] This network interface is used for network communication, such as sending assigned tasks. Those skilled in the art will understand that... Figure 1 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0023] It should be understood that the processor can be a Central Processing Unit (CPU), but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among these, a general-purpose processor can be a microprocessor or any conventional processor.
[0024] See Figure 2 The present invention provides a stock selection method based on multi-factor scoring and ranking of individual stocks, which may include the following steps: S201, Obtain heterogeneous data streams of individual stocks in the target market, normalize and align the heterogeneous data streams to generate a standardized multi-factor feature matrix, wherein the heterogeneous data streams include auction volume and price data, intraday multi-factor time series data and industry sector correlation maps; Specifically, it may include: S2011, acquiring heterogeneous data streams of individual stocks in the target market, and using an event-triggered pulse encoder to convert volume and price fluctuations into a spatiotemporally marked pulse sequence based on the tick-by-tick transaction pulse signals of the auction volume and price data, thereby generating a volume and price feature pulse matrix; wherein, the encoder suppresses high-frequency noise and retains valid price breakout signals through dynamic threshold filtering technology. The auction price and volume data is input in the form of individual transaction records, including fields such as timestamp (precision in milliseconds), price, and volume. The event-triggered pulse encoder processes the data through the following workflow: Signal Segmentation: Continuous bidding data is divided into segments with a 5-minute time window. For example, the opening auction phase from 9:15 to 9:20 is divided into 12 windows (each 25 seconds). Dynamic threshold filtering: The initial noise threshold is set to 1.5 times the standard deviation σ of price fluctuations over the past 20 windows. When a transaction price breaks through the threshold (e.g., the current price increases by more than σ × 1.5 compared to the previous transaction), it is marked as a valid pulse event. For example, if the price sequence within the window is [10.0, 10.1, 10.3, 10.5], and the standard deviation σ = 0.21, then the threshold = 0.315. The jump from 10.3 to 10.5 (Δ = 0.2) does not trigger a pulse, while the jump from 10.1 to 10.3 (Δ = 0.2) will generate a pulse if it breaks through the threshold. Pulse coding: Valid events are encoded as three-dimensional pulse vectors (timestamp offset, price change rate, and volume percentage). For example, if a pulse is triggered in the 3rd second of the window, the price rises by 1.5%, and the volume accounts for 8% of the total volume in the window, then the encoding is [3, 0.015, 0.08]. Matrix construction: All pulses are arranged in chronological order to form a pulse matrix with dimension N×3 (N is the number of pulses). If a window has no pulses, it is filled with a zero vector to maintain temporal continuity.
[0025] Dynamic threshold adjustment mechanism: If the pulse density (pulses / second) exceeds 5 for three consecutive windows, it is determined that market volatility has intensified, and the threshold coefficient is reduced from 1.5 to 1.2. If there are no pulses for 10 consecutive windows, the threshold coefficient is raised to 1.8 to filter noise.
[0026] Example of the final generated quantity-price characteristic pulse matrix: Window 1: [[0.5, 0.012, 0.06], [2.1, -0.008, 0.03], ...]; Window 2: [[0.0, 0.000, 0.00], [1.2, 0.018, 0.12], ...]. S2012, the phase difference between the quantity and price feature pulse matrix and the multi-factor time series data in the market is measured, and a time-varying convolution kernel is constructed through an adaptive time series alignment algorithm to dynamically compensate for the sampling frequency differences of different factors and output a time-axis aligned multi-factor tensor; Intraday multi-factor time-series data includes factors such as valuation (PE, PB), momentum (20-day return), and volatility (ATR), with varying sampling frequencies (e.g., PE updated every minute, ATR updated every 5 seconds). Phase difference measurement and alignment process: Time base alignment: Using 1 minute as the base time unit, high-frequency data (such as ATR) is downsampled (averaged), and low-frequency data (PE) is interpolated (linearly filled). Phase difference detection: Calculate the time offset of each factor from the price-volume pulse matrix. For example, detect the lag step (e.g., lag of 2 minutes) of the PE factor relative to the price pulse using the cross-correlation function (CCF). Construction of time-varying convolution kernels: Kernel size: 3×3 (time × factor dimension); Dynamic weight adjustment: The kernel function is dynamically scaled based on the phase offset. For example, for a PE factor with a lag of 2 minutes, the convolution kernel is shifted backward by 2 units on the time axis; Adaptive padding: Mirror padding is used for edge data to avoid information loss.
[0027] Timing alignment example: Assuming the timestamps of the price-volume pulse matrix are [09:30:00, 09:30:05, ...], and the original timestamps of the PE factor data are [09:30:02, 09:31:02, ...], after alignment: PE is interpolated to the previous value at 09:30:00 (if allowed) or marked as missing; By offsetting the convolution kernel to compensate for lag, we ensure that the factor value at each time point is spatiotemporally correlated with the pulse event.
[0028] Output multi-factor tensor structure: Dimensions: Number of time steps × Number of factors × Feature dimensions (e.g., 60 minutes × 15 factors × 3); Data example: Time point 09:30: [PE=12.3, PB=1.8, ATR=0.5, ..., Pulse Intensity=0.7]; Time point 09:31: [PE=12.2, PB=1.8, ATR=0.6, ..., Pulse intensity=0.4]. S2013 inputs the industry sector association graph into a dynamic graph neural network, reconstructs the node feature space through an edge weight adaptive allocation algorithm, and generates a standardized multi-factor feature matrix that matches the multi-factor tensor dimension.
[0029] The industry sector correlation graph is a directed weighted graph, where nodes represent sectors (e.g., semiconductors, pharmaceuticals) and edge weights represent the strength of correlation between sectors (based on upstream and downstream relationships in the industry chain, capital flows, etc.). Dynamic graph neural network processing flow: Node feature initialization: Each sector node is assigned an initial feature vector (such as the average PE ratio and momentum of individual stocks within the sector). Adaptive edge weight allocation: Static weights: based on historical correlations (such as the correlation coefficient of sector returns over the past 30 days). Dynamic weighting: Real-time capital flow intensity (e.g., when northbound capital flows into sector A, the edge weight of A→B increases). Attention mechanism: The attention coefficients between nodes are calculated through a multi-head graph attention network (GAT). For example, the attention weight of a semiconductor node to an electronic component node is 0.8. Feature propagation and aggregation: Neighborhood aggregation: For each node, aggregate the weighted sum of features of its one-hop neighbors. For example, a semiconductor node aggregates features such as electronic components (weight 0.8) and materials (weight 0.5). Multi-layer propagation: Stack 3 layers of GAT, each layer outputs 128 dimensions, and the final node feature dimension is 384 (3×128). Standardization and Alignment: Normalization: Z-score standardization is performed on each factor (mean = 0, standard deviation = 1); Dimensional matching: The graph node feature matrix (number of sectors × 384) is concatenated with the multi-factor tensor (time × factor × 3) to generate the final standardized matrix (time × (sector + individual stock) × factor).
[0030] Example output: The feature matrix at a certain time point contains: Sector characteristics: Semiconductors (PE=25, Momentum=0.12, Correlation Strength=0.8), Pharmaceuticals (PE=18, Momentum=0.05, Correlation Strength=0.3). Individual stock characteristics: Stock A (PE=20, Momentum=0.15, Impulse Intensity=0.6), Stock B (PE=22, Momentum=0.08, Impulse Intensity=0.4).
[0031] This step integrates tick-by-tick transaction data from the call auction phase, intraday multi-factor time-series data (such as valuation, momentum, volatility, etc.), and industry sector correlation graphs (describing the industrial chain or capital linkages between sectors). It employs dynamic threshold filtering technology to pulse-encode high-frequency price and volume data, eliminating noise interference. An adaptive time-series alignment algorithm unifies factor data of different frequencies, and a dynamic graph neural network is used to reconstruct the features of the industry correlation graph. Ultimately, a standardized multi-factor feature matrix with consistent dimensions and time alignment is generated. This solves the spatiotemporal alignment problem of heterogeneous data sources (high-frequency price and volume, time-series factors, and graph structure data), eliminates data sampling differences and noise interference, and provides unified and high signal-to-noise ratio input features for subsequent models, improving the stability and generalization ability of stock selection strategies.
[0032] S202, Based on the standardized multi-factor feature matrix, using a reinforcement learning model, the dynamic position allocation ratio and market environment risk level are output through the mapping relationship between historical market conditions and position returns. Specifically, it can include: S2021, inputting the standardized multi-factor feature matrix into the time-series pulse encoder, extracting historical market state segments through a sliding window, and generating a spatiotemporal encoding vector containing volume, price, volatility, and turnover rate; The core function of a Temporal Pulse Encoder (TPE) is to convert time-series data in a standardized multi-factor feature matrix into a encoded vector with spatiotemporal correlation. The specific steps are as follows: Data preprocessing and sliding window design: The standardized multi-factor feature matrix has the dimension N×T×F, where N is the number of stocks (e.g., 3000), T is the time step (e.g., the past 60 trading days), and F is the number of factors (e.g., 20 factors, including opening price, closing price, trading volume, etc.).
[0033] The sliding window uses a dynamic length design, with a window size W=30 (i.e., 30 trading days) and a step size S=5 (sliding once every 5 days). Each slide captures a data segment within the window, forming a historical market state segment with dimensions N×30×20.
[0034] Pulse coding and spatiotemporal feature extraction: Data within each window is fused using a pulse encoder. The encoder consists of a two-layer structure: Pulse Generation Layer: A gated recurrent unit (GRU) is used to encode the time series of each factor, generating preliminary time series features (such as short-term trends in volume and price). The hidden layer dimension of the GRU is H=64, and it outputs the hidden state at each time step.
[0035] Spatiotemporal convolutional layer: Uses 3D convolutional kernels (kernel size=3×3×3) to model the spatial relationships between multiple factors. For example, the interaction features between trading volume and price volatility are extracted through convolution, and the fused spatiotemporal encoding vector is output with dimensions of N×30×64.
[0036] Key Feature Aggregation: Feature selection is performed on the encoded vectors to retain core indicators (volume, price, volatility, turnover rate). For example, the importance score of each time step is calculated through an attention mechanism (Attention Weight), and the weighted sum is used to obtain the spatiotemporal encoded vector of each stock, with a dimension of N×128 (128-dimensional features).
[0037] Example parameters and effects: If a stock's trading volume pulse signal and price breakout signal are highly synchronized within a window (e.g., correlation coefficient > 0.8), then the value of the corresponding dimension in its encoding vector is significantly higher than that of other stocks.
[0038] Volatility features capture abnormal volatility patterns during periods of market panic (e.g., volatility standard deviation exceeding twice the historical average) through the hidden state of GRU.
[0039] S2022, adversarial risk distillation is performed on the spatiotemporal encoded vector. Market environment noise and core risk features are separated through game training between the generator and the discriminator, and a purified risk feature vector is output. Adversarial Risk Distillation (ARD) is a technique that combines Generative Adversarial Networks (GANs) with feature distillation, with the aim of separating core features related to market risk from the original spatiotemporal encoded vector.
[0040] Generator Design: The generator (G) employs a conditional variational autoencoder (CVAE) structure, taking a spatiotemporal encoded vector and a random noise vector (dimension Z=32) as inputs and outputting a reconstructed encoded vector. Its goal is to generate samples consistent with the distribution of real data, while incorporating risk labels (e.g., historical data from market crashes) as conditional constraints.
[0041] Encoder part: The input vector is mapped to the latent space (dimensional L=16) using a fully connected layer (FC layer).
[0042] Decoder section: Features are reconstructed through a deconvolution layer, and the output dimension is consistent with the original encoding vector (N×128).
[0043] Discriminator Design: The discriminator (D) is a convolutional neural network (CNN), which takes either a real or generated encoded vector as input and outputs two types of probabilities: Authenticity assessment: Determine whether the input is real data or generated data.
[0044] Risk attribute identification: Determine whether the input contains high-risk characteristics (such as high volatility and low liquidity).
[0045] Combat training process: Generator training: The goal of G is to deceive D, making it unable to distinguish between generated and real data, while ensuring that the generated data retains risk characteristics. Loss functions include: Adversarial Loss: Minimizes the discrimination error of D on the generated samples.
[0046] Reconstruction Loss: The mean squared error (MSE) constrains the similarity between generated samples and real samples.
[0047] Risk Consistency Loss: Guarantees that the risk attributes of the generated samples are consistent with the true labels through KL divergence.
[0048] Discriminator Training: The goal of D is to accurately distinguish between real and generated data and correctly identify risk attributes. Loss functions include: Binary Cross-Entropy (BCR) is a true classification loss method.
[0049] Risk attribute classification loss (Multi-label Cross-Entropy).
[0050] Feature purification output: After adversarial training, the generator filters out noise irrelevant to risk (such as short-term market sentiment noise) and retains core risk features (such as liquidity crisis signals). The final output Purified Risk Vector (PRV) has N×64 dimensions, where the 64 features represent the refined risk factors.
[0051] Example parameters and effects: During training, if a batch of data includes samples from the US stock market circuit breaker period in March 2020, the generator will strengthen the correlation between volatility and capital outflows, while weakening the impact of individual stock news events.
[0052] The discriminator achieved a risk attribute classification accuracy of 92% on the test set, indicating that it can effectively identify systemic risks.
[0053] S2023, based on risk feature purification vector, adopts drift plus penalty reinforcement learning algorithm, through the mapping relationship between historical market state and position return, combined with dynamic programming to solve the position allocation ratio, to obtain the optimized position allocation. The drift plus penalty reinforcement learning algorithm balances return and drawdown through Lyapunov stability constraint. Drift-Penalized Reinforcement Learning (DP-RL) is an algorithm that combines dynamic programming with stability constraints to find the optimal position allocation between returns and risks.
[0054] Definition of State and Action Space: State: A 64-dimensional feature of the Risk Feature Purification Vector (PRV), plus market environment indicators (such as the VIX fear index and the 10-year Treasury yield). The state dimension is 66.
[0055] Action: Position allocation ratio, represented as the weight vector (dimension N) of each stock in the stock portfolio, with the constraint that the total weight is 1 and the weight of a single stock does not exceed 5%.
[0056] Reward function design: The reward function includes a benefit term and a penalty term: Return Item: The daily return of the portfolio, calculated as R = Σ(weight_i × return_i).
[0057] Penalty items: Drawdown penalty: When the portfolio drawdown exceeds a threshold (e.g., 5%), a secondary penalty is applied (Penalty = λ × drawdown magnitude). 2 , λ=0.1).
[0058] Drift Penalty: Limits drastic changes in position allocation through Lyapunov stability constraints. For example, a linear penalty is applied if the standard deviation of position weight changes exceeds 2% between two consecutive trading days.
[0059] Strategy optimization and dynamic programming: Q-learning framework: It uses a deep Q-network (DQN) to approximate the Q-value function. The network structure is a 3-layer fully connected network (66-dimensional input layer, 128-dimensional hidden layer, and N-dimensional output layer).
[0060] Dynamic programming solution: Value Iteration: Updates the Q value based on the Bellman Equation, with the formula Q(s,a) = R(s,a) + γ × max Q(s',a'), where the discount factor γ = 0.95.
[0061] Policy Improvement: Update network parameters using gradient ascent to maximize cumulative rewards.
[0062] Lyapunov stability constraints: To balance returns and drawdowns, the algorithm introduces a Lyapunov function as a stability metric. For example, the function V(s) is defined as portfolio volatility + maximum drawdown, requiring that V(s') ≤ V(s) after each strategy update. If the constraint is violated, the penalty weights are adjusted using the Lagrange multiplier method.
[0063] Example parameters and effects: During a pullback, if market volatility suddenly increases on a particular day (the VIX index jumps from 20 to 40), the algorithm will shift positions from high-volatility technology stocks (such as TSLA) to defensive sectors (such as utilities).
[0064] The trained strategy achieved a Sharpe Ratio of 2.5 on the test set, with a maximum drawdown of less than 8%.
[0065] S2024 performs risk level clustering analysis on the optimized position allocation, projects multidimensional risk characteristics onto a discrete risk level space through a self-organizing mapping network, and outputs the final dynamic position allocation ratio and market environment risk level.
[0066] Self-Organizing Map (SOM) is an unsupervised clustering algorithm used to map high-dimensional risk features to a low-dimensional discrete space (e.g., 5 risk levels).
[0067] SOM network structure: Input layer: Optimized position allocation features (dimension N+2, including the weight of each stock, portfolio volatility, and maximum drawdown).
[0068] Competition layer: Two-dimensional grid structure (e.g., 5×5), where each node represents a cluster center.
[0069] Training process: Initialization: Randomly initialize the weight vectors of the competition layer nodes (with the same dimensions as the input layer).
[0070] Competition and Renewal: For each input sample, find the competing layer node (the winning node) with the closest Euclidean distance.
[0071] Update the weight vectors of the winning node and its neighboring nodes to move closer to the input sample. The neighborhood radius decays over time (initial radius = 3, final radius = 1).
[0072] Convergence criterion: Training stops when the change in the weight vector is less than a threshold (e.g., 0.1%).
[0073] Risk level classification: Based on the risk indicators (volatility, drawdown) of the nodes in the competition layer, the 5×5 grid is divided into 5 risk levels (from Level 1 low risk to Level 5 high risk).
[0074] For example, if the combined volatility of a node is less than 5% and the maximum drawdown is less than 3%, it is marked as Level 1; if the volatility is greater than 20% and the drawdown is greater than 15%, it is marked as Level 5.
[0075] Dynamic position allocation output: The final position allocation is adjusted based on the risk level. For example: Level 1 (Low Risk): The maximum equity position is increased to 7%, with an increase in the weighting of highly liquid blue-chip stocks.
[0076] Level 5 (High Risk): The maximum equity position is reduced to 3%, and the proportion of cash or hedging instruments is increased.
[0077] Example parameters and effects: During the Fed’s rate hike cycle in 2022, SOM raised the market risk level from Level 2 to Level 4, and the system automatically reduced the total position from 95% to 70%.
[0078] Clustering results show that the typical combination characteristics of Level 3 risk level are volatility of 12% and industry concentration (Herfindahl index) of 0.25.
[0079] By employing adversarial risk distillation techniques to extract features from historical market conditions (such as price and volume fluctuations, turnover rate, and volatility), market noise and core risk factors are separated. A drift-penalized reinforcement learning algorithm (DRL-PPO) combined with dynamic programming is used to optimize position allocation. Lyapunov stability constraints are utilized to control drawdown risk, and multidimensional risk features are clustered into discrete risk levels based on self-organizing map networks (SOMs) to generate dynamic position allocation ratios and risk ratings. This achieves dynamic adaptation of position allocation to the market environment, balancing returns and risks, avoiding extreme drawdowns through stability constraints, and quantifying market risk levels to provide a risk perception basis for subsequent sector and stock selection.
[0080] S203. Based on the market environment risk level, a graph attention network is used to score the sector direction. By aggregating the factor characteristics of individual stocks within a sector and the cross-sector correlation strength, a sector heat distribution map and a priority ranking list are generated. Specifically, it can include: S2031, based on the risk level of the market environment, using heterogeneous graph convolutional networks to reconstruct the industry sector correlation graph, and using node feature enhancement technology to integrate the factor features of individual stocks within the sector to generate an enhanced sector relationship graph; The core of this step is to use a Heterogeneous Graph Convolutional Network (HGCN) to fuse industry sector correlation graphs with individual stock multi-factor features, generating an enhanced sector relationship graph that reflects the risk level of the market environment.
[0081] Input data and graph structure definition: Industry Sector Relationship Map: Using industry sectors as nodes (e.g., 50 sectors such as "Semiconductors", "New Energy", and "Pharmaceuticals"), the edge weights represent the correlation strength between sectors (initial values are based on upstream and downstream relationships in the industry chain or historical return correlation).
[0082] Market Environment Risk Level: The discrete risk levels (e.g., Level 1 to Level 5) output from the preceding steps are used to adjust the dynamic properties of the graph structure. For example, at high risk levels (Level 4-5), the edge weights of defensive sectors (such as utilities) may be strengthened.
[0083] Individual stock factor features: Each sector contains factor data (such as price-to-earnings ratio, ROE, momentum factor) of multiple individual stocks, which need to be aggregated into sector-level features.
[0084] Heterogeneous Graph Convolutional Network Design: Node feature aggregation: The factor characteristics of individual stocks within each sector are weighted and averaged, with the weights determined by the market capitalization percentage of each stock. For example, if a stock in the semiconductor sector accounts for 10% of the market capitalization, then its factor characteristics (such as momentum factor 0.8) contribute 10% of the weight.
[0085] After aggregation, the feature dimension of each sector node is F=20 (e.g., including factors such as valuation, growth, and volatility).
[0086] Dynamic edge weight adjustment: The initial edge weights are adjusted using a threshold function based on the market environment risk level. For example, if the risk level is ≥ Level 3, the correlation weight between defensive sectors and high-volatility sectors is reduced by 50%.
[0087] Edge weight calculation formula: Adjusted weight = Original weight × (1 - Risk level decay coefficient), where the decay coefficient is 0.3 at Level 3 and 0.7 at Level 5.
[0088] Heterogeneous graph convolution operation: Different types of edges (such as "supply chain" and "financial linkage") are processed using categorized convolutional kernels. Each edge type corresponds to an independent convolutional layer, and the output features are merged by concatenation.
[0089] Example parameters: Convolutional layer hidden dimension H=64, number of edge types E=3 (supply chain, capital linkage, policy linkage), and final node feature dimension is 64×3=192.
[0090] Node feature enhancement technology: Attention-weighted fusion: Attention weights are assigned to individual stock factors within a sector. For example, if the momentum factors of individual stocks within a sector differ significantly, then stocks with high momentum are given higher weights.
[0091] Attention score calculation: Individual stock factors are mapped to attention scores through a fully connected layer (FC Layer) and normalized using Softmax.
[0092] Risk level feature injection: The market environment risk level (such as Level 3) is encoded as a 5-dimensional unique hot vector, which is then concatenated with the sector node features to form the final enhanced node features (dimensions 192+5=197).
[0093] Output: Enhanced Plot Relationship Graph: Contains 50 plot nodes, each with 197 feature dimensions, and the edge weights are dynamically adjusted to a range of [0.1, 0.9].
[0094] Example scenario: When the risk level is Level 4, the supply chain correlation weight between the new energy sector and the semiconductor sector decreases from 0.6 to 0.3, while the defensive correlation weight between the pharmaceutical sector and the utilities sector increases from 0.4 to 0.6.
[0095] A certain semiconductor sector node aggregates the factor characteristics of 10 individual stocks, among which the momentum factor (0.9) of the leading stock with a market capitalization of 30% dominates the sector momentum score.
[0096] S2032, Perform multi-head graph attention mechanism processing on the enhanced plate relationship graph, calculate the attention weight of the plate nodes, and output the plate importance score vector; This step uses a Multi-Head Graph Attention Network (GAT) to capture the complex dependencies between sectors and generate sector importance scores.
[0097] Multi-head attention mechanism design: Single-head attention calculation: For each sector node, calculate its attention coefficient with all neighboring nodes. For example, the new energy node will focus on the semiconductor (supply chain), lithium battery (upstream and downstream), and power equipment (application end) sectors.
[0098] Attention coefficient formula: coefficient_ij = LeakyReLU(weight matrix × [node i feature || node j feature]), where || represents concatenation, and the weight matrix has a dimension of 197×128.
[0099] Multi-head expansion and integration: Use K=8 independent attention heads, each of which generates independent attention weights.
[0100] The output feature dimension of each head is H=32, and the total dimension after concatenation is 8×32=256.
[0101] Finally, the 256-dimensional features are compressed into 64 dimensions through a fully connected layer, which serves as the attention enhancement features for the plate nodes.
[0102] Importance score generation: Global pooling and scoring: Global average pooling is performed on the 64-dimensional features of each segment node to generate a 1-dimensional importance score.
[0103] The score is normalized to [0,1] using the Sigmoid function, which indicates the market importance of the sector (e.g., 0.8 indicates high priority).
[0104] Dynamic weight calibration: The scores are non-linearly calibrated based on the risk level. For example, at a high risk level, the scores of defensive sectors improve more significantly (the slope of the calibration function increases by 50%).
[0105] Output: Sector Importance Scoring Vector: 50×1 in length, for example, semiconductor sector scores 0.85, new energy sector scores 0.78, and pharmaceutical sector scores 0.65.
[0106] Example scenario: Among the bullish attention, one focus is on supply chain relationships, giving the semiconductor sector a high weight (0.9) over the new energy sector, while the other focuses on policy connections, giving the pharmaceutical sector a medium weight (0.6) over the medical equipment sector.
[0107] After global pooling, the semiconductor sector achieved a final score of 0.85, ranking first due to the high-weight aggregation of multiple attention points.
[0108] S2033 quantifies the inter-sectoral capital flow and industrial chain linkage effect through a cross-sectoral correlation strength algorithm, generating a sector correlation strength matrix; This step involves quantifying capital flows and industry chain linkages to construct a correlation strength matrix between sectors, providing transmission parameters for the spread of popularity.
[0109] Methods for quantifying cash flow: Calculation of main capital flow: Based on transaction data, the net inflow of main funds (single transaction amount > 1 million yuan) between sectors is calculated. For example, on a certain day, the semiconductor sector had a net inflow of 1 billion yuan, while the new energy sector had a net outflow of 500 million yuan.
[0110] Calculation of capital flow intensity: Intensity_ij = Amount of funds flowing from sector i to sector j / Total transaction amount of sector i, normalized to [0,1].
[0111] Time-series sliding window smoothing: Use a moving average with a window size W = 5 days to eliminate short-term noise. For example, the average daily capital inflow intensity of the semiconductor sector over the past 5 days is 0.7.
[0112] Modeling the linkage effect of the industrial chain: Granger causality test: Examine the lead-lag relationship between sector returns. For example, does a change in the semiconductor sector's return significantly affect the new energy sector (lag by 1 day)?
[0113] If the p-value is less than 0.05, then the existence of industrial chain linkage is considered, and the linkage strength is 1 - p-value (e.g., the strength is 0.98 when p=0.02).
[0114] Cointegration analysis: The Johansen test is used to determine the long-term equilibrium relationship between sectors. For example, the lithium battery and new energy vehicle sectors have a cointegration relationship, the strength of which is the absolute value of the cointegration coefficient (e.g., 0.8).
[0115] Matrix fusion and normalization: Weighted fusion strategy: The intensity of capital flow and the intensity of industrial chain linkage are combined with a weight of 6:4. The formula is: Final intensity_ij = 0.6×capital intensity + 0.4×industrial chain intensity.
[0116] Normalization processing: The correlation strength of each row is normalized using Softmax to ensure that the total correlation of the output of each block is 1.
[0117] Output: Sector correlation strength matrix: 50×50, for example, semiconductor → new energy has a strength of 0.6, and pharmaceuticals → utilities has a strength of 0.8.
[0118] Example scenario: Granger test results show that the semiconductor sector leads the new energy sector by 1 day in terms of return change (p=0.01), therefore the industrial chain strength of semiconductor → new energy is 0.99.
[0119] Over the past 5 days, the semiconductor sector saw a net inflow of funds accounting for 70%, while the new energy sector experienced a net outflow of funds accounting for 30%, resulting in a fund flow intensity of 0.7. The final intensity of the weighted convergence of semiconductors and new energy is 0.6 × 0.7 + 0.4 × 0.99 = 0.816.
[0120] S2034 inputs the sector importance score vector and correlation strength matrix into the heat diffusion model, simulates the flow of funds based on the heat conduction equation, and outputs a sector heat distribution map; This step simulates the flow of funds between sectors using the heat conduction equation, generating a heat distribution map to reflect the future direction of fund concentration.
[0121] Discretization of the heat conduction equation: Model parameter settings: Initial popularity value: Sector importance score vector (e.g., semiconductors 0.85, new energy 0.78).
[0122] Thermal conductivity coefficient: determined by the correlation strength matrix, for example, the coefficient for semiconductor → new energy is 0.816.
[0123] Time step and number of iterations: Set T=10 iterations, step size Δt=0.1 for each iteration, and total simulation time 1.0 (unit time).
[0124] Discretization formula: Popularity update rule: Popularity_i(t+1) = Popularity_i(t) +Σ(Correlation strength_ji×Popularity_j(t) - Correlation strength_ij×Popularity_i(t))×Δt.
[0125] Example of simulation process: initialization: Semiconductors have a popularity index of 0.85, new energy 0.78, pharmaceuticals 0.65, and other sectors follow the same pattern.
[0126] First iteration (t=0→0.1): The amount of heat transferred from semiconductors to new energy sources is 0.85 × 0.816 × 0.1 = 0.0696, and the heat of new energy sources is updated to 0.78 + 0.0696 = 0.8496.
[0127] Heat transferred from new energy sources to semiconductors: 0.78 × 0.2 (assuming reverse strength) × 0.1 = 0.0156, semiconductor heat is updated to 0.85 + 0.0156 = 0.8656.
[0128] Tenth iteration (t=1.0): The semiconductor sector's heat index converged to 0.92, new energy to 0.88, and pharmaceuticals to 0.75, forming a steady-state distribution.
[0129] Heat calibration and visualization: Nonlinear amplification: The final popularity value is exponentially amplified (based on a base of 2) to enhance the differentiation of leading sectors. For example, the popularity of semiconductors changes from 0.92 to 0.92^2 = 0.846.
[0130] Heat map generation: The sectors are mapped to a color gradient from high to low popularity (red for high popularity, blue for low popularity), and the main paths of capital flow are marked (e.g., semiconductors → new energy → lithium batteries).
[0131] Example scenario: After 10 iterations, the semiconductor sector, due to its high initial score and strong correlation, saw its popularity score rise to 0.92, becoming the core area for capital accumulation.
[0132] Although the pharmaceutical sector initially had a low score, its popularity rose from 0.65 to 0.75 due to its strong correlation with defensive sectors (strength 0.8).
[0133] S2035 performs topological sorting on the heat map of the sectors, determines the sector rotation priority through the critical path extraction algorithm, and generates a priority ranking list of sectors.
[0134] This step uses graph theory algorithms to extract the critical paths of heat transmission and determine the order of sector rotation.
[0135] Topological sorting algorithm design: Directed Acyclic Graph (DAG) Construction: Convert the sector correlation strength matrix into directed edges, and retain edges with a strength > 0.5 (e.g., semiconductor → new energy with a strength of 0.816 is retained).
[0136] Remove cycles: If a cycle A→B→C→A exists, keep only the two edges with the highest strength (such as A→B and B→C).
[0137] Topological sorting execution: Using the Kahn algorithm, nodes are sorted in ascending order by their in-degree (the number of heat sources being conducted). Nodes with an in-degree of 0 (such as semiconductors, the initial heat source) are output first.
[0138] Critical path extraction method: Longest path algorithm: The total score of a path is calculated based on its popularity score and edge weights. For example, the score for the path Semiconductor → New Energy → Lithium Battery is 0.92 + 0.88 + 0.8 (cumulative edge weights).
[0139] Use dynamic programming (DP) to traverse all possible paths and select the top 3 paths with the highest total scores.
[0140] Path weight normalization: Assign weights to nodes on the critical path based on their level of participation. For example, if semiconductors appear in both critical paths, their weight is increased by 20%.
[0141] Priority list generation: Comprehensive sorting rules: Segment priority = Topology sort position × 40% + Critical path weight × 60%.
[0142] Example sorting results: Semiconductors (priority score 95); New energy (score 88); Lithium battery (score 82); Medicine (score 75).
[0143] Example scenario: In the topological sort, semiconductors are ranked first due to their in-degree of 0, while new energy sources are ranked second due to their dependence on semiconductors.
[0144] The critical path "semiconductors → new energy → lithium batteries" had the highest total score (0.92 + 0.88 + 0.8 = 2.6), thus placing lithium batteries in the top three.
[0145] This paper enhances the node features of industry sector correlation graphs (such as the average valuation and momentum factors of individual stocks within a sector) by using HeteroGraph Convolutional Network (HeteroGCN). It calculates the importance weight of sectors through a multi-head graph attention mechanism (GAT), quantifies capital flow and industrial chain linkage effects by combining cross-sector correlation strength algorithm, and simulates capital diffusion paths using heat conduction equation. Finally, it generates a sector heat distribution map and a priority list of topological sorting to capture sector rotation trends and capital aggregation effects. By improving the interpretability of sector scoring through graph structure modeling, it provides directional guidance for stock selection and avoids excessive exposure to risks in a single sector.
[0146] S204. Based on the priority ranking list of the sectors, perform pattern scoring on individual stocks within the target sector, and integrate multi-factor pattern labels of individual stocks with intraday capital flow data through a spatiotemporal attention mechanism to output a pattern scoring matrix that includes the strength of buy signals. Specifically, it can include: S2041, based on the sector priority ranking list, using a spatiotemporal convolutional network to extract multi-factor morphological features of individual stocks within the target sector, generating a pattern feature vector containing valuation, momentum, and volatility; The core of this step is to extract multi-factor morphological features from individual stocks in the target sector using a Spatio-Temporal Convolutional Network (STCN) to generate pattern feature vectors that can characterize the short-term trend and long-term value of stocks.
[0147] Target sector selection and data preparation: Sector priority ranking list: For example, the top three sectors are semiconductors (score 0.92), new energy (0.88), and lithium batteries (0.82).
[0148] Individual stock data range: The top 30 stocks by market capitalization in each sector (such as stocks A, B, and C in the semiconductor sector), totaling 90 stocks.
[0149] Multi-factor data source: including 10 factors such as valuation factors (PE ratio, PB ratio), momentum factors (20-day return, 60-day volatility), and volatility factors (ATR indicator, Beta value), with data frequency at the minute level.
[0150] Spatiotemporal convolutional network architecture design: Temporal Convolution: Using a one-dimensional convolution kernel (length K_t=5) sliding window, the local patterns of factors over time series are captured. For example, short-term fluctuations in the 20-day momentum factor (such as an increase of more than 5% within 3 days) are identified as "short-term strength".
[0151] Example parameters: number of channels in the convolutional layer C_t=32, stride S_t=2, output time dimension compressed to 1 / 2 of the original length.
[0152] Spatial Convolution: A two-dimensional convolution kernel (size K_s=3×3) is used to perform cross-calculation on different factors at the same point in time. For example, a combination of high PE (valuation) and low volatility (risk) may be identified as a "valuation safety zone".
[0153] Example parameters: number of channels in the convolutional layer C_s=64, output spatial feature dimension is 64×10 (10 factors).
[0154] Feature fusion and pooling: The outputs of temporal and spatial convolutions are concatenated to form a (T / 2) × 64 × 10 feature tensor, which is then compressed into a 64×10 vector using global max pooling.
[0155] The final pattern feature vector dimension is F=640 (64 channels × 10 factors).
[0156] Dynamic module adaptation mechanism: The convolution kernel weights are adjusted for different sectors. For example, the momentum factor weight is higher for the semiconductor sector (0.8), while the valuation factor weight is higher for the new energy sector (0.6).
[0157] Weighting adjustment rules: Dynamically allocated based on sector priority scores. For each priority level increase, the momentum factor weight increases by 10%.
[0158] Output: Pattern Feature Vector: Each stock outputs a 640-dimensional vector. For example, in the vector of stock A, the valuation factor accounts for 30%, the momentum factor for 50%, and the volatility for 20%.
[0159] Example scenario: In the spatiotemporal convolution, the cross calculation of the 20-day momentum factor (0.9) and the 60-day volatility (0.3) of individual stock B in the semiconductor sector is identified as a "high momentum, low risk" pattern, with the corresponding dimension activation value in the feature vector reaching 0.85.
[0160] Stock C in the new energy sector triggered a valuation alarm based on spatial convolution due to a sudden increase in its PE ratio (from 20 to 25), with the valuation factor accounting for 40% of the feature vector.
[0161] S2042, perform spatiotemporal attention alignment between the pattern feature vector and the intraday capital flow data, fuse the capital flow impact signal through a dynamic weight allocation mechanism, and output the spatiotemporal fusion feature tensor; This step uses a spatio-temporal attention mechanism to align the multi-factor characteristics of individual stocks with real-time capital flow data, resolving the differences between the two in terms of time granularity (minutes vs. seconds) and spatial dimension (factors vs. capital).
[0162] Intraday fund flow data processing: Data source: Main force capital flow in transaction data (single transaction amount > 500,000 yuan), and statistics of net inflow per minute (unit: million yuan).
[0163] Feature engineering: Calculate the impact intensity of capital flow (net inflow / market capitalization of individual stock). For example, the impact intensity of individual stock A at 10:30 is 5 million / 1 billion = 0.005.
[0164] Design of spatiotemporal attention mechanism: Timeline alignment: We downsampled the minute-level multi-factor features (640 dimensions) and second-level capital flow data to the minute level, retaining the maximum value (peak capital impact).
[0165] For example, the peak value of the second-level capital flow of individual stock A, which was 0.008, between 10:30:00 and 10:30:59, was retained as a minute value.
[0166] Attention weight calculation: Time Attention: Calculates the importance of fund flows at different points in time. For example, the fund flow weight in the first 30 minutes of trading (9:30-10:00) is 0.7, and in the last 30 minutes of trading (14:30-15:00) it is 0.5.
[0167] Spatial Attention: Assigning weights to cash flows based on factor type. For example, the momentum factor has a weight of 0.8 with cash flows, while the valuation factor has a weight of 0.3.
[0168] Attention score formula: score = Softmax (temporal weight × spatial weight), normalized to [0,1].
[0169] Dynamic fusion: The fund flow impact signal is weighted according to attention weight and injected into the multi-factor feature. For example, if the fund flow weight is 0.8 in a certain minute, the momentum factor feature value is updated to the original value + 0.8 × fund flow impact.
[0170] Example parameters: Number of multi-head attention heads H=4, and the fusion dimension of each head is 160 (640 / 4).
[0171] Output: Spatiotemporal fusion feature tensor: dimension is N×T×640 (N=90 stocks, T=240 minutes). For example, in the feature vector of stock A at 10:30, the momentum factor is enhanced by 0.6 due to capital inflow.
[0172] Example scenario: At 14:00, a single buy order of tens of millions of yuan appeared in stock B (impact intensity 0.01). The time weight of the space-time attention mechanism was set to 0.9 (sensitive period at the end of the trading day), and the space weight was associated with the momentum factor (0.8). Finally, the momentum characteristic value was increased from 0.7 to 0.8.
[0173] Due to capital outflow in the morning session (impact intensity -0.005), the valuation factor weight of stock C was reduced to 0.2 to avoid interference from erroneous signals.
[0174] S2043 inputs the spatiotemporal fusion feature tensor into the pulse-triggered scoring model, calculates the buy signal strength based on the historical similar pattern return distribution, and generates an initial signal strength matrix; This step uses the Pulse-Triggered Scoring Model (PTSM) to match historical similar patterns, calculate the probability distribution of future returns, and generate an initial buy signal.
[0175] Building a historical pattern library: Data range: Minute-level data of individual stocks over the past 3 years, extracting more than 100,000 multi-factor pattern segments (each segment length L=60 minutes).
[0176] Feature clustering: The K-Means algorithm (K=500 clusters) is used to classify historical segments, for example, category 1 is "high momentum breakout" and category 2 is "undervalued rebound".
[0177] Pulse-triggered scoring process: Real-time pattern matching: For the spatiotemporal fusion feature tensor (640 dimensions) at the current moment, the 100 most similar historical segments are retrieved using cosine similarity. For example, the current pattern of stock A has a similarity of 0.92 with historical category 1.
[0178] Calculation of yield distribution: The distribution of returns for similar segments over the next hour, day, and three days is statistically analyzed. For example, the average daily return for category 1 is 3%, with a positive return probability of 70%.
[0179] Signal strength generation: Signal strength formula: Strength = Mean return × Probability of positive return × Confidence level, where the confidence level is weighted by similarity (e.g., when the similarity is 0.9, the confidence level is 0.95).
[0180] Example: If the mean is 3%, the probability is 70%, and the confidence level is 0.95, then the signal strength is 3 × 0.7 × 0.95 ≈ 2.0.
[0181] Dynamic threshold filtering: The signal threshold is adjusted based on sector priority. For example, the threshold for the semiconductor sector is set to 1.5 (a buy signal is triggered only if the threshold is higher than 1.5), while that for the pharmaceutical sector is set to 1.0.
[0182] Threshold rule: For every priority level increased, the threshold increases by 0.2.
[0183] Output: Initial signal strength matrix: 90×3 (90 stocks × 3 time windows), for example, stock A has a 1-day signal strength of 2.0 and a 3-day signal strength of 1.8.
[0184] Example scenario: Stock B matched historical category 5 ("Volatility contraction breakout"), with an average 1-day return of 4%, a positive probability of 80%, and a similarity of 0.88. The signal strength was 4 × 0.8 × 0.88 ≈ 2.81, exceeding the semiconductor sector threshold of 1.5, triggering a strong buy signal.
[0185] Stock C was filtered out because the positive probability of similar segments was only 50% (mean 1%), and the signal strength was 0.5.
[0186] S2044 generates virtual extreme samples from the initial signal intensity matrix, enhances the robustness of the model through adversarial training, and uses a residual compensation algorithm to correct overfitting bias, outputting a signal intensity matrix with enhanced stability. This step uses a Generative Adversarial Network (GAN) to create virtual samples in extreme market scenarios, improving the model's stability in rare events such as crashes or surges.
[0187] Virtual extreme sample generation: Generator Design: Input noise vector (dimension Z=100), output analog signal strength matrix (dimension 90×3).
[0188] Generator structure: 4-layer fully connected network (number of neurons 256→128→64→90×3), activation function is LeakyReLU (slope 0.2).
[0189] Discriminator Design: Input a real or generated signal matrix, and output the probability of being true or false.
[0190] Discriminator structure: 3-layer convolutional network (number of channels 32→64→128), kernel size 3×3, and finally output probability through Sigmoid.
[0191] Adversarial training strategy: Generator objective: To generate samples that closely approximate the distribution of real data and include extreme values. For example, to simulate a market crash where the signal strength drops sharply to -3.0.
[0192] Discriminator objective: To distinguish between real data and generated data, forcing the generator to improve realism.
[0193] Residual compensation algorithm: Overfit detection: Calculate the signal strength error (MAE) between the training set and the validation set. If the error difference is greater than 20%, it is considered overfitting.
[0194] Residual learning: Add a residual block with a 2-layer fully connected structure (64 neurons → 64) to learn the prediction error.
[0195] Residual output compensation formula: Corrected strength = Original strength + Residual × Compensation coefficient (default 0.5).
[0196] Training process: Phase 1 (Combat Training): The training epoch is 100, the batch size is 32, and the generator and discriminator are updated alternately.
[0197] Phase Two (Residual Compensation): With fixed generator weights, only the residual module is trained, with Epoch=50 and learning rate LR=0.001.
[0198] Output: Enhanced stability signal matrix: For example, the 1-day signal strength of stock A is corrected from 2.0 to 1.8 (residual compensation -0.2), and the volatility is reduced by 30% in extreme scenarios.
[0199] Example scenario: The generator simulates a market circuit breaker scenario, generating a signal strength of -2.5 for stock B (the lowest historical value is -1.0). The discriminator identifies this as a "fake sample," forcing the generator to adjust to a reasonable range of -1.5.
[0200] The residual module detected that stock C had an error of 0.1 in the training set (0.3 in the validation set), and the compensation coefficient was increased to 0.7. The strength after correction decreased from 1.6 to 1.4.
[0201] S2045 performs joint calibration of the signal strength matrix and the sector heat distribution map, eliminates the scoring deviation between sectors through nonlinear interpolation technology, and finally outputs a pattern scoring matrix that includes the strength of buy signals.
[0202] This step uses non-linear interpolation to correlate the strength of individual stock signals with the popularity of the sector, eliminating scoring bias caused by uneven popularity of sectors.
[0203] Sector popularity distribution map compilation: Popularity data: The popularity value of the sector ranges from [0,1] (e.g., semiconductors 0.92, new energy 0.88), generated by the heat diffusion model.
[0204] Popularity-Signal Mapping Rules: For stocks in high-heat sectors (>0.8), the signal strength is increased by 10% × (heat value -0.8). For example, the semiconductor sector (0.92) is increased by 10% × 0.12 = 1.2%.
[0205] For stocks in low-heat sectors (<0.5), the signal strength is reduced by 5% × (0.5 - heat value). For example, the pharmaceutical sector (0.4) is reduced by 5% × 0.1 = 0.5%.
[0206] Nonlinear interpolation techniques: Bicubic interpolation: On a two-dimensional grid of sectors and individual stocks, the signal strength is adjusted by interpolation based on the heat values of four adjacent sectors.
[0207] Example: A stock belongs to the semiconductor sector (popularity 0.92) but is close to the new energy sector (0.88). Its signal strength is adjusted by distance-weighted average.
[0208] Edge compensation: For stocks at the edge of a sector (such as those spanning the semiconductor and electronics sectors), a smooth transition is achieved with an interpolation window radius of R=2 (two adjacent sectors).
[0209] Post-calibration score generation: Formula example: The original signal strength of stock A is 2.0, the popularity of its semiconductor sector is 0.92, and the popularity of neighboring sectors is 0.85. After interpolation, the strength is 2.0 × 1.12 = 2.24.
[0210] Deviation correction: If the standard deviation of the signal strength of individual stocks within a sector is greater than 0.5, homogenization is triggered, compressing the dispersion by 30%.
[0211] Output: Pattern scoring matrix: 90×3 dimensions. For example, stock A in the semiconductor sector has a strength of 2.24 after calibration after 1 day, and stock B in the new energy sector has a strength of 1.98.
[0212] Example scenario: Stock C belongs to the semiconductor sector but is located on the periphery (the adjacent electronics sector has a heat index of 0.75). Its signal strength is adjusted from 1.8 to 1.8 × (0.92 × 0.6 + 0.75 × 0.4) = 1.8 × 0.87 = 1.57 through interpolation.
[0213] For stock D in the pharmaceutical sector, the signal strength dropped from 0.5 to 0.475 due to the sector's popularity level of 0.4. However, because the standard deviation within the sector was greater than 0.5, it was eventually corrected to 0.5 (homogenization).
[0214] Spatiotemporal Convolutional Network (STCN) is used to extract multi-factor morphological features of individual stocks (such as valuation-momentum combination patterns and volatility curves). Spatiotemporal attention mechanism is used to align intraday capital flow data (such as large order inflows and main force capital movements) and dynamically integrate capital flow impact signals. The buy signal strength is calculated by using an impulse-triggered scoring model combined with the return distribution of historical similar patterns. The robustness of the model is enhanced through adversarial training and residual compensation algorithms. Finally, a highly stable pattern scoring matrix is generated to identify short-term trading opportunities and long-term value characteristics of individual stocks. The timeliness of the signals is enhanced by combining capital flow dynamics, avoiding misjudgments caused by market noise and improving the accuracy and stability of stock selection signals.
[0215] S205. Based on the dynamic position allocation ratio, the sector priority ranking list, and the pattern scoring matrix, a multi-objective optimization algorithm is used to generate the final investment portfolio. The multi-objective optimization algorithm simultaneously optimizes the return-risk ratio and factor exposure, and outputs an interpretable stock selection decision chain through a visual interface.
[0216] Specifically, it may include: S205, which uses a dynamic threshold filtering algorithm to screen high-scoring stocks in the target sector based on the dynamic position allocation ratio and the sector priority ranking list, and generates an initial investment candidate pool; The core of this step is to use a dynamic threshold filtering algorithm, combined with global constraints on position allocation and sector priority, to select stocks with high signal strength and controllable risk from the target sector, forming a preliminary investable stock pool.
[0217] Analysis of Dynamic Position Allocation Ratios: Position allocation rules: For example, when the market risk level is medium risk (level 2 / 5), the dynamic position allocation ratio is 60% equity assets (of which semiconductor sector accounts for 30%, new energy 25%, and lithium battery 15%), and cash 40%.
[0218] Sector Priority Weighting: Based on the sector priority ranking list (e.g., semiconductor score 0.92, new energy 0.88, lithium battery 0.82), the initial allocation weight of each sector is the sector score / total score. For example, the semiconductor weight is 0.92 / (0.92 + 0.88 + 0.82) = 0.35.
[0219] Dynamic threshold filtering algorithm design: Signal strength threshold calculation: The signal strength threshold is dynamically adjusted based on sector priority. For example, the thresholds for the top three priority sectors (semiconductors, new energy, and lithium batteries) are set to 0.8, 0.75, and 0.7 respectively (the threshold decreases as priority decreases).
[0220] Formula: Threshold = Base threshold (0.7) + Priority coefficient (0.02 × rank). For example, if semiconductor is ranked 1st, the threshold is 0.7 + 0.02 × 1 = 0.72 (actually adjusted according to business needs).
[0221] Candidate pool selection logic: Signal strength filtering: Only stocks with signal strength exceeding a threshold in the pattern scoring matrix are retained. For example, stock A in the semiconductor sector has a 1-day signal strength of 2.24 (threshold 0.72), and is therefore included in the candidate pool.
[0222] Risk Level Filtering: Remove stocks whose market environment risk level is higher than the current level. For example, if the current risk level is 2, then stocks with a risk level of ≥3 will be filtered out.
[0223] Sector capacity control: A maximum of 20 stocks will be selected from each sector (to avoid over-concentration). If more are selected, they will be truncated from highest to lowest signal strength. For example, if 25 stocks in the semiconductor sector meet the criteria, only the top 20 will be retained.
[0224] Initial candidate pool output: Candidate pool size: Assume 20 stocks are retained from each of the three sectors, for a total of 60 stocks.
[0225] Data structure: Includes fields such as stock code, signal strength (1 day / 3 days / 5 days), sector, and risk level. For example, see Table 1: Table 1:
[0226] Example scenario: Stock B in the lithium battery sector was filtered out due to its signal strength of 0.68 (threshold 0.7), while stock C was selected due to its signal strength of 0.73.
[0227] Due to its risk level of 2, stock D (risk level 3) in the new energy sector was removed, while stock E (risk level 1) was retained.
[0228] S2052: Input the pattern score matrix of individual stocks in the initial investment candidate pool into the multi-objective optimizer, and simultaneously optimize the return-risk ratio and factor exposure through dynamic weight allocation technology to construct a non-conflict optimization objective function; This step uses a multi-objective optimizer to find a balance between the return-risk ratio and factor exposure, ensuring the portfolio performs robustly in different market environments.
[0229] Multi-objective optimizer architecture: Optimization target definition: The Sharpe Ratio maximizes the return per unit of risk, calculated as (expected return - risk-free rate) / return volatility. Assuming a risk-free rate of 2%, the expected return is backtested based on historical similar patterns (e.g., the expected return for stock A in one day is 3%).
[0230] Factor Exposure: Controls the portfolio's sensitivity to specific factors (such as momentum or valuation) and avoids over-reliance on a single factor. For example, the portfolio's momentum factor exposure should be limited to ±10%.
[0231] Dynamic weight allocation technique: Weighting adjustment rules: The target weights are dynamically adjusted based on the risk level of the market environment. For example: Low-risk environment (Level 1): Risk-reward ratio weighted at 70%, factor exposure at 30%.
[0232] High-risk environment (Level 3): Risk-reward ratio weighted at 50%, factor exposure at 50%.
[0233] Formula: Weight = Base weight + Risk level × Adjustment coefficient. For example, when the risk level is 2, the return-risk ratio weight is 60% + 2 × 5% = 70% (needs to be calibrated according to actual parameters).
[0234] Construction of non-conflicting objective functions: Risk-reward ratio calculation: The historical simulation method is used to estimate the distribution of individual stock returns. For example, the 1-day return of stock A is 3% ± 1.5% (mean ± standard deviation), and that of stock B is 2% ± 1%.
[0235] Portfolio return-risk ratio formula: Portfolio Sharpe ratio = (Portfolio expected return - 2%) / Portfolio return volatility.
[0236] Factor exposure calculation: Portfolio factor exposure is calculated using a linear weighting method. For example, the momentum factor exposure in the portfolio is Σ(stock weight × stock momentum factor value), which needs to be limited to -10% to +10%.
[0237] The same applies to other factors such as valuation factor (PE) and volatility factor (Beta).
[0238] Multi-objective optimization algorithm selection: NSGA-II (Non-dominated sorting genetic algorithm): Population size: Set 500 candidate portfolios, each portfolio contains 60 stocks with weighted allocation (total weight of 100%).
[0239] Crossover and mutation: Simulated binary crossover (SBX) and polynomial mutation are used, with a crossover probability of 0.9 and a mutation probability of 0.1.
[0240] Dynamic constraint handling: Hard constraints: Individual stock weight ≥ 0 (short selling is prohibited), single stock weight ≤ 5% (to diversify risk).
[0241] Soft constraints: Factor exposure is handled through a penalty function, for example, the portion exceeding ±10% is included in the objective function as a squared error.
[0242] Example scenario: At risk level 2, the portfolio has a return-risk ratio of 1.5 and a momentum factor exposure of 12%. Due to exceeding the constraints, a penalty is triggered, and the objective function value is reduced by 20%.
[0243] The other portfolio had a return-to-risk ratio of 1.3, factor exposure of 8%, no penalty, and ultimately ranked higher.
[0244] S2053 solves the non-conflict optimization objective function by gradient projection, generates a Pareto optimal solution set by combining risk level constraints, removes redundant combinations by decision tree pruning algorithm, and outputs the final portfolio. This step uses gradient projection to quickly solve the optimization problem, and combines risk constraints to select the optimal solution in the Pareto Front. Then, redundant combinations are removed by pruning the decision tree.
[0245] Implementation using gradient projection method: Gradient calculation: Calculate gradients for the return-risk ratio and factor exposure targets separately. For example, increasing the weight of stock A will increase the return-risk ratio gradient by 0.2, but increase the momentum factor exposure gradient by 0.15.
[0246] Project onto feasible region: The Active Set Method is used to handle weight constraints (such as individual stock weights ≥ 0). For example, if the weight of a stock drops to 0, it is removed from the active set.
[0247] Iterative Updates: The step size parameter α = 0.01, the maximum number of iterations is 1000, and the convergence condition is that the rate of change of the objective function is < 1e-5.
[0248] Generation of Pareto optimal solution set: Non-dominated sorting: Divides the solution set into multiple front levels, with the first front being the optimal solution. For example, selecting 50 non-dominated solutions from 500 combinations.
[0249] Risk Level Constraint: Filter the solution set based on the current risk level. For example, at risk level 2, only retain portfolios with a maximum drawdown of ≤ 5%.
[0250] Decision tree pruning algorithm: Feature selection: A CART decision tree is constructed using the portfolio's return-risk ratio, factor exposure, and industry concentration as features.
[0251] Pruning rules: Minimum number of leaf samples: Each leaf node must contain at least 10 combinations.
[0252] Complexity parameter (CP): Set CP=0.01 to retain 100 combinations after pruning.
[0253] Final selection: Select the portfolio with the highest Sharpe ratio and compliant factor exposure from the pruned leaf nodes as the final portfolio.
[0254] Example scenario: In the Pareto frontier, a portfolio had a risk-reward ratio of 1.6 and a factor exposure of 9%, but its industry concentration (40% in semiconductors) was too high, so it was pruned and removed.
[0255] The other portfolio, with a return-risk ratio of 1.55, factor exposure of 8%, and industry concentration of 25%, met the requirements and became the final choice.
[0256] S2054 decomposes the final portfolio generation process into interpretable feature paths, maps the stock selection decision logic chain through a spatiotemporal causal graph, and dynamically displays the factor contribution and risk transmission path in a visualization interface.
[0257] This step uses visualization technology to transform the complex quantitative decision-making process into an understandable logical chain, helping users clearly see the factor contributions and risk sources behind each decision.
[0258] Interpretable feature path decomposition: Decision chain backtracking: The selection criteria were derived by working backward from the individual stock weights in the final portfolio. For example, stock A was selected because of its momentum factor contribution of 30%, capital flow impact of 20%, and sector popularity of 50%.
[0259] Factor contribution calculation: The Shapley Additive Explanations (SHAP) are used to quantify the impact of each factor on the buy decision. For example, the popularity of the semiconductor sector contributes 50% of the weight of stock A.
[0260] Construction of a spacetime causal graph: Node definition: Primary nodes: market risk level, sector popularity, and capital flow data.
[0261] Secondary nodes: individual stock signal strength, factor exposure, and weight allocation.
[0262] Edge weight calculation: The strength of influence between nodes is determined using the Granger causality test. For example, the causal strength of sector popularity on individual stock signal strength is 0.7 (range 0-1).
[0263] Dynamic visualization: Interactive cause-effect graphs can be created using the D3.js framework, allowing users to expand detailed data by clicking on nodes. For example, clicking the "Semiconductor Sector" node displays the 10 related stocks and their contributing factors.
[0264] Risk transmission path demonstration: Risk source tracing: Risk transmission paths are generated through Monte Carlo simulation. For example, if individual stocks in the lithium battery sector of the portfolio plummet, the risk will be transmitted to the new energy sector through supply chain connections (transmission probability 60%).
[0265] Path visualization: Use a Sankey diagram to illustrate the flow of risk from sector to individual stock. For example, the risk of the semiconductor sector (30%) flows to individual stock A (15%) and individual stock B (15%).
[0266] Example scenario: Users who viewed the decision path of stock C found that its selection mainly relied on the low valuation factor (PE contributed 40%), but the risk path showed that it was greatly affected by fluctuations in raw material prices (transmission probability 70%).
[0267] In the Sankey diagram, the risk (25%) of the new energy sector is mainly transmitted to individual stocks D (10%) and E (15%), helping users quickly locate the concentration of risk.
[0268] A candidate pool is constructed by filtering high-scoring stocks through dynamic threshold filtering. Multi-objective optimization algorithms (such as NSGA-II) are used to simultaneously optimize the return-risk ratio (Sharpe ratio) and factor exposure (such as industry and style factors). Combined with risk level constraints, a Pareto optimal solution set is generated. The stock selection logic chain is mapped using a spatiotemporal causal graph. Factor contribution, risk transmission path and portfolio weight allocation are displayed in a visual interface to achieve a balanced allocation of return, risk and factor exposure, avoiding over-reliance on a single factor or sector. At the same time, interpretable visualization enhances the transparency of the strategy and facilitates manual review and dynamic portfolio adjustment decisions.
[0269] As can be seen, the process involves acquiring heterogeneous data streams of individual stocks in the target market, normalizing and aligning these data streams to generate a standardized multi-factor feature matrix. Based on this standardized multi-factor feature matrix, dynamic position allocation ratios and market environment risk levels are output. According to the market environment risk level, a graph attention network is used to score sector direction, generating a sector popularity distribution map and a priority ranking list. Based on the sector priority ranking list, pattern scoring is performed on individual stocks within the target sector, outputting a pattern scoring matrix that includes buy signal strength. Finally, based on the dynamic position allocation ratios, the sector priority ranking list, and the pattern scoring matrix, a multi-objective optimization algorithm is used to generate the final investment portfolio. This improves the intelligence level of stock selection strategies and optimizes dynamic position allocation.
[0270] Another embodiment of the present invention provides a stock selection system based on multi-factor scoring and ranking of individual stocks, see [link to relevant documentation]. Figure 3 The system may include: The acquisition module 301 is used to acquire heterogeneous data streams of individual stocks in the target market, normalize and align the heterogeneous data streams to generate a standardized multi-factor feature matrix, wherein the heterogeneous data streams include auction volume and price data, intraday multi-factor time series data and industry sector correlation maps. Configuration module 302 is used to output dynamic position allocation ratio and market environment risk level based on the standardized multi-factor feature matrix and using a reinforcement learning model, through the mapping relationship between historical market state and position returns. The sorting module 303 is used to score the sector direction using a graph attention network based on the market environment risk level, and generate a sector heat distribution map and priority ranking list by aggregating the factor characteristics of individual stocks within the sector and the cross-sector correlation strength. The scoring module 304 is used to score the individual stocks in the target sector based on the sector priority ranking list, and to integrate the multi-factor pattern labels of individual stocks with intraday capital flow data through a spatiotemporal attention mechanism to output a pattern scoring matrix that includes the strength of buy signals. The generation module 305 is used to generate a final investment portfolio based on the dynamic position allocation ratio, the sector priority ranking list and the pattern scoring matrix using a multi-objective optimization algorithm. The multi-objective optimization algorithm simultaneously optimizes the return-risk ratio and factor exposure, and outputs an interpretable stock selection decision chain through a visual interface.
[0271] As can be seen, the process involves acquiring heterogeneous data streams of individual stocks in the target market, normalizing and aligning these data streams to generate a standardized multi-factor feature matrix. Based on this standardized multi-factor feature matrix, dynamic position allocation ratios and market environment risk levels are output. According to the market environment risk level, a graph attention network is used to score sector direction, generating a sector popularity distribution map and a priority ranking list. Based on the sector priority ranking list, pattern scoring is performed on individual stocks within the target sector, outputting a pattern scoring matrix that includes buy signal strength. Finally, based on the dynamic position allocation ratios, the sector priority ranking list, and the pattern scoring matrix, a multi-objective optimization algorithm is used to generate the final investment portfolio. This improves the intelligence level of stock selection strategies and optimizes dynamic position allocation.
[0272] This invention also provides a storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above method embodiments when running.
[0273] Specifically, in this embodiment, the storage medium can be configured to store a computer program for performing the following steps: S201, Obtain heterogeneous data streams of individual stocks in the target market, normalize and align the heterogeneous data streams to generate a standardized multi-factor feature matrix, wherein the heterogeneous data streams include auction volume and price data, intraday multi-factor time series data and industry sector correlation maps; S202, Based on the standardized multi-factor feature matrix, using a reinforcement learning model, the dynamic position allocation ratio and market environment risk level are output through the mapping relationship between historical market conditions and position returns. S203. Based on the market environment risk level, a graph attention network is used to score the sector direction. By aggregating the factor characteristics of individual stocks within a sector and the cross-sector correlation strength, a sector heat distribution map and a priority ranking list are generated. S204. Based on the priority ranking list of the sectors, perform pattern scoring on individual stocks within the target sector, and integrate multi-factor pattern labels of individual stocks with intraday capital flow data through a spatiotemporal attention mechanism to output a pattern scoring matrix that includes the strength of buy signals. S205. Based on the dynamic position allocation ratio, the sector priority ranking list, and the pattern scoring matrix, a multi-objective optimization algorithm is used to generate the final investment portfolio. The multi-objective optimization algorithm simultaneously optimizes the return-risk ratio and factor exposure, and outputs an interpretable stock selection decision chain through a visual interface.
[0274] As can be seen, the process involves acquiring heterogeneous data streams of individual stocks in the target market, normalizing and aligning these data streams to generate a standardized multi-factor feature matrix. Based on this standardized multi-factor feature matrix, dynamic position allocation ratios and market environment risk levels are output. According to the market environment risk level, a graph attention network is used to score sector direction, generating a sector popularity distribution map and a priority ranking list. Based on the sector priority ranking list, pattern scoring is performed on individual stocks within the target sector, outputting a pattern scoring matrix that includes buy signal strength. Finally, based on the dynamic position allocation ratios, the sector priority ranking list, and the pattern scoring matrix, a multi-objective optimization algorithm is used to generate the final investment portfolio. This improves the intelligence level of stock selection strategies and optimizes dynamic position allocation.
[0275] This invention also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0276] Specifically, the aforementioned electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the aforementioned processor, and the input / output device is connected to the aforementioned processor.
[0277] Specifically, in this embodiment, the processor can be configured to perform the following steps via a computer program: S201, Obtain heterogeneous data streams of individual stocks in the target market, normalize and align the heterogeneous data streams to generate a standardized multi-factor feature matrix, wherein the heterogeneous data streams include auction volume and price data, intraday multi-factor time series data and industry sector correlation maps; S202, Based on the standardized multi-factor feature matrix, using a reinforcement learning model, the dynamic position allocation ratio and market environment risk level are output through the mapping relationship between historical market conditions and position returns. S203. Based on the market environment risk level, a graph attention network is used to score the sector direction. By aggregating the factor characteristics of individual stocks within a sector and the cross-sector correlation strength, a sector heat distribution map and a priority ranking list are generated. S204. Based on the priority ranking list of the sectors, perform pattern scoring on individual stocks within the target sector, and integrate multi-factor pattern labels of individual stocks with intraday capital flow data through a spatiotemporal attention mechanism to output a pattern scoring matrix that includes the strength of buy signals. S205. Based on the dynamic position allocation ratio, the sector priority ranking list, and the pattern scoring matrix, a multi-objective optimization algorithm is used to generate the final investment portfolio. The multi-objective optimization algorithm simultaneously optimizes the return-risk ratio and factor exposure, and outputs an interpretable stock selection decision chain through a visual interface.
[0278] As can be seen, the process involves acquiring heterogeneous data streams of individual stocks in the target market, normalizing and aligning these data streams to generate a standardized multi-factor feature matrix. Based on this standardized multi-factor feature matrix, dynamic position allocation ratios and market environment risk levels are output. According to the market environment risk level, a graph attention network is used to score sector direction, generating a sector popularity distribution map and a priority ranking list. Based on the sector priority ranking list, pattern scoring is performed on individual stocks within the target sector, outputting a pattern scoring matrix that includes buy signal strength. Finally, based on the dynamic position allocation ratios, the sector priority ranking list, and the pattern scoring matrix, a multi-objective optimization algorithm is used to generate the final investment portfolio. This improves the intelligence level of stock selection strategies and optimizes dynamic position allocation.
[0279] The above description, based on the embodiments shown in the figures, details the structure, features, and effects of the present invention. The above description is only a preferred embodiment of the present invention, but the present invention is not limited to the scope of implementation shown in the figures. Any changes made in accordance with the concept of the present invention, or equivalent embodiments modified to have equivalent changes, that do not exceed the spirit covered by the specification and figures, should be within the protection scope of the present invention.
Claims
1. A stock selection method based on multi-factor scoring and ranking of individual stocks, characterized in that, The method includes: Obtain heterogeneous data streams of individual stocks in the target market, normalize and align the heterogeneous data streams to generate a standardized multi-factor feature matrix, wherein the heterogeneous data streams include auction volume and price data, intraday multi-factor time series data and industry sector correlation maps; Based on the standardized multi-factor feature matrix, a reinforcement learning model is used to output the dynamic position allocation ratio and market environment risk level through the mapping relationship between historical market conditions and position returns. Based on the aforementioned market environment risk level, a graph attention network is used to score the sector direction. By aggregating the factor characteristics of individual stocks within a sector and the cross-sector correlation strength, a sector popularity distribution map and a priority ranking list are generated. Based on the aforementioned sector priority ranking list, pattern scores are performed on individual stocks within the target sector. By integrating multi-factor pattern labels of individual stocks with intraday capital flow data through a spatiotemporal attention mechanism, a pattern score matrix containing the strength of buy signals is output. Based on the dynamic position allocation ratio, the sector priority ranking list, and the pattern scoring matrix, a multi-objective optimization algorithm is used to generate the final investment portfolio. The multi-objective optimization algorithm simultaneously optimizes the risk-reward ratio and factor exposure, and outputs an interpretable stock selection decision chain through a visual interface.
2. The method according to claim 1, characterized in that, The process involves acquiring heterogeneous data streams of individual stocks in the target market, normalizing and aligning these data streams to generate a standardized multi-factor feature matrix. The heterogeneous data streams include pre-market auction volume and price data, intraday multi-factor time-series data, and industry sector correlation maps, including: The system acquires heterogeneous data streams of individual stocks in the target market. Based on the tick-by-tick transaction pulse signals of the pre-market auction volume and price data, it uses an event-triggered pulse encoder to convert volume and price fluctuations into a spatiotemporally marked pulse sequence, generating a volume and price feature pulse matrix. The encoder uses dynamic threshold filtering technology to suppress high-frequency noise and retain effective price breakout signals. The phase difference between the volume and price characteristic pulse matrix and the multi-factor time series data in the market is measured. A time-varying convolution kernel is constructed through an adaptive time series alignment algorithm to dynamically compensate for the sampling frequency differences of different factors and output a time-axis aligned multi-factor tensor. The industry sector association graph is input into a dynamic graph neural network, and the node feature space is reconstructed through an edge weight adaptive allocation algorithm to generate a standardized multi-factor feature matrix that matches the dimensions of the multi-factor tensor.
3. The method according to claim 2, characterized in that, Based on the standardized multi-factor feature matrix, and utilizing a reinforcement learning model, the dynamic position allocation ratio and market environment risk level are output through the mapping relationship between historical market conditions and position returns, including: The standardized multi-factor feature matrix is input into the time-series pulse encoder, and historical market state segments are extracted through a sliding window to generate a spatiotemporal encoding vector containing volume, price, volatility, and turnover rate. Adversarial risk distillation is performed on the spatiotemporal encoded vector. Market environment noise and core risk features are separated through game training between the generator and the discriminator, and a purified risk feature vector is output. Based on the risk feature purification vector, a drift plus penalty reinforcement learning algorithm is adopted. By mapping the historical market state with the position return, and combining dynamic programming to solve the position allocation ratio, the optimized position allocation is obtained. The drift plus penalty reinforcement learning algorithm balances the return and drawdown through Lyapunov stability constraints. The optimized position allocation is subjected to risk level cluster analysis. The multidimensional risk characteristics are projected onto the discrete risk level space through a self-organizing mapping network, and the final dynamic position allocation ratio and market environment risk level are output.
4. The method according to claim 3, characterized in that, Based on the market environment risk level, a graph attention network is used to score sector direction. By aggregating individual stock factor characteristics within a sector and cross-sector correlation strength, a sector popularity distribution map and priority ranking list are generated, including: Based on the risk level of the market environment, a heterogeneous graph convolutional network is used to reconstruct the industry sector correlation map. By using node feature enhancement technology to integrate the factor features of individual stocks within the sector, an enhanced sector relationship map is generated. The enhanced plate relationship graph is processed by a multi-head graph attention mechanism to calculate the attention weight of the plate nodes and output the plate importance score vector. The cross-sector correlation strength algorithm quantifies the capital flow and industrial chain linkage effect between sectors, generating a sector correlation strength matrix; Input the sector importance score vector and correlation strength matrix into the heat diffusion model, simulate the flow of funds based on the heat conduction equation, and output a sector heat distribution map; Perform topological sorting on the heat distribution map of sectors, determine the sector rotation priority through critical path extraction algorithm, and generate a priority ranking list of sectors.
5. The method according to claim 4, characterized in that, Based on the priority ranking list of sectors, pattern scoring is performed on individual stocks within the target sector. A spatiotemporal attention mechanism is used to fuse multi-factor pattern labels of individual stocks with intraday capital flow data, outputting a pattern scoring matrix that includes the strength of buy signals, including: Based on the priority ranking list of sectors, a spatiotemporal convolutional network is used to extract multi-factor morphological features of individual stocks within the target sector, generating pattern feature vectors that include valuation, momentum, and volatility. The pattern feature vector is spatiotemporally attention aligned with the intraday capital flow data, and the capital flow impact signal is fused through a dynamic weight allocation mechanism to output a spatiotemporally fused feature tensor. The spatiotemporal fusion feature tensor is input into the pulse-triggered scoring model, and the buy signal strength is calculated based on the historical similar pattern return distribution to generate an initial signal strength matrix; Virtual extreme samples are generated from the initial signal intensity matrix. The robustness of the model is enhanced through adversarial training. The residual compensation algorithm is used to correct overfitting bias and output a signal intensity matrix with enhanced stability. The signal strength matrix and the sector heat distribution map are jointly calibrated, and the scoring deviation between sectors is eliminated by nonlinear interpolation technology. Finally, the pattern scoring matrix containing the buy signal strength is output.
6. The method according to claim 5, characterized in that, The final investment portfolio is generated using a multi-objective optimization algorithm based on the dynamic position allocation ratio, the sector priority ranking list, and the pattern scoring matrix. This multi-objective optimization algorithm simultaneously optimizes the risk-reward ratio and factor exposure, and outputs an interpretable stock selection decision chain through a visual interface, including: Based on the dynamic position allocation ratio and the sector priority ranking list, a dynamic threshold filtering algorithm is used to screen high-scoring stocks in the target sector to generate an initial investment candidate pool. The pattern score matrix of individual stocks in the initial investment candidate pool is input into the multi-objective optimizer, and the return-risk ratio and factor exposure are optimized simultaneously through dynamic weight allocation technology to construct a non-conflict optimization objective function; Gradient projection is used to solve the non-conflict optimization objective function. Pareto optimal solution set is generated by combining risk level constraints. Redundant combinations are removed by decision tree pruning algorithm, and the final portfolio is output. The process of generating the final portfolio is decomposed into interpretable feature paths. The stock selection decision logic chain is mapped through a spatiotemporal causal graph, and the factor contribution and risk transmission path are dynamically displayed in the visualization interface.
7. A stock selection system based on multi-factor scoring and ranking of individual stocks, characterized in that, The system includes: The acquisition module is used to acquire heterogeneous data streams of individual stocks in the target market, normalize and align the heterogeneous data streams to generate a standardized multi-factor feature matrix, wherein the heterogeneous data streams include auction volume and price data, intraday multi-factor time series data and industry sector correlation maps. The configuration module is used to output dynamic position allocation ratio and market environment risk level based on the standardized multi-factor feature matrix and using a reinforcement learning model, through the mapping relationship between historical market state and position returns. The sorting module is used to score the sector direction based on the risk level of the market environment using a graph attention network, and generate a sector heat distribution map and priority ranking list by aggregating the factor characteristics of individual stocks within the sector and the cross-sector correlation strength. The scoring module is used to score individual stocks within the target sector based on the sector priority ranking list. It integrates multi-factor pattern labels of individual stocks with intraday capital flow data through a spatiotemporal attention mechanism and outputs a pattern scoring matrix that includes the strength of buy signals. The generation module is used to generate a final investment portfolio based on the dynamic position allocation ratio, the sector priority ranking list, and the pattern scoring matrix using a multi-objective optimization algorithm. The multi-objective optimization algorithm simultaneously optimizes the return-risk ratio and factor exposure, and outputs an interpretable stock selection decision chain through a visual interface.
8. The system according to claim 7, characterized in that, The acquisition module is specifically used for: The system acquires heterogeneous data streams of individual stocks in the target market. Based on the tick-by-tick transaction pulse signals of the pre-market auction volume and price data, it uses an event-triggered pulse encoder to convert volume and price fluctuations into a spatiotemporally marked pulse sequence, generating a volume and price feature pulse matrix. The encoder uses dynamic threshold filtering technology to suppress high-frequency noise and retain effective price breakout signals. The phase difference between the volume and price characteristic pulse matrix and the multi-factor time series data in the market is measured. A time-varying convolution kernel is constructed through an adaptive time series alignment algorithm to dynamically compensate for the sampling frequency differences of different factors and output a time-axis aligned multi-factor tensor. The industry sector association graph is input into a dynamic graph neural network, and the node feature space is reconstructed through an edge weight adaptive allocation algorithm to generate a standardized multi-factor feature matrix that matches the dimensions of the multi-factor tensor.
9. A storage medium, characterized in that, The storage medium stores a computer program, wherein the computer program is configured to execute the method of any one of claims 1-6 when it is run.
10. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the method of any one of claims 1-6.