Quantification strategy generation method and system based on hybrid development architecture
By using a quantitative strategy generation method based on a hybrid development architecture, the performance value of each strategy type is calculated by utilizing the attribute information and state label sequence of historical stock markets, and quantitative strategies for the current market are generated. This solves the accuracy problem caused by training data bias and improves the accuracy of the strategies.
Patent Information
- Application Number
- CN202610063773.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-19
- Publication Date
- 2026-02-17
AI Technical Summary
In existing quantitative strategy generation methods, training data may contain future information or survivor bias, leading to reduced prediction accuracy of the prediction model and distorted backtesting results.
Based on a hybrid development architecture, the system obtains historical stock market attribute information, determines market state label sequences, groups them according to the daily return sequences of quantitative strategy types, calculates the average performance value of each strategy type under different market conditions, and generates quantitative strategies for the current stock market.
It improves the accuracy of generating quantization strategies, reduces bias in training data through analysis of historical data, and enhances the reliability and effectiveness of the strategies.
Smart Images

Figure CN121544387A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of financial data processing technology, and in particular to a quantitative strategy generation method and system based on a hybrid development architecture. Background Technology
[0002] Quantitative strategies are a systematic approach that transforms investment logic into mathematical models, using historical data and algorithms to automatically generate trading signals and execute decisions. Quantitative strategies rely on statistical analysis, computer programs, and rigorous backtesting to eliminate the interference of human emotions and achieve disciplined investing.
[0003] Currently, predictive models trained on historical data learn the mapping relationship between features and labels. These models are then used to generate quantitative strategies, transforming the model's output prediction signals into trading rules. However, if the model's training data contains future information or survivorship bias, the prediction accuracy of the trained model will decrease, leading to severely distorted backtesting results. Summary of the Invention
[0004] The present invention aims to provide a quantitative strategy generation method and system based on a hybrid development architecture to address the shortcomings of existing technologies. The technical problem to be solved by the present invention is achieved through the following technical solutions.
[0005] This invention provides a method for generating quantitative strategies based on a hybrid development architecture, the method comprising: Obtain historical stock market attribute information, including price data, volatility data, trading volume data, fundamental data, and sentiment data. A market status label sequence is determined based on the attribute information of the historical stock market. The market status label sequence includes the market status label for each trading day. The market status label is a high volatility downward label, a low volatility oscillation label, an upward trend label, or a high volatility disorder label. The market state label sequence is grouped according to the daily return sequence of each quantitative strategy type to obtain the return subsequence corresponding to each quantitative strategy type under all market state labels; Calculate the average performance value for each type of quantitative strategy under the same market state label based on the aforementioned return subsequence; In response to the quantitative strategy generation instruction, the quantitative strategy type for the current stock market is generated based on the average performance value corresponding to each quantitative strategy type under the same market state label and the attribute information of the current stock market.
[0006] In an optional embodiment, determining the market state label sequence based on the historical stock market attribute information includes: Clustering calculations are performed based on the attribute information of each trading day in the historical stock market to obtain the market status label for each trading day; The market status labels of all trading days are combined in chronological order to obtain a market status label sequence.
[0007] In an optional embodiment, grouping the market state label sequence according to the daily return sequences of each quantitative strategy type to obtain the return sub-sequences corresponding to each quantitative strategy type under all market state labels includes: Based on the historical stock market, calculate the daily return series corresponding to N quantitative strategy types, wherein the daily return series includes the daily return for each trading day calculated according to the corresponding quantitative strategy type; Extract the daily returns of the same market state label from the N daily return sequences as the return subsequences of the corresponding quantitative strategy type under the corresponding market state label.
[0008] In an optional embodiment, calculating the average performance value for each quantitative strategy type under the same market state label based on the return subsequence includes: Based on the aforementioned return subsequence, the performance data corresponding to each type of quantitative strategy under the same type of market state label is calculated. The performance data includes at least: annualized return, annualized volatility, Sharpe ratio, and maximum drawdown. The average performance value for each market status label is calculated by averaging the performance data for the same type of market status label and then weighting all the averages for the same type of market status label.
[0009] In an optional embodiment, generating the quantitative strategy type for the current stock market based on the average performance value corresponding to each quantitative strategy type under the same market state label and the attribute information of the current stock market includes: Obtain the current market status label corresponding to the attribute information of the current stock market; Based on the average performance value corresponding to each type of quantitative strategy under the same type of market state label, the quantitative strategy type with the highest average performance value corresponding to the current market state label is determined as the quantitative strategy type of the current stock market.
[0010] In an optional embodiment, generating the quantitative strategy type for the current stock market based on the average performance value corresponding to each quantitative strategy type under the same market state label and the attribute information of the current stock market includes: Obtain the current market status label corresponding to the attribute information of the current stock market; Based on the current market status label and the market status labels of the previous M trading days, predict the predicted market status label for the next trading day; The current stock market quantitative strategy type is generated based on the current market state label, the predicted market state label, and the average performance value corresponding to each quantitative strategy type under the same market state label.
[0011] In an optional embodiment, the step of predicting the predicted market state label for the next trading day based on the current market state label and the market state labels of the previous M trading days includes: The current market state label and the market state labels of the previous M trading days are used to predict the market state label for the next trading day, which is then converted into a market state label feature sequence. The current stock market attribute information and the market state label feature sequence are input into the market state prediction model to predict the market state label for the next trading day.
[0012] In an optional embodiment, generating the current stock market quantitative strategy type based on the current market state label, the predicted market state label, and the average performance value corresponding to each quantitative strategy type under the same type of market state label includes: Based on the average performance value corresponding to each quantitative strategy type under the same type of market state label, obtain the average performance value corresponding to the current market state label and the predicted market state label for each quantitative strategy type. The average performance values of the current market state label and the predicted market state label of the same quantitative strategy type are weighted and calculated to obtain the comprehensive performance value corresponding to each quantitative strategy type. The current stock market quantitative strategy type is generated based on the comprehensive performance value corresponding to each quantitative strategy type.
[0013] In an optional embodiment, generating the current stock market quantitative strategy type based on the composite performance value corresponding to each quantitative strategy type includes: The weight value of each quantitative strategy type is calculated based on the comprehensive performance value corresponding to each quantitative strategy type. The quantitative strategy type for the current stock market is selected based on the weight value of the quantitative strategy type.
[0014] This invention provides a quantitative strategy generation system based on a hybrid development architecture, the system comprising: The acquisition module is used to acquire historical stock market attribute information, including price data, volatility data, trading volume data, fundamental data, and sentiment data. The determination module is used to determine a market status label sequence based on the attribute information of the historical stock market. The market status label sequence includes the market status label for each trading day. The market status label is a high volatility downward label, a low volatility oscillation label, an upward trend label, or a high volatility disorder label. The grouping module is used to group the market state label sequence according to the daily return sequence of each quantitative strategy type, so as to obtain the return subsequence corresponding to each quantitative strategy type under all market state labels. The calculation module is used to calculate the average performance value of each quantitative strategy type under the same type of market state label based on the yield subsequence; The generation module is used to respond to quantitative strategy generation instructions and generate the current stock market's quantitative strategy type based on the average performance value corresponding to each quantitative strategy type under the same type of market state label and the current stock market's attribute information.
[0015] The embodiments of the present invention have the following advantages: This invention provides a method and system for generating quantitative strategies based on a hybrid development architecture. First, it acquires historical stock market attribute information and determines a market state label sequence based on this information, including the market state label for each trading day. Then, it groups the market state label sequence according to the daily return sequences of each quantitative strategy type, obtaining a return subsequence for each quantitative strategy type under all market state labels. Next, it calculates the average performance value for each quantitative strategy type under the same type of market state label based on the return subsequences. In response to a quantitative strategy generation command, it generates the current stock market's quantitative strategy type based on the average performance value for each quantitative strategy type under the same type of market state label and the current stock market's attribute information. Compared to generating quantitative strategies using a trained prediction model, this application determines the return subsequences for each quantitative strategy type under all market state labels based on historical stock market attribute information, and then calculates the average performance value for each quantitative strategy type under the same type of market state label based on the return subsequences. This allows for the generation of the current stock market's quantitative strategy type based on the average performance value for each quantitative strategy type under the same type of market state label and the current stock market's attribute information, thereby improving the accuracy of the generated quantitative strategy. Attached Figure Description
[0016] Figure 1 This is a flowchart of a quantitative strategy generation method based on a hybrid development architecture provided in an embodiment of the present invention; Figure 2This is a schematic diagram of the structure of a quantitative strategy generation system based on a hybrid development architecture provided in an embodiment of the present invention. Detailed Implementation
[0017] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0018] Please see Figure 1 This invention provides a method for generating a quantitative strategy based on a hybrid development architecture, specifically comprising steps S101-S105: S101, Obtain historical stock market attribute information, including price data, volatility data, trading volume data, fundamental data, and sentiment data.
[0019] The historical stock market attribute information can be attribute data from the past three years. Price data can include the opening, high, low, and closing prices of assets such as stocks, futures, and options; volatility data can include price volatility; trading volume data can include the trading volume of various assets; fundamental data can include price-to-book ratio, price-to-earnings ratio, dividend yield, financial statements, and macroeconomic indicators; and sentiment data can include news sentiment, social media popularity, search index, and investor comments. This embodiment does not limit the specific form of the attribute information.
[0020] S102, determine the market status label sequence based on the historical stock market attribute information, the market status label sequence includes the market status label for each trading day.
[0021] The market status labels are categorized as high volatility downtrend, low volatility oscillation, upward trend, or high volatility disorder. Specifically, the high volatility downtrend label has a volatility characteristic value greater than 1.0 (above average), a return characteristic value less than -0.5 (significantly negative returns), and potentially high trading volume; the low volatility oscillation label has a volatility characteristic value less than 0.5 (below average), a return characteristic value between [-0.2, 0.2] (close to zero), and potentially low trading volume; the upward trend label has a volatility characteristic value between [0.5, 1.0] (medium level), a return characteristic value greater than 0.5 (significantly positive returns), and relatively high market breadth; the high volatility disorder label has a volatility characteristic value greater than 1.0, a return characteristic value close to zero, and potentially negative market sentiment.
[0022] In this embodiment, determining the market status label sequence based on the attribute information of the historical stock market includes: performing clustering calculations according to the attribute information of each trading day in the historical stock market to obtain the market status label for each trading day; and combining the market status labels of all trading days in chronological order to obtain the market status label sequence.
[0023] Furthermore, before performing clustering calculations to obtain the market status label for each trading day, this embodiment can preprocess the attribute information of the historical stock market. This preprocessing can include outlier detection, handling missing values, data alignment, data standardization, etc., and then obtain a multi-dimensional feature matrix (time × feature). Then, core features (such as volatility, return, volume change rate, market width, sentiment index, liquidity, trend strength, etc.) are extracted from the multi-dimensional feature matrix and clustered to obtain the market status label for each trading day.
[0024] Specifically, this embodiment uses a Gaussian mixture model for clustering. First, it tests the number of classes to 3-6. For each class, it calculates the Bayesian information criterion: BIC = -2 × log-likelihood + ln(number of samples) × number of model parameters. It selects the class with the smallest BIC, typically 3 or 4. Then, iteratively optimizes using the expectation-maximization algorithm until the log-likelihood change is less than 0.001. For each trading day, it calculates the posterior probability of each state and uses the state with the highest posterior probability as the market state label for that day.
[0025] S103, group the market state label sequence according to the daily return sequence of each quantitative strategy type, and obtain the return subsequence corresponding to each quantitative strategy type under all market state labels.
[0026] Quantitative strategies can include dual moving average strategies, RSI strategies, Bollinger Band strategies, momentum strategies, and volatility strategies. Specifically, a dual moving average strategy involves buying when the short-term moving average (5-15 days) crosses above the long-term moving average (20-50 days) and selling when it crosses below; an RSI strategy involves buying when the 14-day RSI is below 30 and selling when it is above 70; a Bollinger Band strategy involves buying when the price falls below the lower band (mean - 2 standard deviations) and selling when it breaks above the upper band (mean + 2 standard deviations); a momentum strategy involves buying when the price ranks in the top 10% of returns over the past 20 days and selling when it ranks in the bottom 10%; and a volatility strategy involves buying when market volatility is below the 25th percentile and selling when it is above the 75th percentile.
[0027] In one optional embodiment provided in this application, the step of grouping the market state label sequence according to the daily return sequence of each quantitative strategy type to obtain the return subsequence corresponding to each quantitative strategy type under all market state labels includes: calculating the daily return sequence corresponding to N quantitative strategy types based on the historical stock market, wherein the daily return sequence includes the daily return of each trading day calculated according to the corresponding quantitative strategy type; and extracting the daily return of the same market state label from the N daily return sequences as the return subsequence of the corresponding quantitative strategy type under the corresponding market state label.
[0028] In this embodiment, if there are N quantitative strategy types, K market status labels, and T trading days, with one market status label for each trading day and one return rate for each quantitative strategy type on each trading day, this embodiment needs to calculate the daily return rate for each quantitative strategy type under each market status label. This daily return rate can be calculated using annualized return rate, annualized volatility, Sharpe ratio, maximum drawdown, win rate, etc.
[0029] Specifically, the market status label sequence is as follows: each belong , representing the market state label for trading day t. The daily return sequence for quantitative strategy type i is: , This represents the return rate of quantitative strategy type i on the t-th trading day. This embodiment requires... Grouping according to S, we obtain the return subsequence for each market state label k (k=1,2,...,K). For each market state label k, we collect all subsequences that satisfy... On trading day t, then calculate the returns of quantitative strategy type i corresponding to these trading days. Extract it to form the yield subsequence under state k.
[0030] For example, suppose there are 3 market state labels (K=3), and the market state label sequence is [1,2,2,1,3], and the return sequence of quantitative strategy type i is [0.01, 0.02, -0.01, 0.03, 0.005]. Then the return subsequence under market state label 1 is the return on day 1 and day 4: [0.01, 0.03]; the return subsequence under market state label 2 is the return on day 2 and day 3: [0.02, -0.01]; and the return subsequence under market state label 3 is the return on day 5: [0.005].
[0031] S104, calculate the average performance value corresponding to each type of quantitative strategy under the same type of market state label based on the yield subsequence.
[0032] In this embodiment, the step of calculating the average performance value of each quantitative strategy type under the same type of market state label based on the return subsequence includes: calculating the performance data corresponding to each quantitative strategy type under the same type of market state label based on the return subsequence, wherein the performance data includes at least: annualized return, annualized volatility, Sharpe ratio, and maximum drawdown; averaging the performance data corresponding to the same type of market state label, and weighting all the averages of the same type of market state label to obtain the average performance value corresponding to the same type of market state label.
[0033] For example, this embodiment uses the Sharpe ratio as the primary indicator, while also considering maximum drawdown and win rate to calculate the average performance value. Average Performance Value = Sharpe Ratio 0.5 + (1 - normalized maximum drawdown) 0.3+ win rate 0.2. Wherein, normalized maximum drawdown = maximum drawdown / the maximum maximum drawdown of all strategy types in this state, and then 1 is subtracted from this ratio, so that the smaller the maximum drawdown, the higher the score.
[0034] Let the performance data of strategy type A in state s be: Sharpe ratio (SR), maximum drawdown (MD), and win rate (WR). Normalized maximum drawdown: Assuming the maximum drawdown for all strategy types in state s is MaxMD, then the normalized maximum drawdown is 1 - MD / MaxMD. Average performance score = SR 0.5 + (1 - MD / MaxMD) 0.3+WR 0.2.
[0035] S105, in response to the quantitative strategy generation instruction, generates the quantitative strategy type for the current stock market based on the average performance value corresponding to each quantitative strategy type under the same type of market state label and the attribute information of the current stock market.
[0036] In one optional embodiment provided in this application, the step of generating the quantitative strategy type of the current stock market based on the average performance value corresponding to each quantitative strategy type under the same type of market state label and the attribute information of the current stock market includes: obtaining the current market state label corresponding to the attribute information of the current stock market; and determining the quantitative strategy type with the highest average performance value corresponding to the current market state label as the quantitative strategy type of the current stock market based on the average performance value corresponding to each quantitative strategy type under the same type of market state label.
[0037] For example, a dual moving average strategy: Sharpe ratio 0.85, maximum drawdown 15%, win rate 55%, stability 0.259; RSI strategy: Sharpe ratio 1.45, maximum drawdown 12%, win rate 65%, stability 0.6; Bollinger Bands Strategy: Sharp 1.25, maximum drawdown 14%, win rate 60%, stability 0.5; Momentum strategy: Sharpe ratio 0.45, maximum drawdown 20%, win rate 48%, stability 0.3; Volatility strategy: Sharpe ratio 0.75, maximum drawdown 18%, win rate 55%, stability 0.4; After standardizing the above data (assuming min-max standardization to 0-1), the average performance values of each strategy are calculated as follows: The double moving average = 0.4 × 0.4 + 0.3 × 0.5 + 0.2 × 0.35 + 0.1 × 0.259 = 0.4159; RSI=0.4×1.0+0.3×0.8+0.2×0.85+0.1×0.6=0.87; Bollinger Bands = 0.4 × 0.8 + 0.3 × 0.6 + 0.2 × 0.6 + 0.1 × 0.5 = 0.67; Momentum = 0.4 × 0.0 + 0.3 × 0.2 + 0.2 × 0.0 + 0.1 × 0.3 = 0.09; Volatility = 0.4 × 0.3 + 0.3 × 0.3 + 0.2 × 0.35 + 0.1 × 0.4 = 0.32; The quantitative strategy type with the highest average performance value corresponding to the current market status label is the RSI strategy, which has the highest overall score (0.87). Therefore, the RSI strategy should be selected as the quantitative strategy type for the current stock market.
[0038] In another optional embodiment provided in this application, the step of generating the quantitative strategy type for the current stock market based on the average performance value corresponding to each quantitative strategy type under the same type of market state label and the attribute information of the current stock market includes: S1051, Obtain the current market status label corresponding to the attribute information of the current stock market.
[0039] S1052, predict the predicted market state label for the next trading day based on the current market state label and the market state labels of the previous M trading days.
[0040] Specifically, the step of predicting the predicted market state label for the next trading day based on the current market state label and the market state labels of the previous M trading days includes: converting the current market state label and the market state labels of the previous M trading days into a market state label feature sequence; and inputting the attribute information of the current stock market and the market state label feature sequence into the market state prediction model to predict the predicted market state label for the next trading day.
[0041] The market state prediction model is a pre-trained neural network model that combines a time prediction model and a classification model to predict the market state label for the next trading day. Specifically, the market state label feature sequence is a time-series feature, and the current stock market attribute information is the current stock market characteristic. By combining the market state label feature sequence and the current stock market attribute information, the predicted market state label for the next trading day can be predicted.
[0042] S1053, Generate the current stock market quantitative strategy type based on the current market state label, the predicted market state label, and the average performance value corresponding to each quantitative strategy type under the same type of market state label.
[0043] In this embodiment, generating the current stock market quantitative strategy type based on the current market state label, the predicted market state label, and the average performance value corresponding to each quantitative strategy type under the same market state label includes: S10531, based on the average performance value corresponding to each quantitative strategy type under the same type of market state label, obtain the average performance value corresponding to the current market state label and the predicted market state label for each quantitative strategy type.
[0044] S10532, the average performance values of the current market state label and the predicted market state label of the same quantitative strategy type are weighted and calculated to obtain the comprehensive performance value corresponding to each quantitative strategy type.
[0045] S10533, Generate the current stock market quantitative strategy type based on the comprehensive performance value corresponding to each quantitative strategy type.
[0046] Specifically, generating the current stock market quantitative strategy type based on the comprehensive performance value corresponding to each quantitative strategy type includes: calculating the weight value of the quantitative strategy type using the comprehensive performance value corresponding to each quantitative strategy type; and selecting the current stock market quantitative strategy type based on the weight value of the quantitative strategy type, i.e., selecting the quantitative strategy type with the largest weight value as the current stock market quantitative strategy type.
[0047] In this embodiment, the composite performance value can be converted into weighted values using the softmax function and normalization, ensuring that the sum of the weighted values is 1, and that quantitative strategy types with higher weighted values receive higher weights. For example, the composite performance values of five quantitative strategy types are: Double Moving Average: 0.42, RSI: 0.87, Bollinger Bands: 0.65, Momentum: 0.15, Volatility: 0.38. These values are calculated using the softmax function, where the weight γ = 2.0. exp(2×0.42)=exp(0.84)=2.316; exp(2×0.87)=exp(1.74)=5.698; exp(2×0.65)=exp(1.30)=3.669; exp(2×0.15)=exp(0.30)=1.350; exp(2×0.38)=exp(0.76)=2.138; The total is 2.316 + 5.698 + 3.669 + 1.350 + 2.138 = 15.171. The weight values for each quantitative strategy type are: w_Double moving average = 2.316 / 15.171 = 0.153; w_RSI=5.698 / 15.171=0.376; w_Bollinger Bands = 3.669 / 15.171 = 0.242; w_momentum = 1.350 / 15.171 = 0.089; w_volatility = 2.138 / 15.171 = 0.141.
[0048] Determine the market state at each point in time and calculate the state transition probability matrix (i.e., the probability of transitioning from one state to another).
[0049] In another embodiment provided in this application, a Hidden Markov Model (HMM) can be used to model the market state label sequence to obtain predicted market state labels (including predicted market state labels for multiple days), or the predicted market state labels for the next 1-5 days can be obtained from the state transition probability matrix P. Then, for each quantitative strategy type, an expected comprehensive score is calculated, and the quantitative strategy type with the highest expected score is selected as the quantitative strategy type for the current stock market.
[0050] Where, the expected score = Σ{τ=1 to 5}P(state S_τ) × the comprehensive score of type T under state S_τ. For example, if the previous market state label is S2, the probability of the state in the next 5 days is: Day 1: S2 (60%), S3 (30%), S1 (10%) Day 2: S2 (50%), S3 (40%), S1 (10%) Day 3: S3 (50%), S2 (40%), S1 (10%) Day 4: S3 (60%), S2 (30%), S1 (10%) Day 5: S3 (70%), S2 (20%), S1 (10%) The overall scores of the RSI strategy under each state are: S1=0.6, S2=0.87, S3=0.5; the overall scores of the momentum strategy under each state are: S1=0.1, S2=0.09, S3=0.8.
[0051] Calculate the expected scores: RSI strategy: 0.6×0.1+0.87×0.2+0.5×0.7=0.527; Momentum strategy: 0.1×0.1+0.09×0.2+0.8×0.7=0.588. Since the momentum strategy has a higher expected score, although the current situation is not suitable, a bull market is expected soon, so the momentum strategy is chosen.
[0052] In this embodiment, the state transition probability matrix can be obtained by traversing the market state label sequence and recording the transition from the current state to the state of the next day for each day. For example, if the state on day t is i and the state on day t+1 is j, then add 1 to the (i, j) position of the transition counting matrix. For each state i, divide the i-th row of the transition counting matrix by the sum of that row to obtain the probability of transitioning from state i to other states, thus obtaining the state transition probability matrix.
[0053] For example, consider a 10-day market state label sequence: 1,2,2,3,1,2,2,1,3,2. Here, market state labels 1, 2, and 3 represent a decline, consolidation, and an increase, respectively. Traversing the market state label sequence (from day 1 to day 9, since day 10 has no subsequent state) yields: Day 1: State 1 -> Day 2: State 2: Increment the counting matrix [1,2] by 1; Day 2: State 2 -> Day 3 State 2: Increment the counting matrix [2,2] by 1; Day 3: State 2 -> Day 4, State 3: Increment the counting matrix [2,3] by 1; Day 4: State 3 -> Day 5, State 1: Increment the counting matrix [3,1] by 1; Day 5: State 1 -> Day 6, State 2: Increment the counting matrix [1,2] by 1; Day 6: State 2 -> Day 7, State 2: Increment the counting matrix [2,2] by 1; Day 7: State 2 -> Day 8 State 1: Increment the counting matrix [2,1] by 1; Day 8: State 1 -> Day 9, State 3: Increment the counting matrix [1,3] by 1; Day 9: State 3 -> Day 10: State 2: Increment the counting matrix [3,2] by 1.
[0054] Final counting matrix: Next state 1 2 3 When 1 [0, 2, 1] The first two [1, 2, 1] Status 3 [1, 1, 0] For state 1 (first row): total number of transitions = 0 + 2 + 1 = 3, so the transition probability is: P(1->1) = 0 / 3 = 0 P(1->2) = 2 / 3 ≈ 0.6667 P(1->3) = 1 / 3 ≈ 0.3333 For state 2 (second row): total number of transitions = 1 + 2 + 1 = 4, so the transition probability is: P(2->1) = 1 / 4 = 0.25 P(2->2) = 2 / 4 = 0.5 P(2->3) = 1 / 4 = 0.25 For state 3 (third row): the total number of transitions = 1 + 1 + 0 = 2, so the transition probability is: P(3->1) = 1 / 2 = 0.5 P(3->2) = 1 / 2 = 0.5 P(3->3) = 0 / 2 = 0 Therefore, the state transition probability matrix is: Next state 1 2 3 When 1 [0, 0.6667, 0.3333] The first two [0.25, 0.5, 0.25] Status 3 [0.5, 0.5, 0] This embodiment provides a quantitative strategy generation method based on a hybrid development architecture. First, it acquires historical stock market attribute information and determines a market state label sequence based on this information, including the market state label for each trading day. Then, it groups the market state label sequence according to the daily return sequences of each quantitative strategy type, obtaining a return subsequence for each quantitative strategy type under all market state labels. Next, it calculates the average performance value for each quantitative strategy type under the same type of market state label based on the return subsequences. In response to a quantitative strategy generation command, it generates the current stock market's quantitative strategy type based on the average performance value for each quantitative strategy type under the same type of market state label and the current stock market's attribute information. Compared to generating quantitative strategies using a trained prediction model, this application determines the return subsequences for each quantitative strategy type under all market state labels based on historical stock market attribute information, and then calculates the average performance value for each quantitative strategy type under the same type of market state label based on the return subsequences. This allows for the generation of the current stock market's quantitative strategy type based on the average performance value for each quantitative strategy type under the same type of market state label and the current stock market's attribute information, thereby improving the accuracy of the generated quantitative strategy.
[0055] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0056] In one embodiment, a quantitative strategy generation system based on a hybrid development architecture is provided. For example... Figure 2 As shown, the system includes: Module 21 is used to acquire historical stock market attribute information, including price data, volatility data, trading volume data, fundamental data, and sentiment data. The determination module 22 is used to determine a market status label sequence based on the attribute information of the historical stock market. The market status label sequence includes the market status label for each trading day. The market status label is a high volatility downward label, a low volatility oscillation label, an upward trend label, or a high volatility disorder label. Grouping module 23 is used to group the market state label sequence according to the daily return sequence of each quantitative strategy type, so as to obtain the return subsequence corresponding to each quantitative strategy type under all market state labels; Calculation module 24 is used to calculate the average performance value of each quantitative strategy type under the same type of market state label based on the yield subsequence; The generation module 25 is used to respond to the quantitative strategy generation instruction and generate the quantitative strategy type of the current stock market based on the average performance value corresponding to each quantitative strategy type under the same type of market status label and the attribute information of the current stock market.
[0057] In an optional embodiment, the determining module 22 is specifically used for: Clustering calculations are performed based on the attribute information of each trading day in the historical stock market to obtain the market status label for each trading day; The market status labels of all trading days are combined in chronological order to obtain a market status label sequence.
[0058] In an optional embodiment, the grouping module 23 is specifically used for: Based on the historical stock market, calculate the daily return series corresponding to N quantitative strategy types, wherein the daily return series includes the daily return for each trading day calculated according to the corresponding quantitative strategy type; Extract the daily returns of the same market state label from the N daily return sequences as the return subsequences of the corresponding quantitative strategy type under the corresponding market state label.
[0059] In an optional embodiment, the calculation module 24 is specifically used for: Based on the aforementioned return subsequence, the performance data corresponding to each type of quantitative strategy under the same type of market state label is calculated. The performance data includes at least: annualized return, annualized volatility, Sharpe ratio, and maximum drawdown. The average performance value for each market status label is calculated by averaging the performance data for the same type of market status label and then weighting all the averages for the same type of market status label.
[0060] In an optional embodiment, the generation module 25 is specifically used for: Obtain the current market status label corresponding to the attribute information of the current stock market; Based on the average performance value corresponding to each type of quantitative strategy under the same type of market state label, the quantitative strategy type with the highest average performance value corresponding to the current market state label is determined as the quantitative strategy type of the current stock market.
[0061] In an optional embodiment, the generation module 25 is specifically used for: Obtain the current market status label corresponding to the attribute information of the current stock market; Based on the current market status label and the market status labels of the previous M trading days, predict the predicted market status label for the next trading day; The current stock market quantitative strategy type is generated based on the current market state label, the predicted market state label, and the average performance value corresponding to each quantitative strategy type under the same market state label.
[0062] In an optional embodiment, the generation module 25 is specifically used for: The current market state label and the market state labels of the previous M trading days are used to predict the market state label for the next trading day, which is then converted into a market state label feature sequence. The current stock market attribute information and the market state label feature sequence are input into the market state prediction model to predict the market state label for the next trading day.
[0063] In an optional embodiment, the generation module 25 is specifically used for: Based on the average performance value corresponding to each quantitative strategy type under the same type of market state label, obtain the average performance value corresponding to the current market state label and the predicted market state label for each quantitative strategy type. The average performance values of the current market state label and the predicted market state label of the same quantitative strategy type are weighted and calculated to obtain the comprehensive performance value corresponding to each quantitative strategy type. The current stock market quantitative strategy type is generated based on the comprehensive performance value corresponding to each quantitative strategy type.
[0064] In an optional embodiment, the generation module 25 is specifically used for: The weight value of each quantitative strategy type is calculated based on the comprehensive performance value corresponding to each quantitative strategy type. The quantitative strategy type for the current stock market is selected based on the weight value of the quantitative strategy type.
[0065] It should be noted that the above detailed descriptions are exemplary and intended to provide further explanation of this application. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains.
[0066] Specific limitations regarding the quantization strategy generation system based on a hybrid development architecture can be found in the limitations of the quantization strategy generation method based on a hybrid development architecture described above, and will not be repeated here. Each module in the aforementioned device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in the computer device in hardware form, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0067] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the system can be divided into different functional units or modules to complete all or part of the functions described above.
[0068] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A method for generating a quantization strategy based on a hybrid development architecture, characterized in that, The method comprises: obtaining attribute information of historical stock markets, the attribute information including price data, volatility data, trading volume data, fundamental data, and sentiment data; determining a market state label sequence according to the attribute information of the historical stock markets, the market state label sequence including market state labels of each trading day, the market state labels being high-volatility falling labels, low-volatility oscillation labels, trend rising labels, or high-volatility disordered labels; grouping the market state label sequence according to daily return rate sequences of various quantitative strategy types to obtain return rate subsequences corresponding to each quantitative strategy type under all market state labels respectively; calculating average performance values corresponding to each quantitative strategy type under the same type of market state label respectively according to the return rate subsequences; in response to a quantitative strategy generation instruction, generating a quantitative strategy type of a current stock market according to the average performance values corresponding to each quantitative strategy type under the same type of market state label respectively and attribute information of the current stock market.
2. The method of claim 1, wherein, The determination of the market state label sequence according to the attribute information of the historical stock markets comprises: performing clustering calculation on attribute information of each trading day in the historical stock markets to obtain market state labels of each trading day; combining the market state labels of all trading days in chronological order to obtain the market state label sequence.
3. The method of claim 2, wherein, The grouping of the market state label sequence according to daily return rate sequences of various quantitative strategy types to obtain return rate subsequences corresponding to each quantitative strategy type under all market state labels respectively comprises: calculating daily return rate sequences corresponding to N quantitative strategy types based on the historical stock markets, the daily return rate sequences including daily return rates of each trading day calculated according to the corresponding quantitative strategy types; extracting daily return rates of the same market state label from the N daily return rate sequences as return rate subsequences of the corresponding quantitative strategy types under the corresponding market state labels.
4. The method of claim 3, wherein, The calculation of average performance values corresponding to each quantitative strategy type under the same type of market state label respectively according to the return rate subsequences comprises: calculating performance data corresponding to each quantitative strategy type under the same type of market state label respectively according to the return rate subsequences, the performance data including at least annualized return rate, annualized volatility, Sharpe ratio, and maximum drawdown; performing mean value calculation on the performance data corresponding to each quantitative strategy type under the same type of market state label respectively, and performing weighted calculation on all mean values of the same type of market state label to obtain average performance values corresponding to each quantitative strategy type under the same type of market state label respectively.
5. The method of claim 1, wherein, The generation of a quantitative strategy type of a current stock market according to average performance values corresponding to each quantitative strategy type under the same type of market state label respectively and attribute information of the current stock market comprises: obtaining a current market state label corresponding to the attribute information of the current stock market; determining a quantitative strategy type with the highest average performance value corresponding to the current market state label as the quantitative strategy type of the current stock market according to the average performance values corresponding to each quantitative strategy type under the same type of market state label respectively.
6. The method of claim 1, wherein, The generating of the quantification strategy type of the current stock market according to the average performance value corresponding to each quantification strategy type under the same type market state label and the attribute information of the current stock market comprises: Obtaining the current market state label corresponding to the attribute information of the current stock market; Predicting the predicted market state label of the next trading day according to the current market state label and the market state labels of the previous M trading days; Generating the quantification strategy type of the current stock market according to the current market state label, the predicted market state label and the average performance value corresponding to each quantification strategy type under the same type market state label.
7. The method of claim 6, wherein, The predicting of the predicted market state label of the next trading day according to the current market state label and the market state labels of the previous M trading days comprises: Converting the current market state label and the market state labels of the previous M trading days into a market state label feature sequence to predict the predicted market state label of the next trading day; Inputting the attribute information of the current stock market and the market state label feature sequence into a market state prediction model to predict the predicted market state label of the next trading day.
8. The method of claim 6, wherein, The generating of the quantification strategy type of the current stock market according to the current market state label, the predicted market state label and the average performance value corresponding to each quantification strategy type under the same type market state label comprises: Obtaining the average performance value corresponding to each quantification strategy type under the same type market state label according to the average performance value corresponding to each quantification strategy type under the same type market state label; Performing weighted calculation on the average performance values of the current market state label and the predicted market state label of the same quantification strategy type to obtain a performance comprehensive value corresponding to each quantification strategy type; Generating the quantification strategy type of the current stock market according to the performance comprehensive value corresponding to each quantification strategy type.
9. The method of claim 8, wherein, The generating of the quantification strategy type of the current stock market according to the performance comprehensive value corresponding to each quantification strategy type comprises: Calculating a weight value of the quantification strategy type through the performance comprehensive value corresponding to each quantification strategy type; Selecting the quantification strategy type of the current stock market according to the weight value of the quantification strategy type.
10. A quantification strategy generation system based on a hybrid development architecture, characterized in that, The system comprises: An acquisition module configured to acquire attribute information of a historical stock market, the attribute information comprising price data, volatility data, trading volume data, fundamental data and sentiment data; A determination module configured to determine a market state label sequence according to the attribute information of the historical stock market, the market state label sequence comprising a market state label of each trading day, the market state label being a high-volatility falling label, a low-volatility oscillation label, a trend rising label or a high-volatility disorder label; A grouping module configured to group the market state label sequence according to a daily return rate sequence of each quantification strategy type to obtain a return rate subsequence corresponding to each quantification strategy type under all market state labels; and A selection module configured to select a quantification strategy type of the current stock market according to a weight value of the quantification strategy type. A calculating module is configured to calculate an average performance value corresponding to each type of quantitative strategy under the same type of market state label according to the yield rate subsequence; A generating module is configured to generate the type of quantitative strategy of the current stock market according to the average performance value corresponding to each type of quantitative strategy under the same type of market state label and attribute information of the current stock market in response to a quantitative strategy generation instruction.