K-line pattern recognition method and electronic device

By interacting with the network side through terminal devices or servers, the target pattern lines of candlestick charts are analyzed and drawn, solving the problem of limited reference value of existing candlestick charts and improving user experience and recognition accuracy.

CN114008658BActive Publication Date: 2026-03-31FUTU NETWORK TECH (SHENZHEN) CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-30
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

The existing candlestick charts only provide users with simple visual information segmentation functions, and the line drawing function only supports connecting two points, which has limited reference value and a poor user experience.

Method used

By interacting with the network side through terminal devices or servers, the system analyzes candlestick data over a certain period of time, identifies target patterns, and draws target pattern lines on the candlestick chart. Combined with key candlesticks, it helps users intuitively understand candlestick patterns.

Benefits of technology

It improves the reference value and user experience of candlestick charts, reduces computational complexity through hierarchical processing at the algorithm level, increases the accuracy and flexibility of recognition, allows users to customize time windows, generate similarity scores for multiple pattern matching, and adjust weights based on user feedback.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114008658B_ABST
    Figure CN114008658B_ABST
Patent Text Reader

Abstract

The application provides a K-line pattern recognition method and an electronic device, relates to the technical field of computers, and can solve the problem that the existing K-line chart is relatively single and the user experience is poor to a certain extent. The method comprises the following steps: a terminal device acquires N1 K-line data of a first stock within a first time window; the terminal device can acquire a first target pattern corresponding to the N1 K-line data and x key K-lines in the N1 K-line data, the first target pattern is used to indicate the K-line pattern of the N1 K-line data, and x is less than or equal to N1; the terminal device displays N1 K-lines corresponding to the N1 K-line data; and the terminal device can draw a first target pattern line on the N1 K-lines according to the first target pattern and the x key K-lines.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method and electronic device for recognizing candlestick patterns. Background Technology

[0002] In the financial field, stock candlestick charts (or K-lines) reflect stock price changes over a period of time. Currently, stock trading software can push candlestick charts to users based on stock price data at various points in time, allowing users to easily understand opening prices, highest prices, lowest prices, and other price information in the stock and futures markets. However, these candlestick charts are merely simple lists of information. As time accumulates and the number of stocks increases, users find it difficult to make decisions when faced with a large number of candlestick charts, reducing the reference value of the charts and resulting in a poor user experience.

[0003] In other words, the existing candlestick charts simply display stock price data at various points in time, and the drawing function only supports connecting two points, which has limited reference value and a poor user experience. Summary of the Invention

[0004] This application provides a method and electronic device for recognizing candlestick patterns, which can solve to some extent the problems of existing candlestick charts being relatively simple, that is, only providing users with simple visual information division functions, and the line drawing function only supporting the connection between two points, which has limited reference value and poor user experience.

[0005] Firstly, a method for identifying candlestick patterns is provided, including:

[0006] The terminal device acquires N1 candlestick data points of the first stock within a first time window, where N1 is an integer greater than 1; and the terminal device can acquire a first target pattern corresponding to the aforementioned N1 candlestick data points and x key candlesticks from these N1 candlestick data points. The first target pattern is used to indicate the candlestick pattern of the N1 candlestick data points, where x ≤ N1; the terminal device displays the N1 candlesticks corresponding to the N1 candlestick data points; and the terminal device can draw a first target pattern line on the N1 candlesticks according to the first target pattern and x key candlesticks.

[0007] Secondly, a method for identifying candlestick patterns is provided, including:

[0008] The server acquires N1 candlestick data points for the first stock within a first time window, where N1 is an integer greater than 1. Then, the server analyzes the corresponding first target pattern and x key candlesticks within the N1 candlestick data based on this N1 data point. The first target pattern indicates the candlestick pattern of the N1 candlestick data points, where x ≤ N1. Subsequently, the server sends the N1 candlestick data points, the first target pattern, and the identifiers of the x key candlesticks to the terminal device.

[0009] Thirdly, a terminal device is provided, comprising:

[0010] The acquisition unit is used to: acquire N1 candlestick data points of the first stock within a first time window, where N1 is an integer greater than 1; acquire the first target pattern corresponding to the aforementioned N1 candlestick data points, and x key candlesticks from the aforementioned and N1 candlestick data points, where the first target pattern is used to indicate the candlestick pattern of the N1 candlestick data points, and x ≤ N1; the display unit is used to: display the N1 candlestick data points corresponding to the aforementioned N1 candlestick data points; and draw the first target pattern line on the N1 candlestick data points according to the first target pattern and the x key candlesticks.

[0011] Fourthly, a server is provided, comprising:

[0012] The acquisition unit is used to: acquire N1 candlestick data points of the first stock within a first time window, where N1 is an integer greater than 1; the analysis unit is used to: analyze the corresponding first target pattern and x key candlesticks in the N1 candlestick data based on the aforementioned N1 candlestick data, where the first target pattern is used to indicate the candlestick pattern of the N1 candlestick data, and x ≤ N1; the communication unit is used to: send the aforementioned N1 candlestick data, the first target pattern, and the identifiers of the x key candlesticks to the terminal device.

[0013] Fifthly, a terminal device is provided, comprising: a processor and a memory for storing a computer program, the processor for calling and running the computer program stored in the memory, and performing the methods as described in the first aspect or its various implementations.

[0014] A sixth aspect provides a server comprising: a processor and a memory for storing computer programs, the processor for calling and running the computer programs stored in the memory, and performing methods as described in the second aspect or its various implementations.

[0015] In a seventh aspect, a computer-readable storage medium is provided for storing a computer program that causes a computer to perform the methods described in the first aspect, the second aspect, or various implementations thereof.

[0016] Eighthly, a computer program product is provided, including computer program instructions that cause a computer to perform the methods as described in the first aspect, the second aspect, or various implementations thereof.

[0017] Ninth aspect, a computer program is provided that causes a computer to perform the methods as described in the first aspect, the second aspect, or various implementations thereof.

[0018] The embodiments of the present invention have the following technical effects:

[0019] 1) The algorithm is processed in a hierarchical manner, which reduces the computational complexity while ensuring a large number of candlestick pattern models, resulting in shorter computation time and higher accuracy.

[0020] 2) Allows users to select a suitable time window to judge the candlestick pattern, which is highly flexible. At the same time, the model is more accurate because it incorporates the time dimension.

[0021] 3) It can more effectively identify the outline of the K-line, effectively combining the K-line and visual recognition, which is more in line with the user's visual experience.

[0022] 4) It can generate similarity scores for multiple morphological matching, and the identified results are more similar than existing solutions. It can also adjust the matching weight of similarity scores based on user feedback to optimize the matching results.

[0023] 5) When a user clicks on a target pattern line through a terminal device, detailed information and prompts for the corresponding target pattern line will pop up, significantly improving the user experience and enhancing the reference value of the candlestick chart.

[0024] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description

[0025] Figure 1 A schematic diagram illustrating an application scenario for the candlestick pattern recognition method provided in this application;

[0026] Figure 2 An interactive schematic diagram illustrating a candlestick pattern recognition method provided in this application;

[0027] Figure 3 A schematic diagram illustrating an application scenario for another candlestick pattern recognition method provided in this application embodiment;

[0028] Figure 4 A schematic diagram illustrating an application scenario for another candlestick pattern recognition method provided in this application embodiment;

[0029] Figure 5 A flowchart illustrating a candlestick pattern recognition method provided in this application embodiment;

[0030] Figure 6 A schematic diagram illustrating an application scenario for another candlestick pattern recognition method provided in this application embodiment;

[0031] Figure 7 A schematic diagram illustrating an application scenario for another candlestick pattern recognition method provided in this application embodiment;

[0032] Figure 8An interactive schematic diagram illustrating another candlestick pattern recognition method provided in this application embodiment;

[0033] Figure 9 A schematic diagram illustrating an application scenario for another candlestick pattern recognition method provided in this application embodiment;

[0034] Figure 10 A schematic diagram illustrating an application scenario for another candlestick pattern recognition method provided in this application embodiment;

[0035] Figure 11 A schematic block diagram of a terminal device according to an embodiment of this application is shown;

[0036] Figure 12 A schematic block diagram of a server according to an embodiment of this application is shown;

[0037] Figure 13 A schematic block diagram of another terminal device according to an embodiment of this application is shown;

[0038] Figure 14 A schematic block diagram of another server according to an embodiment of this application is shown. Detailed Implementation

[0039] The technical solutions of the embodiments of this application will now be described with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art without creative effort regarding the embodiments of this application are within the scope of protection of this application.

[0040] The following explains several concepts that will be involved in the embodiments of this application:

[0041] A candlestick chart (K-line) is a bar-shaped line composed of shadows and a body, used to reflect changes in stock prices over a period of time. The shadows represent the highest and lowest prices of the day, while the body represents the opening and closing prices.

[0042] Candlestick charts can be categorized based on their calculation period, such as daily, weekly, monthly, and yearly charts. For example, a weekly candlestick chart is drawn using Monday's opening price, Friday's closing price, the week's highest price, and the week's lowest price. Similarly, a daily candlestick chart is drawn using the day's opening price, closing price, the day's highest price, and the day's lowest price.

[0043] Candlestick patterns (or candlestick combinations) refer to the price action of candlesticks (such as daily candlesticks) over a specific period. Examples of candlestick patterns include the Three White Soldiers, rounding bottom, V-shaped bottom, reversal doji, and W-shaped bottom. Candlestick patterns are an important reference for determining market trends and direction.

[0044] Currently, stock trading software can display candlestick charts for a particular stock on electronic devices, such as 100 daily candlesticks from the last 100 days or 10 weekly candlesticks from the last 10 weeks. However, users need to interpret the candlestick patterns themselves to make buy or sell decisions. For most users with limited financial knowledge, making decisions when faced with a large number of candlestick charts is difficult, reducing the reference value of the charts and resulting in a poor user experience.

[0045] The inventive concept of this application is as follows: When an electronic device needs to display N (N is an integer greater than 1) candlesticks within a certain time period, the electronic device can interact with a server on the network side to trigger the server to analyze the target pattern of the aforementioned N candlesticks. Subsequently, as... Figure 1 As shown, when the electronic device displays the above N K-lines, the server can instruct the electronic device to draw the corresponding target pattern line 101 on the displayed N K-lines according to the above target pattern, so that users can intuitively and accurately understand the current K-line pattern, facilitate user decision-making, improve user experience and the reference value of K-lines.

[0046] The candlestick pattern recognition method provided in this application can be applied to electronic devices and / or servers. The electronic device can be any terminal device, such as a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, etc., but is not limited thereto. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The terminal and server can be directly or indirectly connected via wired or wireless communication. When the electronic device is a server, it can receive user operations and generate instructions through the connected terminal, and then the server executes data processing according to the terminal's instructions. This application does not impose any limitations on this.

[0047] The technical solutions of the embodiments of this application will be described in detail below:

[0048] Figure 2 This is an interactive schematic diagram illustrating a candlestick pattern recognition method provided in an embodiment of this application. For example... Figure 2 As shown, the method includes:

[0049] S201, The terminal device receives the first instruction to open the K-line chart of stock A.

[0050] For example, stock trading software (or applications) can be installed on a terminal device. When the terminal device is running the stock trading software, it may receive an instruction to open the candlestick chart of a specific stock (i.e., the first instruction).

[0051] For example, such as Figure 3 As shown, when the terminal device is running stock trading software, it can display a list 301 containing multiple stocks. When it detects that a user has opened a stock (e.g., stock A), the terminal device can generate a first instruction to instruct the user to open the candlestick chart of stock A.

[0052] Alternatively, stock trading software can periodically push candlestick charts of one or more stocks to the terminal device. For example, when stock A closes for the day, the server can send a first instruction to the terminal device, instructing it to open the candlestick chart of stock A.

[0053] In other words, the scenario in which a terminal device opens the candlestick chart of a certain stock can be triggered in response to a specific input operation by the user, in response to a specific input from the server, or automatically by the terminal device. This application embodiment does not impose any restrictions on this.

[0054] S202. In response to the aforementioned first instruction, the terminal device sends a first request to the server. The first request includes the identifier of stock A and a first time window.

[0055] Taking opening the candlestick chart of stock A as an example, after the terminal device receives the first instruction to open the candlestick chart of stock A, it can determine the time period of the candlestick chart to be displayed, i.e., the first time window. For example, if the candlestick chart of the most recent 30 days needs to be displayed, the first time window is 30 days. Or, if the candlestick chart of the most recent 60 days needs to be displayed, the first time window is 60 days.

[0056] For example, when a terminal device opens the candlestick chart of stock A for the first time, it can request the server to display the candlestick chart of stock A within the first time window (e.g., the most recent 100 days) according to the default first time window.

[0057] Once the terminal device determines the first time window, it can send the first time window and the identifier of stock A in the first request to the server to request the server to display the candlestick chart of stock A within the first time window.

[0058] Optionally, the terminal device may also carry the type of candlestick chart to be displayed in the first request, such as daily candlestick chart, weekly candlestick chart, etc.

[0059] S203. The server retrieves N1 candlestick data points for stock A within the first time window, where N1 is an integer greater than 1.

[0060] After receiving the first request from the terminal device, the server, knowing that the request contains the identifier of stock A and the first time window, can retrieve N1 candlestick data points within that first time window based on the identifier of stock A. Taking a daily candlestick chart as an example, each candlestick data point can include the opening price, closing price, highest price, and lowest price of the day. These N1 candlestick data points can be used by the terminal device to draw the corresponding candlestick chart based on each candlestick data point.

[0061] S204. The server analyzes the target pattern corresponding to the above N1 K-line data and the x key K-lines in the above N1 K-line data, where x < N1.

[0062] In this embodiment, after receiving the first request from the terminal device, the server, in addition to obtaining N1 candlestick data points for stock A within the first time window, can also determine the target pattern corresponding to these N1 candlestick data points, such as a W pattern or a rounded bottom pattern. Simultaneously, the server can also determine x key candlesticks among the aforementioned N1 candlestick data points that correspond to the target pattern, and the connection of these x key candlesticks can present the aforementioned target pattern.

[0063] For example, the server can first extract a (where a is an integer greater than 1) inflection point data from the aforementioned N1 candlestick data, namely, candlestick data with higher stock prices and candlestick data with lower stock prices within the first time window. Here, stock price can refer to the opening price, closing price, highest price, or lowest price.

[0064] refer to Figure 4 This illustrates the N1 candlestick charts corresponding to the N1 candlestick data within the first time window. Each candlestick chart can be represented by its corresponding time and stock price. For example, candlestick charts... Figure 1 = (Time 1, Stock Price 1). The server can identify various candlestick charts in chronological order. When it identifies a candlestick where the stock price changes from high to low or from low to high, the server can determine that candlestick as an inflection point. The corresponding inflection point data includes the time indicated by the candlestick and the stock price. For example... Figure 4 As shown, the server can identify 9 inflection points in the above N1 candlestick chart using the above method, corresponding to the inflection point data of the 9 candlesticks.

[0065] Since stock prices may fluctuate frequently over time and the magnitude of the fluctuations may vary, and inflection points with small fluctuations (i.e., differences λ) have little impact on the stock price trend over a period of time, in some embodiments of this application, when the server extracts each inflection point in the N1 K-line charts within the first time window, inflection point data with differences λ less than the difference threshold S can be ignored.

[0066] For example, when the difference λ of the stock price of a certain K-line is identified as greater than the difference threshold S designed by the system, the server can determine that K-line as an inflection point; otherwise, the server will not determine that K-line as an inflection point.

[0067] The calculation method for the difference λ is as follows:

[0068]

[0069] p is the maximum percentage distance threshold, i ranges from 2 to N1-1, and v0 is the distance threshold. i For the stock price sequence corresponding to the first time window, the value of z is calculated as follows:

[0070] Initialize z to the candlestick data corresponding to the earliest time in the first time window, whenever λ i When a turning point is identified, z is updated to the K-line data corresponding to the aforementioned turning point; that is, z is the K-line data corresponding to the latest generated turning point.

[0071] Furthermore, experimental data shows that the accuracy is higher when the value of p is above 15%, with the optimal value being 27%.

[0072] The threshold S in the system design ranges from z to z. 2 Between, where the preferred value is (z^2-z) / 2, that is, the difference threshold S changes with the value of z.

[0073] For example, the a inflection point data identified by the server can be denoted as t represents the position of the inflection point in N1 K-lines, that is, the t-th K-line at a certain time, and v represents the stock price corresponding to the inflection point.

[0074] Furthermore, the server can determine the target pattern corresponding to the aforementioned N1 candlestick data based on the identified 'a' inflection point data. For example, the server can pre-store different candlestick pattern models, such as a W-pattern model, a rounded bottom pattern model, a reversal doji pattern model, etc. For instance, any candlestick pattern model can be denoted as... This candlestick pattern model includes inflection points (b), and each inflection point can also be represented by the corresponding time and stock price.

[0075] Therefore, the server can calculate the similarity between the identified 'a' inflection point data and different candlestick pattern models, that is, calculate V. p1 With different Y p2 The similarity between them. Then, the server can determine the candlestick pattern corresponding to the candlestick pattern model with the highest similarity as the target pattern of the above N1 candlestick data.

[0076] For example, Figure 5Shows a method for calculating the similarity between V p1 and the K-line pattern model Y p2 , including the following steps:

[0077] 1) Input a inflection point data (i.e., V p1 ) and the first K-line pattern model Y p2 ;

[0078] 2) If a < b, it means that the number of inflection points in the current N1 K-line data does not meet the requirements for the number of inflection points in the first K-line pattern model, then directly output non-conformity, that is, the similarity is 0;

[0079] If a ≥ b, then judge whether the types (rising or falling) of the last inflection points in V p1 and Y p2 are the same.

[0080] If they are not the same, it means that the trend of the current N1 K-line data does not match the trend of the first K-line pattern model, then directly output non-conformity, that is, the similarity is 0. Correspondingly, if they are the same, proceed to the next step;

[0081] 3) Clean the a inflection point data (i.e., V p1 ) based on time, and generate the first cleaning result V p2 .

[0082] Specifically, in this embodiment, when performing the first cleaning, the time period can be calculated first based on the total duration of the K-line market, and the a inflection point data V p1 is sampled based on the time period to obtain a(1) sampling data as the first cleaning result V p2 , where a(1) ≤ a. Specifically, the time period in this embodiment can be calculated based on the total duration corresponding to the entire K-line market data. For example, it can be calculated through the following formula:

[0083] sam = e -η ·log2T_dur

[0084] where η represents a preset time factor and η > 1, and T_dur represents the total duration of the market data, and its unit can be days, hours, or minutes, etc., which is specifically determined according to the market data.

[0085] 4) Clean the first cleaning result V p2 based on the penalty factor, and generate the second cleaning result V p3 .

[0086] Specifically, a penalty distance threshold and a penalty factor are preset. Each calculated penalty distance is compared with the penalty threshold. If the penalty distance Dis_pen is greater than the penalty threshold Thr_pen, the corresponding penalty distance is multiplied by the penalty factor Fac_pen. The original market data is then updated based on the adjusted penalty distance to obtain a(2) sampled data, which serve as the second cleaning result V. p3 , a(2)≤a(1).

[0087] In this embodiment, the penalty distance Dis_pen can be the first cleaning result V. p2 The price difference between adjacent time periods. The second cleansing result V is generated by cleaning the first cleansing result using the following formula. p3 :

[0088]

[0089] 5) Weighting the second cleaning result V p3 Perform cleaning and generate a third cleaning result V. p4 .

[0090] Specifically, in this embodiment, the second cleaning result V is weighted based on a preset weight. p3 Perform cleaning, that is, in the second cleaning result V p3 In the process, values ​​greater than or equal to the preset weight are retained, and data less than the preset weight are deleted, resulting in the final a(3) inflection point data, which is the third cleaning result V. p4 ={(t1) p4 v1 p4 ),(t2 p4 v2 p4 ),…,(t x p4 ,v x p4 )}.

[0091] Thus, through steps 2)-5), the server can filter unsuitable candlestick pattern models and inaccurate inflection points based on one or more of the following: number of inflection points, inflection point type, time, penalty factor, or weight, to obtain x inflection point data that more accurately reflects the candlestick pattern. Subsequently, the server can calculate the similarity between these x inflection point data and other filtered candlestick pattern models (step 6), thereby ensuring reduced computational complexity and implementation difficulty while maintaining a large number of candlestick pattern models, resulting in shorter computation time and higher accuracy.

[0092] 6) Calculate the preset candlestick pattern model Y using the following formula. p2 The third cleaning result V obtained in step 5) p4 Similarity between them:

[0093]

[0094] The server calculates V using the method described above. p4 The a(3) inflection point data and different K-line pattern models Y p2 After determining the similarity between them, the candlestick pattern model with the highest similarity can be identified and determined as the target pattern of the aforementioned N1 candlestick data. For example, when V p4 When the similarity with the candlestick pattern model of the W pattern is the highest, the server can determine that the target pattern of the N1 candlestick data to be displayed is the W pattern.

[0095] Furthermore, after the server determines the K-line pattern model with the highest similarity according to the above method, it can also obtain the corresponding x inflection point data, x is less than or equal to a(3). These x inflection point data can be used as part or all of the key K-lines in the above N1 K-line data. The connection of the key K-lines can present the above target pattern.

[0096] It is understandable that those skilled in the art can also use other methods to calculate V according to the actual application scenario or actual needs. p1 With different candlestick pattern models Y p2 The similarity between them is not limited in this application embodiment.

[0097] S205. The server sends the above N1 K-line data, target pattern, and x key K-line identifiers to the terminal device.

[0098] In some embodiments, the server may notify the terminal device of x candlesticks from the N1 candlestick data that correspond one-to-one with the x inflection point data as key candlesticks. In this way, the terminal device can connect these x candlesticks to display the corresponding candlestick target pattern.

[0099] In other embodiments, in addition to the x K-lines corresponding one-to-one with the aforementioned x inflection point data, the server can also notify the terminal device of a(3) inflection point data among the aforementioned N1 K-lines as key K-lines, and can also notify the terminal device of one or more other K-lines as key K-lines. For example, the aforementioned x K-lines can be 5 inflection points in the W-shaped K-line pattern. In addition, the server can also notify the terminal device of one or more other K-lines among the aforementioned N1 K-lines that pass through the W-shaped K-line pattern as key K-lines.

[0100] Understandably, the more key candlesticks a terminal device obtains, the more accurate the target pattern line drawn by connecting these key candlesticks will be. For example, when the target pattern line is a curve, the accuracy of the target pattern line drawn by the terminal device based on 10 key candlesticks will generally be higher than the accuracy of the target pattern line drawn by the terminal device based on 5 key candlesticks.

[0101] In step S205, the server can send the N1 K-line data obtained from step S203, as well as the target pattern and the identifiers of x key K-lines obtained from step S204, to the terminal device.

[0102] For example, the server can send the aforementioned N1 candlestick data, target pattern, and x key candlestick identifiers to the terminal device together. Alternatively, the server can send the aforementioned N1 candlestick data to the terminal device first after step S203, and then send the obtained target pattern and x key candlestick identifiers to the terminal device after step S204. This application embodiment does not impose any limitations on this.

[0103] S206. The terminal device displays the corresponding N1 K-lines based on the above N1 K-lines data.

[0104] Specifically, after receiving N1 candlestick data from the server, the terminal device can display the corresponding N1 candlesticks according to these N1 candlestick data.

[0105] S207. The terminal device draws the first target shape line on the above N1 K-lines according to the above target shape and x key K-lines.

[0106] Specifically, in addition to displaying the N1 K-lines within the first time window of stock A through step S206, the terminal device can also draw a first target pattern line on the aforementioned N1 K-lines according to the target pattern and x key K-lines sent by the server. For example... Figure 6 As shown, the terminal device can display N1 K-lines of stock A within the first time window on the stock software's display interface. Furthermore, when the target pattern is a W pattern, the terminal can sequentially connect the acquired x key K-lines according to the W pattern to draw the first target pattern line 601.

[0107] In this way, when displaying N1 candlesticks of a stock, the terminal device can show the user the candlestick pattern of these N1 candlesticks through the first target pattern line, thereby helping the user to more effectively identify the candlestick outline, effectively combining candlesticks and visual recognition, and improving the user's visual experience.

[0108] It should be noted that the terminal device can display the above-mentioned N1 K-lines and the first target pattern line at the same time, or it can display the above-mentioned N1 K-lines first, and then display the first target pattern line on these N1 K-lines. This application embodiment does not impose any restrictions on this.

[0109] S208. When the terminal device detects that the user touches the first target shape line, the terminal device displays detailed data corresponding to the first target shape line.

[0110] Still with Figure 6 As shown in the example of the first target pattern line 601, after the terminal device displays the first target pattern line 601 on the N1 K-line of stock A, the user can also perform touch operations on the first target pattern line 601, such as a single click or double click. When the terminal device detects that the user has touched the first target pattern line 601, such as... Figure 7 As shown, the terminal device can display detailed data 701 corresponding to the first target shape line 601.

[0111] For example, the detailed data 701 corresponding to the first target pattern line 601 may include pattern interpretation 702, historical backtesting 703, disclaimer 704, and further guidance 705.

[0112] For example, a pattern interpretation 701 (e.g., the next three days) may include: start time, pattern type, probability of rising (or probability of falling if it is a bearish pattern), resistance level (format: price (change / decrease)), support level (format: price (change / decrease)), reversal probability, and other information.

[0113] For example, historical backtesting data (703) may include information such as the number of occurrences, probability of profit, profit target (percentage), and stop-loss point (percentage). Generally, historical backtesting data is based on backtesting of the current target pattern (i.e., the first target pattern) over a period of X years.

[0114] The timing for displaying the reversal probability (server-side logic, terminal controls whether to display based on server-side instructions): In an uptrend, when the reversal value is less than or equal to "-5", the server can send a high reversal probability field, and the terminal device will display "High reversal probability" when the reversal probability is high; In a downtrend, when the reversal value is greater than or equal to "+5", the server sends a high reversal probability field, and the terminal device will display "High reversal probability" when the reversal probability is high; In addition, the pattern category, resistance level, support level, profit-taking point, and stop-loss point can support rising and falling colors, following the user's rising and falling colors.

[0115] In this way, when the terminal device detects that the user touches the first target pattern line, it will display the corresponding detailed data, thereby improving the user experience and enhancing the reference value of the candlestick chart.

[0116] In other embodiments, the first target shape line displayed by the terminal device may be a curve. In this scenario, the terminal device can identify whether the user has touched the first target shape line through the following methods.

[0117] Specifically, the terminal device can use hash sampling data points to calculate the distance between the user's touch position on the screen and the first target shape line.

[0118] For example, by selecting a starting point, an ending point, and a control point, a second-order Bézier curve is generated according to the formula of the second-order Bézier curve. On this second-order Bézier curve, N sampling points can be evenly distributed. That is, judging the shortest distance from a point P to a certain second-order Bézier curve can be approximately converted into the shortest distance from an average of N points to point P. Therefore, judging whether a touch point is on a second-order Bézier curve can be converted into whether the minimum distance from a point to N points scattered on the second-order Bézier curve meets the preset distance.

[0119] Additionally, the distance from the trigger position to the line: Use the formula for the distance from a point to a line to determine if the touch point is within the response area: Let the equation of line L be Dx + Ey + F = 0, and the coordinates of point P be (X0, Y0). Then the distance from point P to line L is:

[0120]

[0121] Where D, E, and F are constants that constitute the equation of any straight line.

[0122] In this embodiment of the invention, after the terminal device obtains the distance value d between the touch position and the first target shape line of the curve type, it can compare the distance value d with a preset distance to obtain a comparison result. If the comparison result is that d is greater than the preset distance, it means that the user has not touched the first target shape line, and the terminal does not respond. If the comparison result is that d is less than or equal to the preset distance, it means that the user has touched the first target shape line, and the terminal device can display detailed data corresponding to the first target shape line according to the above method.

[0123] In other words, when the target pattern line displayed on the K-line by the terminal device is a curve, it can accurately detect whether the user has touched the target pattern line, thereby triggering the terminal device to display detailed data corresponding to the target pattern line, thus improving the user experience.

[0124] In some embodiments, users can select a suitable time window to judge the candlestick pattern, offering high flexibility. Furthermore, the addition of a time dimension to the model improves accuracy. In this case, such as... Figure 8 As shown, terminal devices and services can also perform the following steps:

[0125] S801, The terminal device obtains the second instruction from the user to change the first time window of stock A to the second time window.

[0126] Taking the display of a candlestick chart of stock A on a terminal device as an example, such as Figure 9 As shown, users can manually modify the size of the time window on the candlestick chart of stock A. For example, users can change the size of the time window by entering a pinch or spread gesture with two fingers. For instance, when the terminal device first displays the candlestick chart of stock A, it can default to displaying N1 candlesticks within the first time window (e.g., the most recent 100 days). If the terminal device detects that the user has entered a pinch gesture with two fingers on the aforementioned N1 candlesticks, it can generate a second instruction to modify the first time window to a second time window (e.g., the most recent 30 days).

[0127] S802. In response to the aforementioned second instruction, the terminal device sends a second request to the server. The second request includes the identifier of stock A and a second time window.

[0128] The process of the terminal device sending the second request to the server is similar to the process of the terminal device sending the first request to the server in step S202, so it will not be described again here.

[0129] S803: The server retrieves N2 candlestick data points for stock A within the second time window, where N2 is an integer greater than 1.

[0130] The process by which the server obtains the N2 K-line data of stock A within the second time window is similar to the process by which the server obtains the N1 K-line data of stock A within the first time window in step S203, so it will not be described again here.

[0131] S804. The server analyzes the target pattern corresponding to the above N2 K-line data and the y key K-lines in the above N2 K-line data, where y < N2.

[0132] The process by which the server analyzes the target pattern corresponding to the aforementioned N2 candlestick data and the y key candlesticks in the aforementioned N2 candlestick data is similar to the process by which the server analyzes the target pattern corresponding to the aforementioned N1 candlestick data and the x key candlesticks in the aforementioned N1 candlestick data in step S204, so it will not be described again here.

[0133] S805, the server sends the above N2 candlestick data, target pattern, and the identifiers of the y key candlesticks to the terminal device.

[0134] The process by which the server sends the aforementioned N2 candlestick data, target pattern, and M2 key candlestick identifiers to the terminal device is similar to the process in step S205 where the server sends the aforementioned N1 candlestick data, target pattern, and y key candlestick identifiers to the terminal device, so it will not be described again here.

[0135] S806, The terminal device displays the corresponding N2 K-lines based on the above N2 K-lines data.

[0136] The process by which the terminal device displays the corresponding N2 K-lines based on the above N2 K-lines is similar to the process by which the terminal device displays the N1 K-lines in step S206, so it will not be described again here.

[0137] S807. The terminal device draws the second target shape line on the above N2 K-lines according to the above target shape and the M2 key K-lines.

[0138] Similar to step S207 above, such as Figure 10 As shown, the terminal device can display N2 candlesticks of stock A within the second time window on the stock software's display interface. Furthermore, the terminal can sequentially connect the x key candlesticks obtained according to the target pattern sent by the server to draw the second target pattern line 1001.

[0139] In this way, users can set a suitable time window according to their own needs, triggering the terminal device to display the candlestick patterns of multiple candlesticks in the corresponding time window, thereby helping users to more effectively identify the candlestick outline, effectively combining candlesticks and visual recognition, and improving the user's visual experience.

[0140] Of course, after the terminal device draws the second target shape line according to the above method, if it detects that the user touches the second target shape line, the terminal device can also display detailed data corresponding to the second target shape line according to the above step S208. This application embodiment does not impose any restrictions on this.

[0141] Furthermore, the above embodiments use the display of the K-line and target pattern line of stock A on a terminal device as an example. It can be understood that when the terminal device displays the K-line of one or more other stocks, it can also display the corresponding target pattern line in the same way, thereby helping users to more effectively identify the K-line outline.

[0142] The above text combined Figures 1 to 10 The method embodiments of this application are described in detail below, in conjunction with... Figures 11 to 14 The present application describes the device embodiments in detail. It should be understood that the device embodiments correspond to the method embodiments, and similar descriptions can be referred to the method embodiments.

[0143] Figure 11 A schematic block diagram of a terminal device according to an embodiment of this application is shown. Figure 11 As shown, the terminal device includes:

[0144] The acquisition unit 1101 is used to acquire N1 K-line data of the first stock within a first time window, where N1 is an integer greater than 1; and to acquire a first target pattern corresponding to the N1 K-line data and x key K-lines in the N1 K-line data, where the first target pattern is used to indicate the K-line pattern of the N1 K-line data, and x≤N1;

[0145] Display unit 1102 is used to display N1 K-lines corresponding to the N1 K-line data; and to draw a first target shape line on the N1 K-lines according to the first target shape and the x key K-lines.

[0146] In some embodiments, the acquisition unit 1101 is further configured to receive a touch operation by a user touching the first target shape line;

[0147] The display unit 1102 is further configured to respond to the touch operation by displaying first detailed data corresponding to the first target shape line, the first detailed data including shape interpretation data and historical backtesting data of the first target shape line.

[0148] In some embodiments, the acquisition unit 1101 is specifically used to calculate the distance between the touch point and the first target shape line after detecting a touch point input by the user; if the distance between the touch point and the first target shape line is less than or equal to a preset distance, then it is determined that a touch operation of the user touching the first target shape line has been received.

[0149] In some embodiments, the display unit 1102 is specifically used to connect the x key K-lines according to the first target shape to obtain the first target shape line.

[0150] In some embodiments, the acquisition unit 1101 is specifically used to acquire N1 K-line data of the first stock within a first time window in response to the user's operation of opening the first stock.

[0151] In some embodiments, the acquisition unit 1101 is further configured to detect that the user has adjusted the first time window to a second time window; acquire N2 K-line data of the first stock within the second time window, where N2 is an integer greater than 1; acquire a second target pattern corresponding to the N2 K-line data and y key K-lines in the N2 K-line data, where the second target pattern is used to indicate the K-line pattern of the N2 K-line data, and y≤N1;

[0152] The display unit 1102 is also used to display N2 K-lines corresponding to the N2 K-line data; and to draw a second target shape line on the N2 K-lines according to the second target shape and the y key K-lines.

[0153] Figure 12 A schematic block diagram of a server according to an embodiment of this application is shown. Figure 12 As shown, the server includes:

[0154] Acquisition unit 1201 is used to: acquire N1 K-line data of the first stock within the first time window, where N1 is an integer greater than 1;

[0155] Analysis unit 1202 is used to: analyze the corresponding first target pattern and x key K-lines in the N1 K-line data based on the N1 K-line data, wherein the first target pattern is used to indicate the K-line pattern of the N1 K-line data, and x≤N1;

[0156] The communication unit 1203 is used to send the N1 K-line data, the first target pattern, and the identifiers of the x key K-lines to the terminal device.

[0157] In some embodiments, the analysis unit 1202 is specifically used to: extract a inflection points of the stock price from the N1 K-line data, where a is an integer greater than 0; calculate the similarity between the a inflection points and different K-line pattern models; and determine the K-line pattern of the K-line pattern model with the highest similarity as the first target pattern.

[0158] In some embodiments, the analysis unit 1202 is specifically used to: filter the a inflection points to obtain x inflection points after filtering, where x ≤ a; and calculate the similarity between the x inflection points and different K-line pattern models according to a preset similarity formula.

[0159] In some embodiments, the analysis unit 1202 is specifically used to: filter the a inflection points based on one or more of the following: number of inflection points, inflection point type, time, penalty factor, or weight.

[0160] In some embodiments, the communication unit 1203 is further configured to: acquire a first request sent by the terminal device, the first request including the identifier of the first stock and the first time window.

[0161] In some embodiments, the communication unit 1203 is further configured to: acquire a second request sent by the terminal device, the second request including the identifier of the first stock and a second time window;

[0162] The acquisition unit 1201 is also used to: acquire N2 K-line data of the second stock within the second time window, where N2 is an integer greater than 1;

[0163] The analysis unit 1202 is further configured to: analyze the corresponding second target pattern and y key K-lines in the N2 K-line data based on the N2 K-line data, wherein the first target pattern is used to indicate the K-line pattern of the N2 K-line data, and y≤N1;

[0164] The communication unit 1203 is also used to send the N2 K-line data, the second target pattern, and the identifiers of the y key K-lines to the terminal device.

[0165] The terminal devices and servers provided in the above embodiments can execute the technical solutions of the above method embodiments. Their implementation principles and technical effects are similar, and will not be repeated here.

[0166] Figure 13 This is a schematic structural diagram of a terminal device provided in an embodiment of this application. Figure 13 The terminal device shown includes a processor 1310, which can call and run computer programs from memory to implement the methods in the embodiments of this application.

[0167] Optionally, such as Figure 13 As shown, the terminal device may further include a memory 1320. The processor 1310 can retrieve and run computer programs from the memory 1320 to implement the methods described in this embodiment.

[0168] The memory 1320 can be a separate device independent of the processor 1310, or it can be integrated into the processor 1310.

[0169] Optionally, such as Figure 13 As shown, the terminal device may also include a transceiver 1330, and the processor 1310 can control the transceiver 1330 to communicate with other devices. Specifically, it can send information or data to other devices or receive information or data sent by other devices.

[0170] The transceiver 1330 may include a transmitter and a receiver. The transceiver 1330 may further include an antenna, and the number of antennas may be one or more.

[0171] Figure 14 This is a schematic structural diagram of a server provided for an embodiment of this application. Figure 14 The server shown includes a processor 1410, which can call and run computer programs from memory to implement the methods in the embodiments of this application.

[0172] Optionally, such as Figure 14As shown, the server may further include a memory 1420. The processor 1410 can retrieve and run computer programs from the memory 1420 to implement the methods described in this embodiment.

[0173] The memory 1420 can be a separate device independent of the processor 1410, or it can be integrated into the processor 1410.

[0174] Optionally, such as Figure 14 As shown, the server may also include a transceiver 1430, and the processor 1410 may control the transceiver 1430 to communicate with other devices. Specifically, it may send information or data to other devices or receive information or data sent by other devices.

[0175] The transceiver 1430 may include a transmitter and a receiver. The transceiver 1430 may further include an antenna, and the number of antennas may be one or more.

[0176] The terminal devices and servers provided in the above embodiments can execute the technical solutions of the above method embodiments. Their implementation principles and technical effects are similar, and will not be repeated here.

[0177] It should be understood that the processor in the embodiments of this application may be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the above method embodiments can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor described above can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.

[0178] It is understood that the memory in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DR RAM). It should be noted that the memory used in the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0179] It should be understood that the above-described memory is exemplary and not a limiting description. For example, the memory in the embodiments of this application may also be static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DR RAM), etc. That is to say, the memory in the embodiments of this application is intended to include, but is not limited to, these and any other suitable types of memory.

[0180] This application also provides a computer-readable storage medium for storing computer programs.

[0181] Optionally, the computer-readable storage medium can be applied to the terminal device or server in the embodiments of this application, and the computer program causes the computer to execute the corresponding processes in the various methods of the embodiments of this application. For the sake of brevity, these will not be described in detail here.

[0182] This application also provides a computer program product, including computer program instructions.

[0183] Optionally, the computer program product can be applied to the terminal device or server in the embodiments of this application, and the computer program instructions cause the computer to execute the corresponding processes in the various methods of the embodiments of this application. For the sake of brevity, they will not be described in detail here.

[0184] This application also provides a computer program.

[0185] Optionally, the computer program can be applied to the terminal device or server in the embodiments of this application. When the computer program is run on the computer, it causes the computer to execute the corresponding processes in the various methods of the embodiments of this application. For the sake of brevity, it will not be described in detail here.

[0186] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. 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.

[0187] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the devices, apparatuses, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0188] In the several embodiments provided in this application, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0189] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0190] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0191] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0192] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for identifying a K-line pattern, characterized by, The method comprises the following steps: The terminal device obtains N1 pieces of K-line data of a first stock within a first time window, N1 being an integer greater than 1; The terminal device obtains a first target pattern corresponding to the N1 pieces of K-line data and x key K-lines in the N1 pieces of K-line data, the first target pattern being used to indicate the K-line pattern of the N1 pieces of K-line data, and x≤N1; The connection line of the x key K-lines presents the first target pattern; The terminal device obtaining the first target pattern corresponding to the N1 pieces of K-line data comprises the following steps: Extracting inflection points of stock prices in the N1 pieces of K-line data, the inflection point data being determined when the K-line changes from high to low or from low to high, and the difference degree λ of the K-line being greater than a system design difference threshold S; Determining the target pattern corresponding to the N1 pieces of K-line data according to the identified a pieces of inflection point data. The terminal device displays N1 pieces of K-line corresponding to the N1 pieces of K-line data; The terminal device draws a first target pattern line on the N1 pieces of K-line according to the first target pattern and the x key K-lines. After the terminal device draws the first target pattern line on the N1 pieces of K-line according to the first target pattern and the x key K-lines, the method further comprises the following steps: The terminal device receives a touch operation of a user touching the first target pattern line; In response to the touch operation, the terminal device displays first detailed data corresponding to the first target pattern line, the first detailed data comprising pattern interpretation data of the first target pattern line and historical backtest data.

2. The method of claim 1, wherein:

3. The method of claim 1, wherein, The pattern interpretation data comprises one or more of a starting time, a pattern category, an upward / downward probability, a pressure point, a support point, or a reversal probability; The historical backtest data comprises one or more of a number of occurrences, a profit probability, a profit-taking point, or a stop-loss point. The terminal device receiving a touch operation of a user touching the first target pattern line comprises:

4. The method according to any one of claims 2-3, characterized in that, When the terminal device detects a touch point input by the user, calculating a distance between the touch point and the first target pattern line; 5. The method according to any one of claims 1-3, characterized in that, If the distance between the touch point and the first target pattern line is less than or equal to a preset distance, the terminal device determines that the touch operation of the user touching the first target pattern line is received. The first target pattern line is a straight line or a curve.

6. The method according to any one of claims 1-3, characterized in that, The terminal device drawing the first target pattern line on the N1 pieces of K-line according to the first target pattern and the x key K-lines comprises: The terminal device connects the x key K-lines according to the first target pattern to obtain the first target pattern line.

7. The method according to any one of claims 1-3, characterized in that, The terminal device obtaining N1 pieces of K-line data of a first stock within a first time window comprises: In response to an operation of the user opening the first stock, the terminal device obtains N1 pieces of K-line data of the first stock within a first time window from a server. The method further comprises: The terminal device detects that the user adjusts the first time window to a second time window; The terminal device obtains N2 pieces of K-line data of the first stock within the second time window, N2 being an integer greater than 1; The terminal device acquires a second target pattern corresponding to the N2 K-line data and y key K-lines in the N2 K-line data, the second target pattern being used to indicate a K-line pattern of the N2 K-line data, and y≤N1; The terminal device displays N2 K-lines corresponding to the N2 K-line data; The terminal device draws a second target pattern line on the N2 K-lines according to the second target pattern and the y key K-lines.

8. A method of identifying a K-line pattern, characterized by, Comprise: The server acquires N1 K-line data of a first stock in a first time window, N1 being an integer greater than 1; The server analyzes a first target pattern corresponding to the N1 K-line data and x key K-lines in the N1 K-line data according to the N1 K-line data, the first target pattern being used to indicate a K-line pattern of the N1 K-line data, and x≤N1; The server sends an identifier of the N1 K-line data, the first target pattern and the x key K-lines to a terminal device; A connection of the x key K-lines presents the first target pattern; The terminal device acquires a first target pattern corresponding to the N1 K-line data, comprising: extracting inflection points of stock prices in the N1 K-line data, the inflection point data being determined when a K-line changes from high to low or from low to high, and a difference degree λ of the K-line being greater than a difference threshold S designed by a system; determining the target pattern corresponding to the N1 K-line data according to the a identified inflection point data; After the terminal device receives the N1 K-line data sent by the server, the terminal device displays corresponding N1 K-lines according to the N1 K-line data; and the terminal device draws a first target pattern line on the N1 K-lines according to the target pattern and the x key K-lines; After the terminal device draws the first target pattern line on the N1 K-lines according to the first target pattern and the x key K-lines, the method further comprises: The terminal device receives a touch operation of a user touching the first target pattern line; In response to the touch operation, the terminal device displays first detailed data corresponding to the first target pattern line, the first detailed data comprising pattern interpretation data and historical backtest data of the first target pattern line.

9. The method of claim 8, wherein, The server analyzes a first target pattern corresponding to the N1 K-line data, comprising: The server extracts a number of a inflection points of stock prices in the N1 K-line data, a being an integer greater than 0; The server calculates similarity between the a inflection points and different K-line pattern models; The server determines a K-line pattern of a K-line pattern model with the highest similarity as the first target pattern.

10. The method of claim 9, wherein, The server calculates similarity between the a inflection points and different K-line pattern models, comprising: The server filters the a inflection points to obtain a(i) filtered inflection points, a(i)≤a; The server calculates similarity between the a(i) filtered inflection points and different K-line pattern models according to a preset similarity formula.

11. The method of claim 10, wherein, The server filters the a inflection points, comprising: The server screens the a turning points based on one or more of the number of turning points, the type of turning points, time, a penalty factor, or a weight.

12. The method according to any one of claims 8-11, characterized in that, Before the server acquires N1 pieces of K-line data of a first stock within a first time window, the method further includes: The server acquires a first request sent by the terminal device, and the first request includes an identifier of the first stock and the first time window.

13. The method according to any one of claims 8-10, characterized in that, The method further includes: The server acquires a second request sent by the terminal device, and the second request includes an identifier of the first stock and a second time window; The server acquires N2 pieces of K-line data of a second stock within the second time window, where N2 is an integer greater than 1; The server analyzes a second target pattern corresponding to the N2 pieces of K-line data and y key K-lines in the N2 pieces of K-line data according to the N2 pieces of K-line data, where the first target pattern is used to indicate a K-line pattern of the N2 pieces of K-line data, and y≤N1; The server sends the N2 pieces of K-line data, the second target pattern, and identifiers of the y key K-lines to the terminal device.

14. A terminal device, comprising: It includes: An acquisition unit is configured to acquire N1 pieces of K-line data of a first stock within a first time window, where N1 is an integer greater than 1; and acquire a first target pattern corresponding to the N1 pieces of K-line data and x key K-lines in the N1 pieces of K-line data, where the first target pattern is used to indicate a K-line pattern of the N1 pieces of K-line data, and x≤N1. A line of the x key K-lines presents the first target pattern; The terminal device acquires the first target pattern corresponding to the N1 pieces of K-line data by extracting turning points of stock prices in the N1 pieces of K-line data, the turning point data being a point determined when a K-line changes from high to low or from low to high and a difference degree λ of the K-line is greater than a system designed difference threshold S; determining the target pattern corresponding to the N1 pieces of K-line data according to the a identified turning point data; and further configured to receive a touch operation of a user touching the first target pattern line; A display unit is configured to display N1 pieces of K-line corresponding to the N1 pieces of K-line data; and draw a first target pattern line on the N1 pieces of K-line according to the first target pattern and the x key K-lines. Further configured to display first detailed data corresponding to the first target pattern line in response to the touch operation, where the first detailed data includes pattern interpretation data and historical backtest data of the first target pattern line.

15. A server for performing the method of any one of claims 1-7 or the method of any one of claims 8-13, characterized by It includes: An acquisition unit is configured to acquire N1 pieces of K-line data of a first stock within a first time window, where N1 is an integer greater than 1. An analysis unit is configured to analyze a first target pattern corresponding to the N1 pieces of K-line data and x key K-lines in the N1 pieces of K-line data according to the N1 pieces of K-line data, where the first target pattern is used to indicate a K-line pattern of the N1 pieces of K-line data, and x≤N1. A communication unit is configured to send the N1 pieces of K-line data, the first target pattern, and identifiers of the x key K-lines to a terminal device.

16. A terminal device, comprising: It includes: a processor and a memory for storing a computer program, the processor being configured to invoke and run the computer program stored in the memory to cause the terminal device to perform the method according to any one of claims 1-7.

17. A server, characterized by comprising: a processor and a memory for storing a computer program, the processor being configured to invoke and run the computer program stored in the memory to cause the server to perform the method according to any one of claims 8-13.

18. A computer-readable storage medium, characterized in that, a computer program for causing a computer to perform the method according to any one of claims 1-7 or 8-13.

Citation Information

Patent Citations

  • Security analysis system and method based on graphical recognition

    CN106447494A

  • Stock curve analysis method and apparatus

    CN108364231A

  • Method and device for acquiring scenic spot information, mobile terminal, and storage medium

    CN109218982A

  • K-line form recognition and classification method and device, computer equipment and storage medium

    CN113269643A