Quantitative transaction data processing method, device and equipment
By determining the target market time period in quantitative trading and obtaining corresponding market data, the problem of timeliness and liquidity requirements for orders placed in different trading periods is solved, and the reliable operation of quantitative trading and the improvement of transaction accuracy is achieved.
Patent Information
- Application Number
- CN202510122696.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-26
- Publication Date
- 2025-06-20
AI Technical Summary
How to reasonably handle order timeliness and liquidity in different trading periods in quantitative trading to ensure the reliability and reasonable operation of the transaction.
By obtaining the market setting period and target actual operation period of the market indicator indicated by the preset strategy conditions in the quantitative trading strategy, determining the target market period, and obtaining the target market data to obtain the index value of the market indicator, triggering the trading operation in response to the index value meeting the strategy conditions.
It achieves an effective balance between trading liquidity and timeliness under different trading periods, ensures the reliability and reasonable operation of quantitative transactions, and improves the accuracy of transactions.
Smart Images

Figure CN120181995A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the technical field of data processing, and in particular, to a data processing method, device, and equipment for quantitative trading. Background Art
[0002] Quantitative trading refers to a method of using mathematical models, computer technology, statistical analysis, etc., combined with a large amount of market data to predict and analyze market prices, trading volumes, etc., and formulate trading decisions.
[0003] Currently, the regular trading period for virtual resources is the intraday period. In addition, the trading periods during which trading can also be carried out include: the night trading period, the pre-market period, and the after-hours period. The timeliness and liquidity of orders are different in different trading periods, and trading strategies also have specific requirements for the timeliness and liquidity of orders. Since quantitative trading often involves different trading periods, therefore, how to reasonably handle trading periods and ensure the reliable and reasonable operation of quantitative trading is a problem to be solved in the present application. Summary of the Invention
[0004] The present application provides a data processing method, device, and equipment for quantitative trading, which can ensure the reliable and reasonable operation of quantitative trading and improve the accuracy of quantitative trading.
[0005] In a first aspect, the present application provides a data processing method for quantitative trading, including: in response to an operation for running a quantitative trading strategy, obtaining a market setting period of a market indicator indicated by a preset strategy condition in the quantitative trading strategy, and a target actual running period of the quantitative trading strategy; determining a target market period according to the market setting period and the target actual running period; obtaining target market data of a trading object in the quantitative trading strategy in the target market period, and obtaining an indicator value of the market indicator according to the target market data; in response to the indicator value of the market indicator satisfying the preset strategy condition of the quantitative trading strategy, triggering the execution of a trading operation indicated by a preset strategy operation in the quantitative trading strategy.
[0006] In a second aspect, the present application provides a data processing device for quantitative trading, including: a first obtaining module, configured to obtain a market setting period of a market indicator indicated by a preset strategy condition in the quantitative trading strategy, and a target actual running period of the quantitative trading strategy in response to an operation for running the quantitative trading strategy; a first determining module, configured to determine a target market period according to the market setting period and the target actual running period; a second obtaining module, configured to obtain target market data of a trading object in the quantitative trading strategy in the target market period, and obtain an indicator value of the market indicator according to the target market data; an execution trading module, configured to trigger the execution of a trading operation indicated by a preset strategy operation in the quantitative trading strategy in response to the indicator value of the market indicator satisfying the preset strategy condition of the quantitative trading strategy.
[0007] In a third aspect, the present application provides an electronic device, including: a processor and a memory, where the memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory to execute the method in the first aspect or its various implementation manners.
[0008] In a fourth aspect, the present application provides a computer-readable storage medium for storing a computer program, and the computer program causes a computer to execute the method in the first aspect or its various implementation manners.
[0009] In a fifth aspect, the present application provides a computer program product including computer program instructions, and the computer program instructions cause a computer to execute the method in the first aspect or its various implementation manners.
[0010] In a sixth aspect, the present application provides a computer program, and the computer program causes a computer to execute the method in the first aspect or its various implementation manners.
[0011] Other technical features and technical effects involved in the present application will be introduced in subsequent embodiments. To avoid repetition, they will not be elaborated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] The following introduces the drawings required for the description of the embodiments.
[0013] Figure 1 It is a schematic diagram of an application scenario provided by an embodiment of the present application;
[0014] Figure 2 It is a flowchart of a data processing method for quantitative trading provided by an embodiment of the present application;
[0015] Figure 3 It is a schematic diagram of a data processing method for quantitative trading provided by an embodiment of the present application;
[0016] Figure 4 It is a schematic diagram of another data processing method for quantitative trading provided by an embodiment of the present application;
[0017] Figure 5 It is a schematic diagram of yet another data processing method for quantitative trading provided by an embodiment of the present application;
[0018] Figure 6 It is a schematic diagram of yet another data processing method for quantitative trading provided by an embodiment of the present application;
[0019] Figure 7 It is a schematic diagram of yet another data processing method for quantitative trading provided by an embodiment of the present application;
[0020] Figure 8Schematic diagram of another data processing method for quantitative trading provided by an embodiment of the present application;
[0021] Figure 9 Schematic diagram of another data processing method for quantitative trading provided by an embodiment of the present application;
[0022] Figure 10 Schematic diagram of another data processing method for quantitative trading provided by an embodiment of the present application;
[0023] Figure 11 Schematic diagram of another data processing method for quantitative trading provided by an embodiment of the present application;
[0024] Figure 12 Schematic diagram of another data processing method for quantitative trading provided by an embodiment of the present application;
[0025] Figure 13 Schematic diagram of another data processing method for quantitative trading provided by an embodiment of the present application;
[0026] Figure 14 Schematic diagram of another data processing method for quantitative trading provided by an embodiment of the present application;
[0027] Figure 15 Schematic diagram of a data processing device 1500 for quantitative trading provided by an embodiment of the present application;
[0028] Figure 16 Schematic diagram of an electronic device 1600 provided by an embodiment of the present application. Detailed implementation manners
[0029] It should be noted that the terms "first", "second", etc. in the description and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily describe a specific order or sequence. It should be understood that such data used can be interchanged under appropriate circumstances so that the embodiments of the present application described here can be implemented in an order different from those illustrated or described here. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or server including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0030] It should be understood that the technical solution of the present application can be applied to the following scenarios, but is not limited to:
[0031] In one embodiment, the present application can be applied to the quantitative trading scenario.
[0032] In one embodiment, as Figure 1 shown, the application scenario may include a terminal device 110 and a server 120, and the terminal device 110 and the server 120 may be connected via a wired network or a wireless network.
[0033] Among them, the terminal device 110 is installed with a client for virtual resource trading, and the server 120 is the server corresponding to the client. Specifically, the client includes a client front-end and a client back-end. Among them, the client front-end can provide an interactive interface for the user to construct and select a quantitative trading strategy and receive a trigger operation for triggering the execution of the quantitative trading strategy; the client back-end can be used as the strategy execution end of the quantitative trading strategy to actually send a market data acquisition request and a trading request to the interface of the server 120 to actually execute the quantitative trading strategy.
[0034] After receiving the operation for running the quantitative trading strategy, the client front-end can obtain the market setting period of the market index indicated by the preset strategy conditions in the quantitative trading strategy and the target actual running period of the quantitative trading strategy, and determine the target market period based on this; then, it can obtain the target market data from the server according to the target market period; finally, it can obtain the index value of the market index according to the target market data, and trigger the execution of the trading operation indicated by the preset strategy operation in the quantitative trading strategy in response to the index value of the market index satisfying the preset strategy conditions of the quantitative trading strategy.
[0035] Among them, the server 120 may be a single server, a server cluster composed of multiple servers, or a cloud platform control center, but is not limited thereto. The terminal device 110 may be a mobile phone, a tablet computer, a laptop computer, a desktop computer, etc., but is not limited thereto.
[0036] It should be noted that Figure 1 the terminal device and the server in
[0037] are only exemplary. Specifically, there may also be other quantities or types of terminal devices or servers.
[0038] In one embodiment, as Figure 3As shown in the figure, in time zone 1, the trading periods of virtual resources can be divided into four: night trading period (20:00 - 4:00), pre-market trading period (4:00 - 9:30), intraday trading period (9:30 - 16:00), and after-hours trading period (16:00 - 20:00). The intraday trading period, pre-market trading period, after-hours trading period, and night trading period can be referred to as full trading periods. In some trading markets, virtual resources are allowed to be traded outside the regular trading period (e.g., the intraday trading period), such as the pre-market trading period, after-hours trading period, and night trading period. The quantitative trading involved in this application can support trading in at least one of the above four periods, so as to ensure the continuity of market data and trading execution throughout the day, that is, throughout the full trading periods, thus ensuring the reliable and reasonable operation of quantitative trading.
[0039] Among them, the market setting period, actual operation period, market period, order placement period parameters, trading setting period, actual execution period, trading execution period, or trading period parameters involved in the embodiments can all include at least one of the above four periods.
[0040] In addition, the trading in different periods corresponds to different liquidity and timeliness. For example, regarding the liquidity of trading, the intraday trading period is greater than the pre-market trading period and the after-hours trading period, and the pre-market trading period and the after-hours trading period are greater than the night trading period. Different investors have different tolerances and demands for liquidity. In some scenarios where quick buying is desired, it is necessary to send it to the exchange server that is currently opening for trading as soon as possible, so there is a relatively high demand for liquidity. In some scenarios where quick buying is not required, an order can be submitted first and then executed during the intraday trading period, so the tolerance for low-liquidity trading is relatively high. Regarding the timeliness of trading, the timeliness of trading throughout the full trading periods is the highest, and 24-hour full-period trading can be achieved, eliminating the need to wait for the market to open, which facilitates the timeliness requirements of investors in various regions. This application can determine the target market period corresponding to the target market data obtained during the operation of the quantitative trading strategy and the target trading execution period corresponding to submitting the target order to the corresponding exchange server from the perspective of simultaneously considering trading liquidity and timeliness. Furthermore, it can achieve reasonable processing of the market period and the trading execution period, thus ensuring the reliable and reasonable operation of quantitative trading and improving the accuracy of quantitative trading. This will be introduced in the following embodiments.
[0041] First, some terms involved in the embodiments will be introduced below:
[0042] A quantitative trading strategy refers to the process of using computer technology to complete trading based on a pre-established strategy. The quantitative trading strategy specifically includes trading objects, preset strategy conditions, and preset strategy operations (such as order placement operations, order cancellation operations, etc.) triggered after the preset strategy conditions are met.
[0043] The preset strategy conditions include, but are not limited to, that the market indicators related to the trading object need to meet specific conditions. For example, taking the moving average golden cross opening strategy in quantitative trading strategy as an example, when the moving average of the k-line data of the trading object specified in the quantitative trading strategy crosses the moving average of its k-line data in a certain long period within a certain short period (i.e., meeting the preset strategy conditions), a buy order operation for the trading object is executed.
[0044] The market indicators indicated by the preset strategy conditions can refer to indicators that help investors analyze market trends and predict future price movements, and can reflect characteristics such as market trends, momentum, volatility, and strength, and can be used to guide trading decisions and generate trading signals. The market indicators can be k-line data, Average True Range (ATR) of k-lines, Relative Strength Index (RSI) of k-lines, or Bollinger Bands, but are not limited to these.
[0045] The market setting period of the market indicator refers to the time period limit set by the user for the corresponding market indicator in the preset strategy conditions when configuring the quantitative trading strategy. The trading setting period of the preset strategy operation refers to the time period limit set by the user for the preset strategy operation when configuring the quantitative trading strategy.
[0046] Specifically, the market setting period can include any one of the following: the first market setting period, the second market setting period, and the third market setting period. Among them, the first market setting period includes the intraday period, the second market setting period includes the intraday period, the pre-market period, and the after-hours period, and the third market setting period includes the intraday period, the pre-market period, the after-hours period, and the night trading period. For example, taking the market setting period of the preset strategy conditions in the quantitative trading strategy being configured as the first market setting period as an example, during the operation of the quantitative trading strategy, when pulling market data, the target market period can be determined according to the first market setting period and the current target actual operation time, so as to pull the corresponding market data according to the target market period. The trading setting period includes any one of the following: the first trading setting period, the second trading setting period, the third trading setting period, and the fourth trading setting period. The first trading setting period includes the intraday period, the second trading setting period includes the intraday period, the pre-market period, and the after-hours period, the third trading setting period includes the intraday period, the pre-market period, the after-hours period, and the night trading period, and the fourth trading setting period includes the night trading period. For example, taking the trading setting period of the preset strategy operation in the quantitative trading strategy being configured as the third trading setting period as an example, during the operation of the quantitative trading strategy, when the preset strategy conditions are met, the trading operation indicated by the preset strategy operation can be executed at any time.
[0047] The target actual running period of a quantitative trading strategy can refer to the period when a market data acquisition interface for obtaining target market data is called. The target actual execution period of the trading operation of a quantitative trading strategy can refer to the period when a preset strategy operation (such as an automatic order placement operation) is triggered during the actual running process of the quantitative trading strategy.
[0048] It can be understood that, combining the above content, it can be seen that the liquidity and timeliness of virtual resource trading are different in the intraday period, pre-market period, after-hours period, and night trading period. Additionally, as Figure 4 shown, in terms of liquidity, the intraday period is greater than the pre-market period and / or the after-hours period, and the pre-market period and / or the after-hours period is greater than the time periods other than the intraday period, pre-market period, and after-hours period in the entire period; in terms of timeliness, the entire period is greater than the pre-market period and / or the after-hours period, and the intraday period is greater than the pre-market period and / or the after-hours period. Therefore, compared with dividing the above order placement period parameters and market setting periods into four separate periods: the intraday period, pre-market period, after-hours period, and night trading period, the period division method of the order placement period parameters and market setting periods in the embodiments of the present application (stratifying according to liquidity and timeliness, being forward-compatible, progressive, and inclusive) can achieve an effective balance between trading liquidity and timeliness during the operation of the business scenario, that is, during the operation of the quantitative trading strategy.
[0049] Moreover, without affecting the support for obtaining intraday market data, it can support more quantitative trading scenarios in other periods by gradually expanding, and can reduce errors and strategy failures caused by period switching and interface changes, reducing maintenance costs. At the same time, it can be more easily integrated with the system functions and analysis tools for quantitative trading that only support the intraday period, without the need for large-scale modifications to the existing configuration, having high scalability and simple integration, reducing the complexity and cost of subsequent upgrades. Therefore, it can also ensure that the integrated market data acquisition interface can achieve a relatively simple enumeration type under the scenario requirements of multiple periods, improving data compatibility and the flexibility of data acquisition.
[0050] The technical solution of the present application will be elaborated in detail below:
[0051] Figure 2 It is a flowchart of a data processing method for quantitative trading provided by an embodiment of the present application. This method can be executed by the terminal device 110 in the above application scenario, but is not limited thereto. As Figure 2 shown, this method can include the following steps:
[0052] S210: In response to an operation for running a quantitative trading strategy, obtain the market setting period of the market indicators indicated by the preset strategy conditions in the quantitative trading strategy, and the target actual running period of the quantitative trading strategy;
[0053] S220: Determine the target market period based on the market setting period and the target actual operation period.
[0054] S230: Obtain the target market data of the trading object in the target market period in the quantitative trading strategy, and obtain the index value of the market index according to the target market data.
[0055] S240: In response to the index value of the market index meeting the preset strategy conditions of the quantitative trading strategy, trigger the execution of the trading operation indicated by the preset strategy operation in the quantitative trading strategy.
[0056] After receiving the operation for running the quantitative trading strategy, in response to this operation, run the quantitative trading strategy, and obtain the trading setting period of the preset strategy operation from the quantitative trading strategy, and determine the target actual operation period of the quantitative trading strategy in real time according to the current time information.
[0057] Among them, the target market period refers to the period in which the target market data used to determine the index value of the market index is located subsequently.
[0058] In one embodiment, the above determining the target market period based on the market setting period and the target actual operation period may include:
[0059] S220-1: Obtain the first mapping relationship between the market setting period, the actual operation period, and the market period.
[0060] S220-2: Determine the target market period based on the market setting period and the target actual operation period based on the first mapping relationship.
[0061] Among them, during the operation of the quantitative trading strategy, the market setting period of the quantitative trading strategy can be obtained, and then by calling the market acquisition interface, the corresponding target market period can be obtained through the market acquisition interface according to the market setting period and the current target actual operation period. Specifically, the market acquisition interface can be set with multiple order placement period parameters. It should be noted that the period involved in the market setting period is corresponding and consistent with the period involved in the order placement period parameters set by the market acquisition interface. The target market period can be obtained by matching the market setting period with the order placement period parameters, and then according to the matching result and the current actual operation period; correspondingly, the first mapping relationship can be the mapping relationship between the order placement period parameters, the actual operation period, and the market period.
[0062] Specifically, the market setting period can be matched with the order placement period parameters set by the market acquisition interface to determine the matching enumerated order placement period; then, based on the first mapping relationship, the target market period is determined according to the matching enumerated order placement period and the target actual operation period.
[0063] It is understandable that the liquidity of trading objects during the intraday period is the highest. For the corresponding market data, such as candlestick data, there is often good continuity in time series. The market indicators calculated from this market data can accurately reflect the market change trend of trading objects, have strong readability and reference significance, and the judgment accuracy of trading signals using this market indicator is higher. The liquidity of market data outside the intraday period in the full-time period is lower, and the corresponding market data often shows irregular amplitude, gap and other forms. The reference significance of the market indicator calculated from this market data is lower, and the judgment accuracy of trading signals using this market indicator is low. Therefore, when users have high requirements for the liquidity of market data, such as for most short-term trading users, intraday trading users or high-frequency trading users, using market data with good liquidity, such as intraday market data, can effectively reduce the slippage loss of quantitative strategy trading and reduce trading costs. When users have high requirements for the timeliness of market data, such as when they need to quickly respond to market changes or strive to identify abnormal jump data in market data at specific times, if only the market data during the intraday period is selected and the market data of other periods is discarded, the latest market data of other periods except the intraday period in the full-time period cannot be obtained.
[0064] In the above embodiments, the target market period is determined according to the market setting period and the actual operation period. That is to say, which period of market data is used to determine the index value of the market indicator takes into account both the order placement time (corresponding to the market setting period) preset before the operation of the quantitative trading strategy and the actual order placement time (corresponding to the actual operation period) during the operation of the quantitative trading strategy. It is an automatic adaptation to the market setting period and the actual operation period, which can meet the needs of trading scenarios in different periods. Therefore, the above process can ensure that the market data used in the operation of the quantitative trading strategy meets the user's needs and conforms to the actual market situation, and then can ensure the reliability and accuracy of the target market data, so as to ensure the reliable and reasonable operation of quantitative trading and the accuracy of quantitative trading results.
[0065] Exemplarily, the market quotation acquisition interface may be set with an order placing time period parameter, and the order placing time period parameter includes multiple enumerated order placing time periods. Specifically, the market quotation setting time period and the multiple enumerated order placing time periods corresponding to the order placing time period parameter may be formatted first (for example, they may be converted into time periods in the same time zone and in 24-hour format), so as to obtain the formatted market quotation setting time period and the multiple enumerated order placing time periods; then, it may be checked whether each enumerated order placing time period overlaps or completely contains the market quotation setting time period (for example, the start time and end time of the formatted market quotation setting time period and the multiple enumerated order placing time periods may be determined first; then, by comparing the corresponding start time and end time, it may be determined whether each enumerated order placing time period overlaps or completely contains the market quotation setting time period); finally, the enumerated order placing time periods that overlap or completely contain the market quotation setting time period may be determined as the matching enumerated order placing time periods.
[0066] Exemplarily, the first mapping relationship may be as Figure 5 shown, where, in Figure 5 , the set time period refers to the above-mentioned market quotation setting time period, the time period for calling the interface refers to the above-mentioned actual running time period, and the time period corresponding to the market quotation data refers to the above-mentioned market quotation time period.
[0067] It should be noted that the present application does not limit the specific form of the first mapping relationship. For example, the first mapping relationship may be in the form of a tree diagram similar to Figure 5 . Specifically, in the first mapping relationship in the form of a tree diagram, the root node may be the name of the first mapping relationship such as "First Mapping Relationship"; the first-level nodes may be the specific classifications of the market quotation setting time period parameter, for example, the first market quotation setting time period, the second market quotation setting time period, and the third market quotation setting time period (or, it may also be the specific classification of the order placing time period parameter); the second-level nodes are located under each first-level node and include the actual running time period, for example, the intraday period, the pre-market period, the after-hours period, and the night trading period; the third-level nodes are located under each second-level node and include the market quotation time period, for example, the intraday period, the pre-market period, the after-hours period, the night trading period, and the intraday period of the previous trading day, etc. Alternatively, the second-level nodes and the third-level nodes may be merged into one node using different colors or markings to simplify the structure of the first mapping relationship.
[0068] Alternatively, the first mapping relationship may be in the form of a table. For example, in the first mapping relationship in the form of a table, the first mapping relationship may be a three-column table, with each column used to record the market quotation setting time period, the actual running time period, and the market quotation time period respectively; each row represents a specific mapping relationship in the first mapping relationship.
[0069] Exemplarily, when starting a quantitative trading strategy for live trading, assume that when the user constructs a quantitative trading strategy based on the visual interface provided by the client front-end, the time period limit set for the corresponding market index in the preset strategy conditions is the full time period, and the time period when the market data acquisition interface is called when the quantitative trading strategy is triggered (i.e., the actual running time period) is the pre-market period. Then, according to the first mapping relationship, it can be determined that the target market time period is the pre-market period. Correspondingly, the market data acquisition interface determines that the target market time period is the pre-market market time period, and the market data acquisition interface can return the real-time market data of trading objects, such as virtual resources, in the pre-market market time period.
[0070] Alternatively, if the market setting time period is the intraday period and the actual running time period is the pre-market period, then according to the first mapping relationship, it can be determined that the target market time period is the intraday period. Correspondingly, the target market time period returned by the market data acquisition interface is the intraday closing moment of the previous trading day, that is, the market data acquisition interface can return the market data of the trading object at the intraday closing moment of the previous trading day.
[0071] In one embodiment, after obtaining the target market data in the target market time period, the index value of the market index can be obtained according to the target market data. Among them, the index value of the market index can be the value in the market index used to compare with the preset strategy conditions in the quantitative trading strategy to determine whether to trigger the execution of trading operations. If the index value of the market index meets the preset strategy conditions (for example, the trading value represented by the index value reaches the trading price set in the preset strategy conditions), then the trading operation indicated by the preset strategy operation in the quantitative trading strategy can be triggered.
[0072] Specifically, if the market index is the target market data, the target market data can be directly determined as the index value of the market index; if the target market data is the original data used to determine the market index, the market index can be determined first according to the target market data, and then the index value can be obtained from the market index. For example, the market index can be the 5-day moving average value (Moving Average), and the index value of this market index can be obtained according to the closing prices within 5 days in the target market data.
[0073] It is understandable that different market data and market indicators have different characteristics. For example, for K-line data with good liquidity, its graph trend is relatively coherent, without continuous gaps or jumps, such as "flags", "wedges" or "channels". Therefore, for most quantitative trading strategies targeting short-term trading, intraday trading, and high-frequency trading, using K-line data with good liquidity can achieve the purpose of quickly entering and exiting the market, reducing slippage losses, lowering trading costs, and the volume-price data shown by continuous and gapless K-lines can accurately reflect the behavior and trends of market participants, and has strong readability and reference significance, which can be better applied to the judgment of trading signals, thereby providing more reliable quantitative trading results. For K-line data with good timeliness, it can reflect the real-time market data in the current period, representing the latest volume-price level. Especially in non-intraday trading periods, K-line data often shows irregular price trends, large price fluctuations, low trading volumes, price gaps and other patterns. When using the K-line data in non-intraday periods for technical analysis of market indicators corresponding to the preset strategy conditions of quantitative trading strategies, the technical analysis signals may not be as reliable as those in intraday trading periods. However, when the quantitative trading strategy corresponding to the preset strategy conditions specifically needs to quickly respond to market changes or needs to identify abnormal jump point data in a specific period, corresponding judgments can be quickly made through K-line data with good timeliness, and the quantitative trading strategy can respond immediately to avoid missing the anchoring opportunity. That is to say, the trading liquidity is poor in non-intraday periods, the risk of misinterpreting technical indicators calculated from the K-line data in these periods is high, and the random market fluctuations (noise) are strong, which in turn affects the quality of trading signals. However, for quantitative trading strategies with high requirements for timeliness and the need for immediate response and execution, the K-line data in these periods can be used to avoid missing trading opportunities. And for the applied technical solution, when determining the target market data and market indicators, it is determined through the market setting periods and actual operation periods obtained by layer-by-layer progressive and inclusive division of multiple periods based on liquidity and timeliness. Therefore, effective conversion and trade-off can be carried out between liquidity and timeliness, which can not only meet the user's own needs but also consider the authentication of market data, and further take into account the impact of liquidity and timeliness on the calculation of market indicators, thereby improving the accuracy and relevance of the indicator values.
[0074] In one embodiment, before the terminal device obtains the target market data in the target market period, it can first pull multiple market data from the background service, such as a server, and store them in a storage unit (storage container), and this storage unit can be the storage unit corresponding to the client locally; then, after determining the target market period, it can obtain the target market data in the target market period from the storage unit to improve the data acquisition efficiency and the quantitative trading efficiency.
[0075] Among them, the storage capacity of the storage unit can be fixed, and the amount of data that can be stored is the number of market data. For example, the storage unit can be a container that can store 1,000 K-lines.
[0076] Specifically, before obtaining the target market data of the trading object in the target market period in the quantitative trading strategy, the number of market data required to calculate the market index can be obtained first; pull the number of market data from the background service; according to the period involved in the number of market data, store the number of market data in the corresponding sub-cache unit of the cache unit; afterwards, the market data in the specific market period pushed by the background service can be obtained, and the specific market period includes any one of the following: intraday period, pre-market period, after-hours period, night trading period; according to the period involved in the specific market period, store the market data in the specific market period in the corresponding sub-cache unit of the cache unit, and update the historical market data stored in the cache unit, so that the number of data of the market data stored in the cache unit is the number of market data.
[0077] Among them, the cache unit includes: a first sub-cache unit, a second sub-cache unit, and a third sub-cache unit; the first sub-cache unit is used to store market data in the intraday period; the second sub-cache unit is used to store market data in the intraday period, pre-market period, and after-hours period; the third sub-cache unit is used to store market data in the intraday period, pre-market period, after-hours period, and night trading period;
[0078] Correspondingly, the above-mentioned obtaining of the target market data in the target market period includes: obtaining the target market data in the target market period from the cache unit.
[0079] Exemplarily, as Figure 6 shown, after starting the live trading at the front end of the client, that is, after starting to run the quantitative trading strategy, the back end of the client can subscribe to and pull market data in different periods from the background service; the background service can return the market data in different periods to the client back end in the form of data packets, and the client back end can store it in the cache. At the same time, the background service can push new market data to the client in real time, so that the client can update the cache accordingly to keep the data volume in the cache fixed and the latest. In addition, the client back end can process the market data in different periods and store the market data in different periods in the corresponding sub-cache unit of the cache according to the above-mentioned progressive and inclusive sub-period method; afterwards, the client back end can obtain the target market data from the cache, that is, the storage unit.
[0080] It can be understood that, as Figure 7As shown, the client installed on the terminal device can first subscribe to and pull a number of market data from the background service, for example, 1,000 real-time K lines; the client can pull the data packet from the background service and first cache the number of market data to the storage unit; when the client subsequently obtains the target market data, it can obtain the target market data from the storage unit. In addition, the background service can push new market data in real time, that is, the market data in a specific market period, to the client. For example, if it is the pre-market period currently, the background service can push the K lines in the pre-market period to the client in real time to continuously update the data in the storage unit and ensure that the obtained market data is up-to-date.
[0081] Moreover, the above embodiments not only support obtaining market data in different periods simultaneously, but also can store the market data in different periods into the corresponding sub-cache units in a progressive and inclusive sub-period manner, ensuring that the obtained target market data directly corresponds to the target market period (that is, the market data in the intraday period can be directly obtained; or the market data in the intraday period, pre-market period, and after-hours period; or the market data in the full period), which can reduce the calculation process and improve performance.
[0082] After obtaining the index value of the market index and determining that the index value of the market index meets the preset strategy conditions of the quantitative trading strategy, the trading operation indicated by the preset strategy operation in the quantitative trading strategy can be triggered for execution by the backend of the client. The following is an introduction to this:
[0083] In one embodiment, the trading operation indicated by the preset strategy operation in the quantitative trading strategy includes:
[0084] S240-1: Obtain the trading setting period of the preset strategy operation in the quantitative trading strategy and the target actual execution period of the trading operation;
[0085] S240-2: Determine the target trading execution period according to the trading setting period and the target actual execution period;
[0086] S240-3: Construct a target order and submit the target order to the exchange server corresponding to the target trading execution period.
[0087] Among them, the preset strategy operation in the quantitative trading strategy refers to the operation that needs to be continued to run the quantitative trading strategy after determining that the index value of the market index meets the preset strategy conditions of the quantitative trading strategy. For example, constructing a target order based on the obtained target market data and submitting the trading operation of the target order.
[0088] The trading setting period corresponding to the preset strategy operation refers to the trading period set for the target order for submitting the order, i.e., the trading operation. For example, it can be the trading period set by the user based on the front-end of the client.
[0089] The target actual execution period of the trading operation can refer to the real-time period when the preset strategy operation (such as automatically executing the order placement operation) is triggered during the actual operation of the quantitative trading strategy.
[0090] The target trading execution period refers to the period when the final execution of the preset strategy operation is determined. During the operation of the quantitative trading strategy, the trading setting period corresponding to the preset strategy operation in the quantitative trading strategy can be obtained, and then by calling the trading interface, the corresponding target trading execution period can be obtained according to the trading setting period and the target actual execution period of the current call to the trading interface through the trading interface. Specifically, the trading interface can be set with multiple order placement period parameters. In one embodiment, similar to the market quotation acquisition interface, trading period parameters can be set for the trading interface (for submitting orders, for example, the target order). The trading period parameters can include: the first enumerated trading period, the second enumerated trading period, the third enumerated trading period, and the fourth enumerated trading period. The first enumerated trading period includes the intraday period, the second enumerated trading period includes the intraday period, the pre-market period, and the after-hours period, the third enumerated trading period includes the intraday period, the pre-market period, the after-hours period, and the night trading period, and the fourth enumerated trading period includes the night trading period.
[0091] Similarly, similar to the market quotation setting period, the trading setting period includes any one of the following: the first trading setting period, the second trading setting period, the third trading setting period, the fourth trading setting period. The first trading setting period includes the intraday period, the second trading setting period includes the intraday period, the pre-market period, and the after-hours period, the third trading setting period includes the intraday period, the pre-market period, the after-hours period, and the night trading period, and the fourth trading setting period includes the night trading period.
[0092] It can be understood that, similar to the above-mentioned market quotation acquisition interface and market quotation setting period, the progressive and inclusive period division method can enable the trading interface to have better fault tolerance and expansion flexibility. It can not only be quickly coordinated and integrated with the existing intraday trading function without large-scale modification of the existing configuration, but also support more future upgrade possibilities and reduce the long-term maintenance cost.
[0093] In addition, during the intraday session with high liquidity, there are sufficient buy and sell orders, and the bid-ask spread tightens, which can achieve a friendly and stable transaction price. Therefore, choosing the intraday session to execute trading operations can ensure better order liquidity. During non-intraday sessions, due to the sparsity of trading orders and the lack of trading counterparts, the bid-ask spread will increase. Therefore, choosing to execute trading operations throughout the day cannot avoid the transaction risks brought by non-intraday trading to a certain extent. In business scenarios such as panic sales, expiration of end-of-period options, and bid-ask spread arbitrage, investors' requirement for timeliness is higher than that for liquidity. They often need to quickly liquidate to avoid losses caused by huge price fluctuations. Therefore, only executing trading operations during the intraday session cannot meet the demand for high timeliness, and trading operations need to be executable throughout the day to adapt to 5*24-hour all-weather trading. Therefore, the above-mentioned method of dividing the trading period into the market condition setting period and the actual execution period can not only achieve the simultaneous compatibility of liquidity and timeliness, but also enable investors to flexibly choose the trading period according to their own needs and trading scenarios, thus greatly improving the trading freedom and flexibility.
[0094] For S240-2, exemplarily, a second mapping relationship between the trading setting period, the actual execution period, and the trading execution period can be obtained; then, based on the trading setting period and the target actual execution period, the target trading execution period is determined according to the second mapping relationship.
[0095] It should be noted that the period involved in the trading setting period is corresponding to the period involved in the trading period parameters set by the trading interface. The above process can be achieved by matching the trading setting period with the trading period parameters. Correspondingly, the second mapping relationship can refer to the mapping relationship between the trading period parameters, the actual execution period, and the trading execution period. Specifically, the trading setting period can be matched with the trading period parameters set by the trading interface to determine the matching enumerated trading period; based on the matching enumerated trading period and the target actual execution period, the target trading execution period is determined according to the second mapping relationship.
[0096] Among them, the target trading execution period refers to the period when the target order is submitted to the corresponding exchange server during the operation of the quantitative trading strategy.
[0097] For example, the second mapping relationship can be as Figure 8 shown, where, in Figure 8 , the set period refers to the above-mentioned trading setting period, the period of calling the interface refers to the above-mentioned actual execution period, and the period corresponding to the trading execution refers to the above-mentioned trading execution period.
[0098] It should be noted that the process of determining the matching enumerated trading period is similar to the process of determining the matching enumerated order placement period above, and the process of determining the second mapping relationship is similar to the process of determining the first mapping relationship. This application will not elaborate on this.
[0099] It can be understood that the execution quality of order transactions is an important indicator for evaluating the execution effect of trading operations. It involves factors such as execution price, execution speed, trading volume, etc. At the same time, considerations of liquidity and timeliness will directly affect the execution efficiency and cost of transactions (determined based on the above factors such as execution price, execution speed, trading volume, etc.). Specifically, for orders that pay more attention to the execution price, the main goal is to ensure that trading operations are executed at the best or near-best price, which requires higher liquidity. If a trading operation is selected during the intraday period with high liquidity, the transaction can be executed at the set price, and certain stop-profit and stop-loss management can be carried out to ensure the execution quality. If a trading operation is selected to be executed throughout the day, the low liquidity during non-intraday periods will not be able to ensure execution at the set price, thus failing to achieve the expected strategy returns. For orders that pay more attention to the execution speed, they often rely more on market timeliness. For example, to reduce the impact of market price changes on transaction execution, intraday investors or algorithmic investors are more concerned about the execution speed. If a trading operation is selected to be executed throughout the day, no matter which period the transaction operation is executed in currently, the system can give a quick adaptation response and immediately buy or sell at the best available price in the current market, thus ensuring the fastest execution speed. If a trading operation is selected to be executed only during the intraday period, the submission of the order will only be executed during the intraday period, and the trading opportunity will often be missed. In the above embodiments, the target trading execution period is determined by the trading setting period and the actual execution period obtained by hierarchically progressive and inclusive division of multiple periods based on liquidity and timeliness. Therefore, effective conversion and trade-off can be carried out between liquidity and timeliness, maximizing the utilization rate of resources while supporting the trading ability throughout the day and ensuring the execution quality.
[0100] For S240-3, exemplarily, a target order can be constructed according to market indicators first; then the target order can be submitted to the exchange server corresponding to the target trading execution period.
[0101] For example, trading elements can be determined according to market indicators, such as trading quantity, trading price, trading direction, and the type of virtual resources for trading; then, the trading elements are filled into a preset order template correspondingly to obtain the target order.
[0102] Among them, different trading execution periods correspond to different exchange servers. For example, orders during the pre-market period, intraday period, and after-hours period can be assigned to major exchanges such as the New York Stock Exchange (NYSE) and the Nasdaq Stock Market (Nasdaq) for matching. That is, the exchange servers corresponding to the pre-market period, intraday period, and after-hours period are the trading servers corresponding to NYSE and NASDAQ; orders during the overnight trading period can be assigned to alternative trading systems for US stocks such as BlueOcean ATS (BOATS) for order matching. That is, the exchange server corresponding to the overnight trading period is the trading server corresponding to NYSE and NASDAQ.
[0103] Furthermore, it is also possible to determine the exchange server for specifically executing the trading operation indicated by the preset policy operation in combination with the order information of the target order and the target trading execution period; in one embodiment, the order information of the target order can be obtained, where the order information includes the trading object, trading amount, and trading quantity; furthermore, the order information of the target order and the target trading execution period are used as the to-be-matched parameters in each dimension and matched with the standard parameters of multiple exchange servers in the corresponding dimension to determine the exchange server for specifically executing the trading operation indicated by the preset policy operation from multiple exchange servers. Among them, the standard parameters of each exchange server in the corresponding dimension can be obtained according to the historical order information and historical trading execution period corresponding to the historical orders processed by the exchange server. Specifically, the exchange server for specifically executing the trading operation indicated by the preset policy operation can be determined from multiple exchange servers through the following formula.
[0104]
[0105] Among them, represents the matching degree between the target order and the j-th exchange server, and Curvalue i refers to the to-be-matched parameter of the target order in the i-th dimension, including order information and the target trading execution period; refvalue i refers to the standard parameter of a certain exchange server in the i-th dimension, including the order information of historical orders and the historical trading execution period. After obtaining the matching degree between the target order and the j-th exchange server, the exchange server with the maximum matching degree can be determined as the exchange server for specifically executing the trading operation indicated by the preset policy operation. Determining the exchange server for specifically executing the trading operation indicated by the preset policy operation through the order information of the target order and the target trading execution period can improve the execution success rate of the order.
[0106] In one embodiment, such as Figure 9As shown, the target order can be submitted to the downstream brokerage server through the client order interface first; then, through the downstream brokerage server, the target order can be processed and the processed target order can be routed to the clearing house; next, through the clearing house, the processed target order can be verified and the verified target order can be routed to the exchange server corresponding to the target trading execution period for trading.
[0107] Specifically, the downstream brokerage server can cache the target order so that the target order can be obtained in real time when it is needed later (for example, when the trading market opens, the cached target order can be obtained for subsequent trading steps).
[0108] Among them, the client can be in the form of a web page or an application, but is not limited to this. The client can perform transfer processing, caching, and order management on the target order to ensure trading continuity.
[0109] In the above embodiment, through the target trading execution period and the order matching rules of the exchange server for orders in different periods, trading in multiple trading venues at different times can be realized, maximizing the utilization of trading periods, ensuring trading continuity in multiple periods and multiple trading venues, and seamless execution of trading orders in each trading period, thereby improving the order turnover efficiency.
[0110] In one embodiment, as Figure 10 shown, when submitting the target order to the exchange server, in addition to considering the target trading execution period (which can include any one of the intraday period, intraday period + pre-market period + after-hours period, and full period) to select the corresponding exchange server, corresponding order turnover processing can also be performed according to the order term of the target order, such as caching, cancellation, secondary response, etc. The following is an introduction to this:
[0111] Among them, the order term can include the following two types: the day order (DAY) and the good-till-cancelled order (GTC).
[0112] Specifically, the order period of the target order can be obtained first; then, in response to the order period being the same-day validity period, the target order can be cached through the downstream brokerage server, and in response to reaching the target trading execution period, the target order can be routed to the corresponding exchange server for trading; if the trading is not successful by the end time of the target trading execution period, a cancellation operation can be performed on the target order; alternatively, in response to the order period being the validity period before cancellation, the target order can be cached through the downstream brokerage server, and in response to reaching the target trading execution period, the target order can be routed to the corresponding exchange server for trading; if the trading is not successful by the end time of the target trading execution period, in response to reaching the target trading execution period on the next trading day, the target order can be routed to the corresponding exchange server for trading until a cancellation operation by the target user for the target order is obtained.
[0113] For example, as Figure 11 shown, assuming that the target trading execution period is the intraday period, the target order can be routed to the downstream brokerage server first; then, the order period can be judged: if the order period is the same-day validity period, the target order can be cached in the server (for example, the downstream brokerage server) first, and when the trading market opens, it can be routed to the exchange server through the clearinghouse for matching; if the matching is still not successful at the close of trading, the order can be automatically cancelled. If the order period is the validity period before cancellation, the target order can be cached in the server first, and when the trading market opens, it can be routed to the exchange server through the clearinghouse for matching; if the matching is still not successful at the close of trading, it can be automatically returned to the downstream server for caching, and when the trading market opens on the next trading day, it can be routed to the exchange server for matching again until the order is manually cancelled.
[0114] For example, as Figure 12 shown, assuming that the target trading execution period includes the intraday period, the pre-market period, and the after-hours period (i.e., trading operations can be performed at any time during the intraday period, the pre-market period, and the after-hours period), if the target actual execution period of the trading operation is the night trading period, that is, the target order is submitted during the night trading period, the target order can be routed to the downstream brokerage server first; then, the order period can be judged: if the order period is the same-day validity period, the target order can be cached in the server first, and when the trading market opens, it can be routed to the exchange server through the clearinghouse for matching; if the matching is still not successful at the after-hours close of trading, the order is automatically cancelled. If the order period is the validity period before cancellation, the target order can be cached in the server first, and when the trading market opens in the pre-market, it can be routed to the exchange server through the clearinghouse for matching; if the matching is still not successful at the after-hours close of trading, it can be automatically returned to the downstream server (for example, the downstream brokerage server) for caching, and when the trading market opens in the pre-market on the next trading day, it can be routed to the exchange server for matching again until the target order is manually cancelled.
[0115] For example, as Figure 13 shown, assume that the target trading execution period is the full period (i.e., trading operations can be executed at any time during the intraday period, pre-market period, after-hours period, and night trading period), the order expiration is the same-day expiration, the first exchange is exchanges such as NYSE and NASDAQ, and the second exchange is exchanges such as BOATS; the client can first send the trading operations corresponding to the target order to the downstream server; if the period when the trading operations are sent to the downstream server is the non-night trading period, that is, the target order is submitted during the non-night trading period (which means the target actual execution period is the non-night trading period), then the target order can be first routed to the first exchange server for matching. If the matching is still not successful at the end of the after-hours trading, it will be returned to the downstream server for caching; then, at the opening of the night trading, it can be automatically routed to the second exchange server for matching. If the matching is still not successful at the end of the night trading, the order will be automatically cancelled; if the period when the trading operations are sent to the downstream server is the night trading period, that is, the target order is submitted during the night trading period (which means the target actual execution period is the night trading period), the client can directly route the target order to the second exchange server for matching. If the matching is still not successful at the end of the night trading, the order will be automatically cancelled.
[0116] Or, as Figure 14 shown, assume that the target trading execution period is the full period and the order expiration is valid until cancelled; if the target actual execution period of the trading operation is the non-night trading period, that is, the target order is submitted during the non-night trading period, then the target order can be first routed to the first exchange server for matching. If the matching is still not successful at the end of the after-hours trading, it will be returned to the downstream server for caching; then, at the opening of the night trading, it can be automatically routed to the second exchange server for matching. If the matching is still not successful at the end of the night trading period, it can be returned to the downstream server for caching again; then, at the opening of the pre-market period of the next trading day, it can be routed to the first exchange server for matching; then, the above order routing path can be repeated until the target order is manually cancelled. If the target actual execution period of the trading operation is the night trading period, that is, the target order is submitted during the night trading period, then the target order can be directly routed to the second exchange server for matching. If the matching is still not successful at the end of the night trading period, it will be returned to the downstream server for caching; then, at the opening of the pre-market period, it can be automatically routed to the first exchange server for matching; then, if the matching is still not successful at the end of the after-hours trading, it can be returned to the downstream server for caching again; at the opening of the night trading period, it can be routed to the second exchange server for matching. Then, the above order routing path can be repeated until the target order is manually cancelled.
[0117] Through the above embodiments, it is possible to implement quantitative trading for all-weather market condition acquisition and live trading, meet the quantitative trading solutions for multi-period and multi-trading venue interconnection, and also take into account the liquidity, timeliness, trading continuity, etc. of quantitative trading, improve the trading execution quality, and ensure the reliable and reasonable operation of quantitative trading.
[0118] It should be noted that all the above technical solutions can be combined arbitrarily to form alternative embodiments of the present application, which will not be elaborated one by one here.
[0119] It should be noted that in the specific implementation of the present application, it involves various time periods such as set time periods and actual time periods, as well as relevant data such as market data and order deadlines. When the embodiments of the present application are applied to specific products or technologies, user permission, consent or authorization is required, and the collection, use and processing of relevant data need to comply with the relevant laws, regulations and standards of relevant countries and regions.
[0120] Figure 15 It is a schematic diagram of a data processing device 1500 for quantitative trading provided by an embodiment of the present application. As Figure 15 shown, the device 1500 includes: a first acquisition module 1501, a first determination module 1502, a second acquisition module 1503, an execution trading module 1504, a third acquisition module 1505, a market quotation pulling module 1506, a first storage module 1507, a fourth acquisition module 1508, and a second storage module 1509.
[0121] In one embodiment, the first acquisition module 1501 is configured to, in response to an operation for running a quantitative trading strategy, acquire the market quotation set time period of the market quotation indicators indicated by the preset strategy conditions in the quantitative trading strategy, and the target actual running time period of the quantitative trading strategy;
[0122] The first determination module 1502 is configured to determine the target market quotation time period according to the market quotation set time period and the target actual running time period;
[0123] The second acquisition module 1503 is configured to acquire the target market quotation data of the trading object in the quantitative trading strategy during the target market quotation time period, and acquire the indicator values of the market quotation indicators according to the target market quotation data;
[0124] The execution trading module 1504 is configured to, in response to the indicator values of the market quotation indicators satisfying the preset strategy conditions of the quantitative trading strategy, trigger the execution of the trading operations indicated by the preset strategy operations in the quantitative trading strategy.
[0125] In one embodiment, the market setting period includes any one of the following: the first market setting period, the second market setting period, and the third market setting period. The first market setting period includes the intraday period. The second market setting period includes the intraday period, the pre-market period, and the after-hours period. The third market setting period includes the intraday period, the pre-market period, the after-hours period, and the night trading period;
[0126] The first determination module 1502 is specifically configured to:
[0127] Obtain the first mapping relationship among the market setting period, the actual operation period, and the market period;
[0128] Based on the market setting period and the target actual operation period, determine the target market period according to the first mapping relationship.
[0129] In one embodiment, the third acquisition module 1505 is configured to acquire the number of market data required for calculating market indicators;
[0130] The market data pulling module 1506 is configured to pull the number of market data from the background service;
[0131] The first storage module 1507 is configured to store the number of market data in the corresponding sub-cache unit of the cache unit according to the periods involved in the number of market data;
[0132] The fourth acquisition module 1508 is configured to acquire the market data in a specific market period pushed by the background service. The specific market period includes any one of the following: the intraday period, the pre-market period, the after-hours period, and the night trading period;
[0133] The second storage module 1509 is configured to store the market data in the specific market period in the corresponding sub-cache unit of the cache unit according to the periods involved in the specific market period, and update the historical market data stored in the cache unit, so that the number of market data stored in the cache unit is the number of market data;
[0134] Wherein, the cache unit includes: a first sub-cache unit, a second sub-cache unit, and a third sub-cache unit;
[0135] The first sub-cache unit is used to store the market data in the intraday period;
[0136] The second sub-cache unit is used to store the market data in the intraday period, the pre-market period, and the after-hours period;
[0137] The third sub-cache unit is used to store the market data in the intraday period, the pre-market period, the after-hours period, and the night trading period;
[0138] The second acquisition module 1503 is specifically configured to:
[0139] Obtain the target market data for the target market period from the cache unit.
[0140] In one embodiment, the execution trading module 1504 is specifically configured to:
[0141] Obtain the trading setting period of the preset strategy operation in the quantitative trading strategy, and the target actual execution period of the trading operation;
[0142] Determine the target trading execution period according to the trading setting period and the target actual execution period;
[0143] Construct a target order and submit the target order to the exchange server corresponding to the target trading execution period.
[0144] In one embodiment, the trading setting period includes any one of the following: the first trading setting period, the second trading setting period, the third trading setting period, the fourth trading setting period. The first trading setting period includes the intraday period, the second trading setting period includes the intraday period, the pre-market period and the after-hours period, the third trading setting period includes the intraday period, the pre-market period, the after-hours period and the night trading period, and the fourth trading setting period includes the night trading period;
[0145] The execution trading module 1504 is specifically configured to:
[0146] Obtain the second mapping relationship between the trading setting period, the actual execution period and the trading execution period;
[0147] Determine the target trading execution period based on the second mapping relationship according to the trading setting period and the target actual execution period.
[0148] In one embodiment, the execution trading module 1504 is specifically configured to:
[0149] Submit the target order to the downstream brokerage server through the client order interface;
[0150] Process the target order through the downstream brokerage server and route the processed target order to the clearing house;
[0151] Verify the processed target order through the clearing house and route the target order after the verification operation to the exchange server corresponding to the target trading execution period for trading.
[0152] In one embodiment, the execution trading module 1504 is specifically configured to:
[0153] Obtain the order term of the target order;
[0154] In response to the order expiration date being the same day, the target order is cached through the downstream brokerage server. In response to reaching the target trading execution period, the target order is routed to the corresponding exchange server for trading. If the trading is not successful by the end of the target trading execution period, a cancellation operation is performed on the target order.
[0155] In response to the order expiration date being the expiration date before cancellation, the target order is cached through the downstream brokerage server. In response to reaching the target trading execution period, the target order is routed to the corresponding exchange server for trading. If the trading is not successful by the end of the target trading execution period, in response to reaching the target trading execution period on the next trading day, the target order is routed to the corresponding exchange server for trading until a cancellation operation for the target order by the target user is obtained.
[0156] It should be understood that the device embodiments and method embodiments can correspond to each other, and similar descriptions can refer to the method embodiments. To avoid repetition, they will not be elaborated here. Specifically, Figure 15 The illustrated device 1500 can execute the above method embodiments, and the foregoing and other operations and / or functions of each module in the device 1500 respectively implement the corresponding processes in the above various methods. For the sake of brevity, they will not be elaborated here.
[0157] The device 1500 of the embodiments of the present application has been described above from the perspective of functional modules in combination with the drawings. It should be understood that the functional modules can be implemented in hardware form, can also be implemented by instructions in software form, or can be implemented by a combination of hardware and software modules. Specifically, the steps of the method embodiments in the embodiments of the present application can be completed by the integrated logic circuit in the hardware in the processor and / or instructions in software form. The steps of the method disclosed in combination with the embodiments of the present application can be directly embodied as being executed and completed by the hardware decoding processor, or can be executed and completed by a combination of the hardware and software modules in the decoding processor. Optionally, the software module can be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc. This storage medium is located in the memory, and the processor reads the information in the memory and combines its hardware to complete the steps in the above method embodiments.
[0158] Figure 16 It is a schematic diagram of an electronic device 1600 provided by the embodiments of the present application.
[0159] As Figure 16 shown, the electronic device 1600 may include:
[0160] A memory 1610 and a processor 1620, where the memory 1610 is used to store a computer program and transmit the program code to the processor 1620. In other words, the processor 1620 can call and run the computer program from the memory 1610 to implement the method in the embodiments of the present application.
[0161] For example, the processor 1620 can be used to execute the above method embodiments according to the instructions in the computer program.
[0162] In some embodiments of the present application, the processor 1620 may include but is not limited to:
[0163] 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, discrete hardware components, and the like.
[0164] In some embodiments of the present application, the memory 1610 includes but is not limited to:
[0165] A volatile memory and / or a non-volatile memory. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable ROM (PROM), an erasable programmable ROM (EPROM), an electrically erasable programmable ROM (EEPROM), or a flash memory. The volatile memory can be a 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 RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synch link DRAM (SLDRAM), and direct rambus RAM (DR RAM).
[0166] In some embodiments of the present application, the computer program may be divided into one or more modules, which are stored in the memory 1610 and executed by the processor 1620 to complete the method provided by the present application. The one or more modules may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program in the electronic device.
[0167] As Figure 16 shown, the electronic device may further include:
[0168] A transceiver 1630, which may be connected to the processor 1620 or the memory 1610.
[0169] Among them, the processor 1620 can control the transceiver 1630 to communicate with other devices. Specifically, it can send information or data to other devices, or receive information or data sent by other devices. The transceiver 1630 may include a transmitter and a receiver. The transceiver 1630 may further include an antenna, and the number of antennas may be one or more.
[0170] It should be understood that each component in the electronic device is connected through a bus system. Among them, the bus system includes not only a data bus, but also a power bus, a control bus, and a status signal bus.
[0171] The present application also provides a computer storage medium, on which a computer program is stored. When the computer program is executed by the computer, the computer can execute the method of the above method embodiment. Or rather, the embodiment of the present application also provides a computer program product including instructions. When the instructions are executed by the computer, the computer executes the method of the above method embodiment.
[0172] When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the computer can perform all or part of the corresponding processes in the methods of the embodiments of the present application and generate the functions achievable by the methods of the embodiments of the present application. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (such as coaxial cable, optical fiber, Digital Subscriber Line (DSL)) or wirelessly (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or a data center that integrates one or more available media. The available medium can be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a Digital Video Disc (DVD)), or a semiconductor medium (such as a Solid State Disk (SSD)), etc.
[0173] Those of ordinary skill in the art can realize that the modules and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented by electronic hardware or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. A professional technician can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
[0174] In several embodiments provided in the present application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules is only a logical function division. In actual implementation, there can be other division methods. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces, and the indirect couplings or communication connections of the devices or modules can be in an electrical, mechanical, or other form.
[0175] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed across multiple network elements. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. For example, in each embodiment of the present application, each functional module can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module.
Claims
1. A data processing method for quantitative trading, characterized in that: include: In response to an operation on a quantitative trading strategy, obtaining a market setting period of a market indicator indicated by a preset strategy condition in the quantitative trading strategy, and a target actual operation period of the quantitative trading strategy; Determine a target market time period according to the market setting time period and the target actual operation time period; Obtaining target market data of the trading object in the quantitative trading strategy during the target market period, and obtaining the index value of the market index according to the target market data; In response to the indicator value of the market indicator satisfying the preset strategy condition of the quantitative trading strategy, triggering the execution of the trading operation indicated by the preset strategy operation in the quantitative trading strategy.
2. The method according to claim 1, characterized in that The market setting period includes any of the following: a first market setting period, a second market setting period, and a third market setting period. The first market setting period includes an intraday period, the second market setting period includes an intraday period, a pre-market period, and a post-market period, and the third market setting period includes an intraday period, a pre-market period, a post-market period, and a night market period. Determining the target market time period according to the market setting time period and the target actual operation time period includes: Acquire a first mapping relationship between the market setting period, the actual operation period and the market period; According to the market setting period and the target actual operation period, the target market period is determined based on the first mapping relationship.
3. The method according to claim 1, characterized in that Before acquiring the target market data in the target market period, the method further includes: Obtain the amount of market data required to calculate the market indicator; Pull the market data quantity from the backend service; According to the time periods involved in the number of market data, the number of market data is stored in the sub-cache unit corresponding to the cache unit; Obtaining market data for a specific market period pushed by the background service, wherein the specific market period includes any one of the following: intraday period, pre-market period, post-market period, and night market period; According to the time period involved in the specific market period, the market data under the specific market period is stored in the sub-cache unit corresponding to the cache unit, and the historical market data stored in the cache unit is updated so that the data quantity of the market data stored in the cache unit is the market data quantity; Wherein, the cache unit includes: a first sub-cache unit, a second sub-cache unit and a third sub-cache unit; The first sub-cache unit is used to store market data during the intraday period; The second sub-cache unit is used to store market data in the intraday period, the pre-market period and the post-market period; The third sub-cache unit is used to store market data in the intraday period, pre-market period, post-market period and night market period; The step of obtaining target market data in the target market period includes: The target market data in the target market period is obtained from the cache unit.
4. The method according to any one of claims 1 to 3, characterized in that: The executing of the trading operation indicated by the preset strategy operation in the quantitative trading strategy includes: Obtaining the trading setting period of the preset strategy operation in the quantitative trading strategy and the target actual execution period of the trading operation; Determining a target transaction execution period according to the transaction setting period and the target actual execution period; Construct a target order, and submit the target order to the exchange server corresponding to the target transaction execution period.
5. The method according to claim 4, characterized in that The trading setting period includes any one of the following: a first trading setting period, a second trading setting period, a third trading setting period, and a fourth trading setting period. The first trading setting period includes an intraday period, the second trading setting period includes an intraday period, a pre-market period, and a post-market period, the third trading setting period includes an intraday period, a pre-market period, a post-market period, and a night market period, and the fourth trading setting period includes a night market period; The step of determining the target transaction execution period according to the transaction setting period and the target actual execution period includes: Acquire a second mapping relationship between the transaction setting period, the actual execution period and the transaction execution period; According to the transaction setting period and the target actual execution period, the target transaction execution period is determined based on the second mapping relationship.
6. The method according to claim 4, characterized in that Submitting the target order to the exchange server corresponding to the target transaction execution period includes: Submit the target order to the downstream brokerage server through the client order interface; Processing the target order through the downstream brokerage server and routing the processed target order to the clearing house; The processed target order is verified through the clearing house, and the target order after the verification operation is routed to the exchange server corresponding to the target transaction execution period for trading.
7. The method according to claim 4, characterized in that Submitting the target order to the exchange server corresponding to the target transaction execution period includes: Obtaining the order period of the target order; In response to the order term being the validity term of the day, the target order is cached through the downstream brokerage server, and in response to reaching the target transaction execution period, the target order is routed to the corresponding exchange server for trading; if the transaction is not successful at the end time of the target transaction execution period, the target order is cancelled; In response to the order term being the validity period before cancellation, the target order is cached by the downstream brokerage server, and in response to reaching the target transaction execution period, the target order is routed to the corresponding exchange server for trading; if the transaction is not successful at the end time of the target transaction execution period, then in response to reaching the target transaction execution period on the next trading day, the target order is routed to the corresponding exchange server for trading until a cancellation operation of the target order by the target user is obtained.
8. A data processing device for quantitative trading, characterized in that: include: A first acquisition module is used to obtain, in response to an operation on a quantitative trading strategy, a market setting period of a market indicator indicated by a preset strategy condition in the quantitative trading strategy and a target actual operation period of the quantitative trading strategy; A first determination module is used to determine a target market period according to the market setting period and the target actual operation period; A second acquisition module is used to acquire the target market data of the trading object in the quantitative trading strategy in the target market period, and acquire the index value of the market index according to the target market data; The transaction execution module is used to trigger the execution of the transaction operation indicated by the preset strategy operation in the quantitative trading strategy in response to the indicator value of the market indicator satisfying the preset strategy condition of the quantitative trading strategy.
9. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 7 by executing the executable instructions.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Transaction data processing method and device, electronic equipment and storage medium
CN121120121A
Data processing method and apparatus for quantitative trading, and device
WO2026157589A1