Dragon callback form trend matching method, system and equipment based on causal analysis and medium
By employing causal analysis and graph convolutional network models, this study addresses the systemic deficiencies and spurious correlations in the research of dragon pullback patterns in financial markets. It achieves accurate identification and risk optimization of dragon pullback patterns, providing more precise investment decision support.
Patent Information
- Application Number
- CN202511823383.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-05
- Publication Date
- 2026-02-13
AI Technical Summary
Existing technologies lack a systematic approach to studying the pullback pattern in financial markets, failing to deeply analyze the wash-out strategies of major funds and the herd mentality of retail investors. Furthermore, traditional research methods suffer from spurious correlations and endogeneity issues, making it difficult to optimize investment strategies through causal logic.
A causal analysis-based approach is adopted, which constructs a causal graph model through PC causal discovery algorithm and graph convolutional neural network to identify key structural points of the dragon callback pattern, mine quantitative features, calculate causal strength through interaction entropy, and construct a graph convolutional network model for matching.
It improves the accuracy of identifying pullback patterns and the utilization rate of information, enabling precise capture of investment opportunities, reducing investment risks, and providing more accurate investment decision-making basis.
Smart Images

Figure CN121524811A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to a stock pattern matching method, in particular to a cause-effect analysis-based Long pullback pattern matching method, system, computer device and storage medium. BACKGROUND
[0002] As a price sequence pattern with significant market recognition, Long pullback is essentially a dynamic equilibrium reconstruction process based on the Momentum Effect theory. It refers to the price fluctuation process of a target asset with significant leading properties in a specific market cycle. After a round of rapid price rise, the market sentiment is overheated, and the market supply and demand relationship is out of balance due to irrational boom, resulting in a short-term price correction, followed by a key technical support position to complete the consolidation of shares and restart the price rise.
[0003] Cause-effect analysis is a core methodology for revealing the internal mechanism of things. Its key lies in identifying the cause-effect between variables, i.e. how the change of a variable (cause) leads to the change of another variable (result). The core breakthrough lies in constructing an anti-fact framework to simulate the cause-effect path of "intervention-result", so as to eliminate the influence of confounding factors and achieve accurate identification of cause-effect relationship. This methodological innovation enables cause-effect analysis to penetrate the data surface and reveal the deep mechanism between variables. Compared with modern cause-effect analysis theory, correlation analysis is based on the co-variable relationship of data and can only describe the linear or nonlinear relationship between variables, but cannot determine whether the change of a variable will inevitably lead to the change of a result, and it is even more difficult to exclude the interference of confounding factors. Especially in the financial market, which is a complex system with strong endogeneity and nonlinear characteristics, relying solely on correlation analysis is easy to fall into the "pseudo-correlation" trap, i.e. the correlation between variables is only a superficial correlation at the data level without a deep logical relationship. This "pseudo-correlation" trap may lead to the failure of research conclusions and investment strategies.
[0004] Structural causal modeling is a formal language for describing data generation mechanisms and external interventions. Its core lies in constructing causal graphs to describe the causal relationships between variables, presented in the form of a Directed Acyclic Graph (DAG). In the causal graph, nodes represent variables, and directed edges indicate the direction of causal influence between variables. This graphical representation allows complex causal relationships to be displayed in a concise and clear way, facilitating researchers' understanding and analysis. Structural causal models integrate structural equation modeling (SEM). On the one hand, they use DAGs to intuitively present the causal structure between variables, enabling researchers to quickly grasp the causal paths between variables and identify direct and indirect causal relationships. On the other hand, structural equations quantify the strength of interactions between variables, forming a systematic representation of complex causality. This allows causal relationships to be not only visually displayed graphically but also precisely characterized numerically, achieving the goal of systematically representing complex causal relationships. When faced with large amounts of complex data, structural causal models can help researchers uncover potential causal relationships from the data rather than relying solely on pre-defined assumptions. By exploring and quantifying causal structures, researchers can gain a deeper understanding of the underlying generation mechanisms of the data, providing strong support for further theoretical construction and practical applications.
[0005] Graph Convolutional Neural Networks (GCNs) are a core modeling method in deep learning for non-Euclidean structured data. Essentially, this model was proposed to address the inherent limitations of traditional deep learning frameworks in processing unstructured data. Traditional deep learning models (such as convolutional neural networks and recurrent neural networks) have achieved significant success in processing Euclidean structured data (such as images and text), but they still face limitations when dealing with non-Euclidean structured data such as social networks, knowledge graphs, or causal graphs. The tensor operations they rely on are difficult to directly adapt to the topological characteristics of non-Euclidean space data such as social networks, knowledge graphs, and molecular structures. Furthermore, a core assumption of existing deep learning algorithms is that data samples are independent of each other. However, this is not the case for graphs. Each data sample (node) in a graph has edges that are related to other real data samples (nodes) in the graph. This information can be used to capture the dependencies between instances.
[0006] In the field of quantitative analysis in financial markets, research on stock trend matching based on candlestick patterns mainly focuses on universal pattern mining and modeling, presenting two main technical paths. The first relies on data mining techniques to quantitatively deconstruct the geometric features of classic candlestick patterns such as head and shoulders, double bottoms, and flags, achieving pattern recognition by constructing a pattern parameter library, such as peak spacing and amplitude ratio. The second utilizes machine learning algorithms to perform pattern matching on candlestick combinations, improving the accuracy of pattern matching through feature extraction and model training. However, such research largely focuses on the statistical regularities of general patterns, lacking systematic academic exploration of specific stock patterns (such as the "dragon pullback" pattern) extracted by investors in practice. This results in the insufficient exploration of key information such as market sentiment transmission and volume-price-time-space characteristics inherent in these patterns. Furthermore, existing research on candlestick patterns exhibits a significant characteristic of being "overly general but lacking in specificity." At the methodological level, current research fails to deeply analyze the wash-out strategies of major funds and the herd mentality of retail investors during the formation process. In terms of theoretical framework, the matching of such patterns remains at the stage of empirical induction, lacking the construction based on the theory of market microstructure. Related investment strategies only exist in non-academic investment forums and have not yet formed a verifiable theoretical system and quantitative model.
[0007] In the financial application of causal analysis, although cutting-edge methods such as structural causal models (SCM) and counterfactual reasoning have been gradually applied to research on capital asset pricing and risk contagion, their cross-integration with the study of specific stock patterns remains a blank. Currently, investors have unearthed relevant experiences related to the formation and evolution of the "dragon pullback" pattern, involving macroeconomic variables, industry prosperity, and capital flows. However, this experience remains at the level of superficial inductive reasoning, lacking both correlation analysis and causal logical inference. Current quantitative matching models using machine learning only employ traditional correlation analysis for feature engineering, making it difficult to penetrate the surface data and identify the true causal drivers. Therefore, introducing causal analysis into this field, clarifying the causal directionality between variables by constructing causal graph models, and using counterfactual reasoning to assess the effects of interventions, can effectively solve the problems of "spurious correlation" and "endogeneity" in traditional research. This would not only provide a more explanatory theoretical foundation for pattern recognition but also optimize the risk-return characteristics of investment strategies through causal effect estimation, achieving a paradigm shift from phenomenon description to mechanism analysis. However, current research in this field still faces technical bottlenecks such as the strong subjectivity of the prior setting of causal graph structures and the high computational complexity of causal effect estimation under high-dimensional financial data, which urgently require systematic research from the academic community. Summary of the Invention
[0008] To address the shortcomings of existing technologies, this invention provides a method, system, computer equipment, and storage medium for matching dragon pullback patterns based on causal analysis. The purpose is to match dragon pullback patterns in the stock market, providing investors with more accurate investment decision-making basis, helping them accurately capture investment opportunities, and reducing investment risks.
[0009] To achieve the above objectives, the present invention adopts the following technical solution: The first aspect of this invention discloses a method for matching the trend of a dragon pullback pattern based on causal analysis, comprising the following steps: Step 1: Obtain stock trading data within a specific time window as the raw dataset, and simultaneously calculate technical indicators. Perform data preprocessing on the raw dataset and the calculated technical indicators. Step 2: Based on the standardized trading dataset obtained in Step 1, construct a geometric pattern template by defining the key structural points of the Dragon Pullback pattern, use template matching technology to identify Dragon Pullback pattern samples in historical stock market data, and extract quantitative features based on the pattern definition. Step 3: The PC causal discovery algorithm is used to systematically analyze the causal relationship between the dragon pullback pattern features and the dragon pullback trend obtained in Step 2. Based on the conditional independence test mechanism of the algorithm, the direct causal path and indirect relationship between the pattern features and the pullback effect are mined. By calculating the Markov cover set of the dragon pullback effect, the smallest feature subset with conditional dependence on the pullback effect is determined. Furthermore, the intensity of the identified causal relationship is characterized by the method of interaction entropy calculation. Step 4: Construct a graph convolutional network model based on the causal intensity map calculated in Step 3. Use the dragon pullback pattern features and trends mined in Step 2 as data to iteratively train the model, and finally form a graph convolutional network model that can match the dragon pullback pattern trend.
[0010] Furthermore, step 1 specifically includes the following steps: Step 1.1: Obtain daily stock market data, including the opening price, closing price, highest price, and lowest price; Step 1.2: Obtain daily trading data for stocks, including stock turnover and trading volume; Step 1.3: Using the technical indicator calculation library provided by TA-LIB, and based on the daily K-line data of the stock obtained in Steps 1.1 and 1.2, calculate the RSI, DIF, DEA, MACD and MA technical indicators; Step 1.4: Perform data preprocessing on the above market data, transaction data, and technical indicators.
[0011] Furthermore, step 2 includes the following steps: Step 2.1: Based on the standardized definition rules of the Dragon Pullback pattern, the daily K-line data of the stock is screened and labeled, and samples that meet the characteristics of the pattern within a specified time interval of the stock market are extracted to construct the Dragon Pullback pattern sample set; Step 2.2: For the dragon pullback pattern discovered in Step 2.1, match it based on the actual trend of its secondary start-up phase to form the label dataset required for training the graph convolutional network model; among them, the trend of the secondary start-up phase is divided into five types: unexpected pullback, expected pullback, upper half pullback, lower half pullback, and pullback failure. The formula for each pullback case is defined as follows: (1) Unexpected pullback: ; (2) Expected pullback: ; (3) Upper half pullback: ; (4) Lower half pullback: / 2; (5) Callback failed: ; in For the set of stocks within the research scope, for any stock , The maximum value of the highest price during the pullback period. The minimum value of the lowest price during the pullback period. The maximum value of the highest price during the second startup phase; Step 2.3: Based on the standardized definition rules of the dragon pullback pattern characteristics, and combined with the dragon pullback pattern identified in Step 2.1 and the corresponding market data during the pullback period, calculate and extract the quantitative characteristics of the dragon pullback pattern; Step 2.4: Perform matching and preprocessing operations on the data obtained in Steps 2.1, 2.2 and 2.3, including data consistency verification and missing data removal, to ensure the matching between the time dimension and the sample dimension and improve the effectiveness and usability of the dataset.
[0012] Furthermore, the dragon callback pattern described in step 2.1 is defined as follows: The upward phase requires the target stock to achieve a cumulative increase of 30% to 40% within 7 trading days, and the daily closing price should not show a downward trend, so as to ensure the continuity of the upward trend; when the stock price falls for two consecutive trading days, it marks the end of the upward phase and triggers the starting signal of the pullback phase. During the pullback phase, the stock price generally declines or fluctuates. The daily increase of the stock price should not exceed 1%, and there should be at least one trading day when the stock price falls, thus forming a valid pullback. Once the daily increase of the stock price exceeds 1%, the end signal of the pullback phase is immediately triggered, and a second start phase is initiated. If the pullback phase lasts less than 4 trading days, then this pullback is not considered a valid pattern. The second phase of the rally begins immediately after the end signal of the pullback is triggered, or it is automatically activated when the pullback lasts for more than 8 trading days. The retracement pattern is classified according to the strength of the stock's upward momentum during the second phase of the rally and the depth and duration of the pullback.
[0013] Furthermore, the characteristics of the dragon pullback pattern described in step 2.3 include four dimensions: the degree of correlation between volume and price, market sentiment indicators, price volatility characteristics, and correlation with technical indicators, among which: Volume-price correlation: This measures the synergistic relationship between stock trading volume and price changes. In an uptrend, if trading volume increases in tandem with rising stock prices, it indicates high market participation and suggests the health and sustainability of the uptrend. Conversely, in a downtrend, if trading volume increases as stock prices fall, it suggests the downtrend may continue. Market sentiment indicators are used to quantify investors' psychological expectations and trading behavior tendencies, focusing on the price movement characteristics during the stock's upward phase and secondary launch phase. By capturing the rise and fall of stock prices in the market, a multi-dimensional sentiment measurement system is constructed to reflect the overall activity level and optimism of market sentiment. Price fluctuation characteristics: used to measure the pattern characteristics during the pullback of the dragon, and can depict the price evolution pattern of the pattern within a specific period; Technical indicator correlation: depicting the indicative role of golden crosses and death crosses in the trend evolution process; a golden cross is when the short-term technical indicator curve breaks through the long-term technical indicator curve from bottom to top, and this pattern is usually regarded as a signal that the price trend is turning from weak to strong; a death cross is when the short-term technical indicator curve crosses the long-term technical indicator curve from top to bottom, indicating that there is downward pressure on the price.
[0014] Furthermore, step 3 includes the following steps: Step 3.1: Based on the matching results of the dragon pullback pattern obtained in Step 2.2 and the dragon pullback pattern features obtained in Step 2.3, the PC causal discovery algorithm is used to analyze and explore the causal relationships between features and between features and the dragon pullback pattern. Step 3.2: Based on the causal relationship established in Step 3.1, perform Markov cover set calculation to obtain the causal relationships between features related to the Dragon Pullback pattern trend; Step 3.3: For the causal relationship generated in Step 3.2, the causal strength between the causal relationship and the trend of the Dragon Pullback pattern is quantified by calculating the interaction entropy. The interaction entropy calculation formula is shown below. ; Where X and Y are two random variables. and , This represents the joint probability distribution of x and y. This represents the probability of x.
[0015] Furthermore, step 4 specifically includes the following steps: Step 4.1: Based on the causal strength obtained in Step 3.3, construct a graph convolutional network model, set and optimize the hierarchical structure and hyperparameters of the model to adapt to the topological structure and data distribution characteristics of the dragon callback pattern. Step 4.2: Train the dragon pullback pattern trend matching model, minimize the matching error through iterative optimization algorithm, and terminate the training when the model training reaches the preset number of iterations, and finally generate a model that can be used for dragon pullback pattern trend matching.
[0016] In a second aspect, the present invention discloses a causal analysis-based dragon pullback pattern trend matching system, comprising a front-end display module, a business logic module, and a data storage module; The front-end display module visualizes the results of pattern trend matching. The business logic module interacts with the front-end display module and the data storage module. It retrieves data from the data storage module, calls the trained model, and feeds the results back to the front-end display module. It includes a pattern recognition module, a causal analysis module, and a trend matching module. The pattern recognition module is responsible for historical pattern mining and pattern feature calculation. The causal analysis module is responsible for causal graph relationship discovery and Markov process calculation. The trend matching module is responsible for trend matching model training and matching result calculation. The data storage module stores business logic module data in the database, providing data support.
[0017] A third aspect of the present invention discloses a computer device including a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the steps of the method according to any one of claims 1 to 7.
[0018] In a fourth aspect, the present invention discloses a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the method of any one of claims 1 to 7.
[0019] Advantages and effects of this invention: The causal analysis-based dragon pullback trend matching method provided by this invention effectively avoids the spurious correlation problem commonly found in financial data, maximizes the information utilization rate during the occurrence of dragon pullback patterns, accurately identifies dragon pullback patterns in the stock market, and matches their trends based on the actual stock performance during the dragon pullback period. Empirical research on all stocks in the Chinese A-share market from January 1, 2022 to March 25, 2025 shows that the dragon pullback patterns identified and analyzed by this model during this period have high accuracy and can assist investors in making investment decisions. Attached Figure Description
[0020] Figure 1 This is a flowchart of the present invention.
[0021] Figure 2 This is a structural block diagram of the present invention.
[0022] Figure 3 This is a flowchart illustrating the data acquisition process.
[0023] Figure 4 This is a flowchart illustrating the trend processing procedure.
[0024] Figure 5 This is a diagram illustrating the characteristic structure of a dragon's callback.
[0025] Figure 6 This is a flowchart illustrating the causal extraction process.
[0026] Figure 7 A schematic diagram illustrating the process of building a trend matching model. Detailed Implementation
[0027] The specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and examples. The following examples are for illustrative purposes only and are not intended to limit the scope of the invention.
[0028] like Figure 1 As shown, the first aspect of this invention discloses a method for matching the trend of a "dragon pullback" pattern based on causal analysis. The main process of this invention includes data acquisition, trend processing, causal extraction, and trend matching model construction. This invention acquires historical market data from the A-share market and aims to match the trend of a "dragon pullback" pattern by constructing a trend matching model. This embodiment uses real stock data from the A-share market as input, aiming to match all "dragon pullback" patterns using a geometric template and accurately match their trend. The steps are as follows: Step 1: As Figure 3As shown, the original dataset is trading data of A-share stocks within a specific time window. The data specifically includes daily market data and volume-price relationship data. Technical indicators are calculated simultaneously based on this data. The main steps include technical indicator calculation and data preprocessing. In this embodiment, the time range for stocks is from April 1, 2018 to March 25, 2025. The stock range is limited to all main board, STAR Market, and ChiNext stocks still listed and traded on the A-share market as of March 25, 2025. This period covers multiple complete bull and bear cycles in the A-share market, such as the unilateral decline in 2018, the structural market from 2019 to 2021, the volatile adjustment in 2022, and the recovery market after 2023. It includes the influence of various market variables such as policy (e.g., the implementation of the registration system), capital (e.g., fluctuations in northbound capital inflows), and fundamentals (e.g., the profit cycle of listed companies), effectively avoiding the randomness of data in a single market environment and ensuring the generalization ability of the model training. Among them, main board stocks (such as Kweichow Moutai and ICBC) have large circulating shares and relatively stable trends, resulting in stronger persistence of the "dragon pullback" pattern. Stocks on the STAR Market and ChiNext (such as SMIC and CATL) have more relaxed price fluctuation limits and stronger growth attributes, leading to greater short-term volatility. Their "dragon pullback" patterns show significant differences in the magnitude of rises and the pace of pullbacks compared to the main board. Including all three types of market stocks covers targets with different market capitalizations, industries, and volatility characteristics, making the subsequent pattern matching model applicable to all market investment scenarios and meeting the needs of investors with different risk appetites. Finally, data preprocessing is performed on the above dataset to ensure the validity and authenticity of the data.
[0029] Step 1.1: Obtain daily market data for all listed stocks in the A-share market, including opening price, closing price, highest price, and lowest price.
[0030] Step 1.2: Obtain daily trading data for all listed stocks in the A-share market, including stock turnover and trading volume.
[0031] Step 1.3: Using the technical indicator calculation library provided by TA-LIB, and based on the daily stock K-line data obtained in Steps 1.1 and 1.2, calculate the RSI, DIF, DEA, MACD, and MA technical indicators. The RSI, DIF, DEA, MACD, and MA technical indicators are calculated using existing stock trading methods.
[0032] Step 1.4: Perform data preprocessing operations on the above data.
[0033] Step 2: As Figure 4As shown, based on the standardized trading dataset obtained in step 1, the main process involves pattern labeling and feature extraction. A geometric pattern template is constructed by defining key structural points of the "dragon pullback" pattern. Template matching technology is used to identify "dragon pullback" pattern samples in historical A-share market data, and quantitative features are extracted based on the pattern definition rules. In the actual analysis scenario of the financial market, this step uses the standardized A-share market trading dataset obtained in step 1 as the core foundation. Combining the trend pattern judgment logic in technical analysis, the key structural nodes contained in the "dragon pullback" pattern are first anchored, such as trend initiation points, pullback lows, and rebound confirmation points, to construct a geometric pattern template that conforms to market fluctuation patterns. Then, template matching, a commonly used method in technical analysis, is used to accurately screen out practical samples that match the pattern characteristics from massive historical A-share trading data. Simultaneously, based on the standardized definition rules for pattern recognition in the financial market, quantifiable trading features such as pullback amplitude, pullback duration, volume changes, and trend slope are extracted from the samples, providing solid practical data support for subsequent strategy backtesting and signal generation.
[0034] In this embodiment, investors can use this step to trace back the complete evolution trajectory of all dragon pullback patterns in the history of the A-share market, view successful pattern samples where the stock price breaks through the high point before the pullback and the increase reaches a preset threshold, and monitor similar patterns appearing in the market from key dimensions such as the volume distribution, moving average arrangement and corresponding market environment during the pattern formation stage.
[0035] Step 2.1: Based on the definition rules of the Dragon Pullback pattern, filter and label the daily K-line data of stocks, extract samples from the A-share market within a specified time interval that conform to the characteristics of this pattern, and construct the Dragon Pullback pattern sample set. The definition rules of the Dragon Pullback pattern are as follows: The upward phase requires the target stock to achieve a cumulative increase of 30%-40% within 7 trading days, and the daily closing price should not show a downward trend to ensure the continuity of the upward trend. When the stock price falls for two consecutive trading days, it marks the end of the upward phase and signals the start of the correction phase. For stocks with a 10% daily limit, a 30% increase is required within 7 trading days; for stocks such as those on the Science and Technology Innovation Board and the ChiNext Board, a cumulative increase of 40% is required.
[0036] During the pullback phase, the stock price generally declines or fluctuates. A single day's price increase must not exceed 1%, and there must be at least one trading day with a price decline to constitute a valid pullback. Once a single day's price increase exceeds 1%, the end signal of the pullback phase is immediately triggered, and a second starting phase begins. Furthermore, if the pullback phase lasts less than four trading days, it will not be included in the valid pattern category of this study.
[0037] The second phase of the rally begins immediately after the pullback ends, or is automatically activated when the pullback lasts for more than 8 trading days. This phase categorizes the "Dragon Pullback" pattern based on the strength of the stock's upward momentum during the second phase of the rally and the depth and duration of the pullback.
[0038] Step 2.2: For the dragon pullback pattern discovered in Step 2.1, match it based on the actual trend of its secondary startup phase to form the label dataset required for training the graph convolutional network model. The secondary startup phase trend is divided into five types: unexpected pullback, expected pullback, upper half pullback, lower half pullback, and pullback failure. The formula for each pullback case is defined as follows: (1) Unexpected pullback: ; (2) Expected pullback: ; (3) Upper half pullback: ; (4) Lower half pullback: / 2; (5) Callback failed: ; in For the set of stocks within the research scope, for any stock , The maximum value of the highest price during the pullback period. The minimum value of the lowest price during the pullback period. The maximum value of the highest price during the second startup period.
[0039] Step 2.3: Based on the definition rules of the Dragon Pullback pattern characteristics, and combined with the Dragon Pullback pattern identified in Step 2.1 and its corresponding market data during the pullback period, calculate and extract the quantitative characteristics of the Dragon Pullback pattern. For example... Figure 5 As shown in the hierarchical classification diagram of the Dragon Pullback pattern, the characteristics of the Dragon Pullback pattern encompass four dimensions: the degree of correlation between volume and price, market sentiment indicators, price volatility characteristics, and correlation with technical indicators. The characteristics under each dimension are as follows: Volume-price correlation: This measures the synergistic relationship between stock trading volume and price changes. In an uptrend, if trading volume increases in tandem with rising stock prices, it indicates strong market participation and suggests a healthy and sustainable uptrend. Conversely, in a downtrend, if trading volume increases as stock prices fall, it suggests the downtrend may continue. This example primarily uses two indicators in the volume-price correlation dimension: the distance between trading volume and average price, and volume surge signals.
[0040] Market sentiment indicators are used to quantify investor expectations and trading behavior tendencies, focusing on price movement characteristics during stock price increases and secondary upward phases. By capturing stock price fluctuations in the market, a multi-dimensional sentiment measurement system is constructed to reflect the overall market sentiment activity and optimism. This embodiment selects representative price performance forms including the percentage of stocks opening higher and closing higher, the percentage of stocks hitting their daily limit up, and the percentage of stocks hitting their daily limit up during the initial upward phase. By using the specific price upward trends of stocks hitting their daily limit up and opening higher and closing higher in the A-share market, the system assesses market sentiment and identifies the potential driving forces behind stock price trends.
[0041] Price fluctuation characteristics: This is used to measure the pattern characteristics during the dragon's pullback, and can systematically depict the price evolution pattern of this pattern within a specific period. This embodiment focuses on the price fluctuation characteristics during the dragon's pullback, selecting key indicators such as the maximum increase during the initiation phase, the average increase during the upward phase, the average body length, and the maximum pullback amplitude as the core analysis objects.
[0042] Technical Indicator Correlation: Depicting the Indicative Role of Golden Crosses and Death Crosses in Trend Evolution. A golden cross occurs when a short-term technical indicator curve breaks through a long-term technical indicator curve from below; this pattern is generally considered a signal of a price trend shifting from weak to strong. A death cross occurs when a short-term technical indicator curve crosses a long-term technical indicator curve from above, indicating downward pressure on prices. This example selects the golden cross and death cross phenomena of Moving Averages (MA) and Moving Average Convergence Divergence (MACD) as the core analysis objects.
[0043] Step 2.4: Perform matching and preprocessing operations on the data obtained in Steps 2.1, 2.2 and 2.3, including data consistency verification and missing data removal, to ensure the matching between the time dimension and the sample dimension and improve the effectiveness and usability of the dataset.
[0044] Step 3: As Figure 6As shown, the structural causal graph is processed, and Markov subsets are calculated based on this. The information entropy is then calculated using the Markov subsets and feature discretization binning to complete the calculation of causal effects. This step utilizes the PC algorithm to systematically analyze the causal relationship between the dragon pullback pattern features and the dragon pullback trend obtained in step 2. Through the algorithm's conditional independence test mechanism, the direct causal path and indirect relationship between the pattern features and the pullback effect are explored. Then, through the Markov cover set calculation of the dragon pullback effect, the smallest feature subset with conditional dependence on the pullback effect is determined, and the strength of the identified causal relationship is characterized using interaction entropy calculation. For investors, the algorithm's conditional independence test mechanism can accurately explore the direct causal path between different pattern features (such as pullback amplitude, volume reduction ratio, moving average turning angle, etc.) and the strength and duration of the subsequent stock price rebound, while also identifying indirect relationships transmitted through factors such as market environment and industry prosperity. By using the Markov cover set calculation of the dragon pullback effect, the smallest feature subset with conditional dependence on the pullback effect can be screened, eliminating redundant information to improve the efficiency of strategy decision-making. Finally, this step quantifies the strength of causal relationships through interactive entropy calculation, which clarifies the influence weight of core features on the pullback effect. This provides a causal basis for constructing a high-win-rate pullback strategy, helping investors to more accurately judge the effectiveness of pattern signals in actual trading.
[0045] In this embodiment, the "Dragon Pullback" pattern formed by Shenzhen Huaqiang (000062) from August 8, 2024 to September 9, 2024 is used as the research sample. Through causal analysis, it is found that features such as the "Golden Cross Index" and the "average distance between the RSI and trading volume throughout the process" are significantly causally related to the final evolution of this pattern. Based on this empirical analysis conclusion, investors can focus on tracking the dynamic changes of these core causal features during the formation stage of the Dragon Pullback pattern.
[0046] Step 3.1: Based on the matching results of the dragon pullback pattern obtained in Step 2.2 and the dragon pullback pattern features obtained in Step 2.3, the PC causal discovery algorithm is used to analyze and explore the causal relationships between features and between features and the dragon pullback pattern.
[0047] Step 3.2: Based on the causal graph constructed in Step 3.1, perform Markov cover set calculation operation to obtain the causal graph between features that are related to the trend of the dragon pullback pattern.
[0048] Step 3.3: For the causal graph generated in Step 3.2, calculate the causal strength between the interaction entropy quantification and the matching causal relationship of the dragon pullback pattern trend. The interaction entropy calculation formula is as follows; ; Where X and Y are two random variables. and .
[0049] The causality strength map generated in this embodiment is as follows: Figure 7 As shown, the features that have a direct causal relationship with the Dragon Pullback Pattern are the Golden Cross Index, the average distance between the RSI and the trading volume throughout the process, the Death Cross Index, and the maximum upward range. Their feature strengths are 0.63, 0.51, 0.32, and 0.25, respectively.
[0050] Step 4: Using the causal strength map calculated in Step 3 as the topological foundation, construct a graph convolutional network model. Use the dragon pullback pattern features and trends mined in Step 2 as data to iteratively train the model. If the model does not converge, continuously backpropagate to calculate the loss and update the learning rate until the model converges. After convergence, a graph convolutional network matching model capable of matching dragon pullback pattern trends is finally formed, and this matching model is then tested.
[0051] In this embodiment, the Dragon Pullback pattern formed by Dun'an Environment (002011) from May 10, 2022 to June 10, 2022 is used as the empirical analysis sample. Based on the trained graph convolutional network matching model, the prediction results show that the success rate of the prediction of the effective reversal of the pattern on the 4th day after the second start of the Dragon Pullback pattern is 58%.
[0052] Step 4.1: Construct a graph convolutional network model based on the causal intensity graph obtained in Step 3.3, and set and optimize the hierarchical structure and hyperparameters of the model to adapt to the topological structure and data distribution characteristics of the dragon callback pattern.
[0053] Step 4.2: The training process for the Dragon Pullback Pattern trend matching model is carried out. The model error is minimized through an iterative optimization algorithm. Training is terminated when the model reaches a preset number of iterations, ultimately generating a model usable for matching Dragon Pullback Pattern trends. After training, the model achieves a matching accuracy of 84.08%, a precision of 84.54%, and a recall of 83.70%. Experimental results show that this model can accurately match the trend of the secondary start-up phase based on the trend during the pullback phase of the Dragon Pullback Pattern.
[0054] like Figure 2 As shown, in a second aspect, the present invention discloses a causal analysis-based dragon pullback pattern trend matching system, including a front-end display module, a business logic module, and a data storage module; The front-end display module visualizes the results of pattern trend matching. The business logic module interacts with the front-end display module and the data storage module. It retrieves data from the data storage module, calls the trained model, and feeds the results back to the front-end display module. It includes a pattern recognition module, a causal analysis module, and a trend matching module. The pattern recognition module is responsible for historical pattern mining and pattern feature calculation. The causal analysis module is responsible for causal graph relationship discovery and Markov process calculation. The trend matching module is responsible for trend matching model training and matching result calculation.
[0055] The data storage module stores business logic module data in the database, providing data support.
[0056] In summary, in the context of full-cycle, multi-sector quantitative investment analysis in the A-share market, the causal analysis-based dragon pullback pattern matching method constructed through steps 1 to 4 can comprehensively cover trading data from the main board, the STAR Market, and the ChiNext market during bull markets, bear markets, and multiple rounds of rapid upward movement. Its pattern recognition module allows investors to review historical stock trading data, the causal analysis module accurately identifies the core driving factors influencing the final trend of the dragon pullback, and the trend matching module quantitatively assesses the success probability of the dragon pullback pattern.
[0057] In a bull market, pullbacks in leading stocks are often short-term consolidation rather than capital flight. This invention's pattern recognition module helps investors quickly identify pullback patterns in leading stocks with consecutive limit-up days and strong market sentiment from a vast pool of rising stocks. The causal analysis module accurately identifies key factors driving a second upward move after a pullback, such as sustained volume expansion and bullish moving average alignment. The trend matching module precisely quantifies the probability of a successful pullback. In a bear market, this invention uses the pattern recognition module to screen for pullback cases of strong stocks with solid thematic support and high prior recognition. The causal analysis module identifies key factors such as risk aversion and stock stability. The trend matching module's quantitative results clarify the probability boundaries of a successful rebound. In a volatile market, this invention's pattern recognition module allows investors to trace the historical evolution of pullbacks in different sectors, adapting to the rapidly changing market characteristics. The causal analysis module comprehensively assesses factors such as the balance of power between buyers and sellers and the sustainability of hot sectors, identifying core variables influencing pullback trends. The quantitative data output by the trend matching module provides a basis for distinguishing between valid pullbacks and volatile traps.
[0058] The modules in the aforementioned causal analysis-based dragon pullback pattern trend matching system 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 a computer device, or stored in the computer device's memory as software, allowing the processor to call and execute the corresponding operations. By using this system, the aforementioned computational processing methods can be executed, achieving the corresponding technical effects.
[0059] In a third aspect, this invention discloses a computer device, including a memory and a processor. Specifically, the memory stores data and related computer programs required for executing a method, and the processor can invoke the data and programs in the memory to implement all the steps of the aforementioned method. The computer device also includes input / output interfaces (I / O), a communication interface, an audio processor, a display, a power supply, and other components. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is connected to the system bus via the I / O interfaces; these are well known to those skilled in the art and therefore will not be described further. The processor of this computer device provides computational and control capabilities. The memory of this computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database of this computer device stores and retrieves daily-level stock market data and daily-level stock trading data, including basic information such as stock opening price, closing price, highest price, lowest price, stock trading volume, and trading amount.
[0060] In a fourth aspect, this invention discloses a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements a causal analysis-based dragon pullback pattern trend matching method. This can be any readable storage medium capable of storing program code, such as a USB flash drive, external hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk. For example, the computer-readable storage medium can be the aforementioned memory containing program instructions, which can be executed by the processor of the causal analysis-based dragon pullback pattern trend matching system to complete the aforementioned causal analysis-based dragon pullback pattern trend matching method.
[0061] Those skilled in the art will recognize that the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0062] The above description is merely one embodiment of the present invention and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present invention is not limited to the technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described inventive concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features with similar functions disclosed in the embodiments of the present invention.
Claims
1. A method for matching the trend of a dragon pullback pattern based on causal analysis, characterized in that, Includes the following steps: Step 1: Obtain stock trading data within a specific time window as the raw dataset, and simultaneously calculate technical indicators. Perform data preprocessing on the raw dataset and the calculated technical indicators. Step 2: Based on the standardized trading dataset obtained in Step 1, construct a geometric pattern template by defining the key structural points of the Dragon Pullback pattern, use template matching technology to identify Dragon Pullback pattern samples in historical stock market data, and extract quantitative features based on the pattern definition. Step 3: The PC causal discovery algorithm is used to systematically analyze the causal relationship between the dragon pullback pattern features and the dragon pullback trend obtained in Step 2. Based on the conditional independence test mechanism of the algorithm, the direct causal path and indirect relationship between the pattern features and the pullback effect are mined. By calculating the Markov cover set of the dragon pullback effect, the smallest feature subset with conditional dependence on the pullback effect is determined. Furthermore, the intensity of the identified causal relationship is characterized by the method of interaction entropy calculation. Step 4: Construct a graph convolutional network model based on the causal intensity map calculated in Step 3. Use the dragon pullback pattern features and trends mined in Step 2 as data to iteratively train the model, and finally form a graph convolutional network model that can match the dragon pullback pattern trend.
2. The method for matching the trend of a dragon pullback pattern based on causal analysis according to claim 1, characterized in that, Step 1 specifically includes the following steps: Step 1.1: Obtain daily stock market data, including the opening price, closing price, highest price, and lowest price; Step 1.2: Obtain daily trading data for stocks, including stock turnover and trading volume; Step 1.3: Using the technical indicator calculation library provided by TA-LIB, and based on the daily K-line data of the stock obtained in Steps 1.1 and 1.2, calculate the RSI, DIF, DEA, MACD and MA technical indicators; Step 1.4: Perform data preprocessing on the above market data, transaction data, and technical indicators.
3. The method for matching the trend of a dragon pullback pattern based on causal analysis according to claim 1, characterized in that, Step 2 includes the following steps: Step 2.1: Based on the standardized definition rules of the Dragon Pullback pattern, the daily K-line data of the stock is screened and labeled, and samples that meet the characteristics of the pattern within a specified time interval of the stock market are extracted to construct the Dragon Pullback pattern sample set; Step 2.2: For the dragon pullback pattern discovered in Step 2.1, match it based on the actual trend of its secondary start-up phase to form the label dataset required for training the graph convolutional network model; among them, the trend of the secondary start-up phase is divided into five types: unexpected pullback, expected pullback, upper half pullback, lower half pullback, and pullback failure. The formula for each pullback case is defined as follows: (1) Unexpected pullback: ; (2) Expected pullback: ; (3) Upper half pullback: ; (4) Lower half pullback: / 2; (5) Callback failed: ; in For the set of stocks within the research scope, for any stock , The maximum value of the highest price during the pullback period. The minimum value of the lowest price during the pullback period. The maximum value of the highest price during the second startup phase; Step 2.3: Based on the standardized definition rules of the dragon pullback pattern characteristics, and combined with the dragon pullback pattern identified in Step 2.1 and the corresponding market data during the pullback period, calculate and extract the quantitative characteristics of the dragon pullback pattern; Step 2.4: Perform matching and preprocessing operations on the data obtained in Steps 2.1, 2.2 and 2.3, including data consistency verification and missing data removal, to ensure the matching between the time dimension and the sample dimension and improve the effectiveness and usability of the dataset.
4. The method for matching the trend of a dragon pullback pattern based on causal analysis according to claim 3, characterized in that, The dragon pullback pattern described in step 2.1 is defined as follows: The upward phase requires the target stock to achieve a cumulative increase of 30% to 40% within 7 trading days, and the daily closing price should not show a downward trend, so as to ensure the continuity of the upward trend; when the stock price falls for two consecutive trading days, it marks the end of the upward phase and triggers the starting signal of the pullback phase. During the pullback phase, the stock price generally declines or fluctuates. The daily increase of the stock price should not exceed 1%, and there should be at least one trading day when the stock price falls, thus forming a valid pullback. Once the daily increase of the stock price exceeds 1%, the end signal of the pullback phase is immediately triggered, and a second start phase is initiated. If the pullback phase lasts less than 4 trading days, then this pullback is not considered a valid pattern. The second phase of the rally begins immediately after the end signal of the pullback is triggered, or it is automatically activated when the pullback lasts for more than 8 trading days. The retracement pattern is classified according to the strength of the stock's upward momentum during the second phase of the rally and the depth and duration of the pullback.
5. The method for matching the "dragon pullback" pattern trend based on causal analysis according to claim 3, characterized in that, The characteristics of the dragon pullback pattern described in step 2.3 include four dimensions: the degree of correlation between volume and price, market sentiment indicators, price volatility characteristics, and the correlation between technical indicators. Among them: Volume-price correlation: This measures the synergistic relationship between stock trading volume and price changes. In an uptrend, if trading volume increases in tandem with rising stock prices, it indicates high market participation and suggests the health and sustainability of the uptrend. Conversely, in a downtrend, if trading volume increases as stock prices fall, it suggests the downtrend may continue. Market sentiment indicators are used to quantify investors' psychological expectations and trading behavior tendencies, focusing on the price movement characteristics during the stock's upward phase and secondary launch phase. By capturing the rise and fall of stock prices in the market, a multi-dimensional sentiment measurement system is constructed to reflect the overall activity level and optimism of market sentiment. Price fluctuation characteristics: used to measure the pattern characteristics during the pullback of the dragon, and can depict the price evolution pattern of the pattern within a specific period; Technical indicator correlation: depicting the indicative role of golden crosses and death crosses in the trend evolution process; a golden cross is when the short-term technical indicator curve breaks through the long-term technical indicator curve from bottom to top, and this pattern is usually regarded as a signal that the price trend is turning from weak to strong; a death cross is when the short-term technical indicator curve crosses the long-term technical indicator curve from top to bottom, indicating that there is downward pressure on the price.
6. The method for matching the trend of a dragon pullback pattern based on causal analysis according to claim 1, characterized in that, Step 3 includes the following steps: Step 3.1: Based on the matching results of the dragon pullback pattern obtained in Step 2.2 and the dragon pullback pattern features obtained in Step 2.3, the PC causal discovery algorithm is used to analyze and explore the causal relationships between features and between features and the dragon pullback pattern. Step 3.2: Based on the causal relationship established in Step 3.1, perform Markov cover set calculation to obtain the causal relationships between features related to the Dragon Pullback pattern trend; Step 3.3: For the causal relationship generated in Step 3.2, the causal strength between the causal relationship and the trend of the Dragon Pullback pattern is quantified by calculating the interaction entropy. The interaction entropy calculation formula is shown below. ; Where X and Y are two random variables. and , This represents the joint probability distribution of x and y. This represents the probability of x.
7. The method for matching the trend of a dragon pullback pattern based on causal analysis according to claim 1, characterized in that, Step 4 specifically includes the following steps: Step 4.1: Based on the causal strength obtained in Step 3.3, construct a graph convolutional network model, set and optimize the hierarchical structure and hyperparameters of the model to adapt to the topological structure and data distribution characteristics of the dragon callback pattern. Step 4.2: Train the dragon pullback pattern trend matching model, minimize the matching error through iterative optimization algorithm, and terminate the training when the model training reaches the preset number of iterations, and finally generate a model that can be used for dragon pullback pattern trend matching.
8. A trend matching system based on causal analysis of dragon pullback patterns, characterized in that... This includes a front-end display module, a business logic module, and a data storage module; The front-end display module visualizes the results of pattern trend matching. The business logic module interacts with the front-end display module and the data storage module. It retrieves data from the data storage module, calls the trained model, and feeds the results back to the front-end display module. It includes a pattern recognition module, a causal analysis module, and a trend matching module; The morphology recognition module is responsible for historical morphology mining and morphological feature calculation; The causal analysis module is responsible for discovering causal graph relationships and calculating Markov processes; the trend matching module is responsible for training the trend matching model and calculating the matching results. The data storage module stores business logic module data in the database, providing data support.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program that, when executed by a processor, implements the method of any one of claims 1 to 7.
