An adaptive processing method and system for quantifying transaction data
Patent Information
- Application Number
- CN202610936284.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-26
- Publication Date
- 2026-09-18
AI Technical Summary
[0004]现有技术中的量化交易系统在处理多时段行情数据时,通常采用固定的时段配置方式,即由用户手动指定策略仅在某个特定时段运行或简单地将多个时段的数据进行拼接处理,这种固定配置方式存在多方面的技术缺陷:首先,策略对行情数据的需求是动态变化的,市场状态会随着时间推移而产生波动率突变、流动性萎缩等实时变化,固定时段配置无法根据这些市场状态进行自适应调整,导致策略计算所使用的行情数据与当前市场环境不匹配,进而造成策略信号质量下降;其次,传统系统在满足交易条件后会立即执行订单,完全忽略了不同时间点下交易执行成本的显著差异,在市场流动性不足或波动剧烈时盲目提交订单,将产生不必要的滑点损失,尤其对于大额订单或高换手率策略而言,这种执行方式会显著增加交易成本、影响策略整体收益;再次,现有技术缺乏对多级滑窗缓存的自适应管理能力,无法根据策略特性动态调整行情数据的保留范围,导致计算资源浪费或数据不足;最后,缺乏智能的执行成本预测和择时机制,无法在多个候选时间点中选择最优的执行时机,这些技术问题共同制约了量化交易系统的性能发挥和策略收益
[0016] Compared with existing technologies, the advantages of this invention are as follows: By introducing a time-period sensitivity parameter and an adaptive time-period decision model, this invention enables quantitative trading systems to dynamically determine the required time-period range of market data based on the strategy's own characteristics and the real-time market state, thereby solving the technical problem that fixed time-period configurations cannot adapt to changes in market conditions. First, the time-period sensitivity parameter quantitatively characterizes the strategy's preference weight for the timeliness of market data relative to its stability, providing a reliable input basis for subsequent adaptive decision-making. Second, the adaptive time-period decision model, trained based on historical data, can learn the correlation between market characteristics and strategy returns in different time periods, thus outputting the optimal combination of market time periods based on the current market state during runtime. Third, the multi-level sliding window cache dynamically adjusts the data retention range according to the time-period sensitivity parameter, ensuring sufficient data for strategy calculation while avoiding unnecessary data storage overhead. In summary, this invention achieves adaptive quantitative trading data processing, significantly improving strategy signal quality and data utilization efficiency.
Smart Images

Figure CN122779976A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of financial data processing, and in particular to an adaptive processing method and system for quantitative trading data. Background Technology
[0002] With the continuous development of the global financial market and the continuous advancement of computer technology, quantitative trading, as an automated trading method based on mathematical models and massive market data, captures market trading opportunities through pre-set strategy programs and has become an important part of the modern financial market. Quantitative trading systems, by connecting to exchange market data and trading channels, can complete the calculation and analysis of massive amounts of data and order execution within milliseconds, greatly improving trading efficiency and objectivity.
[0003] In practice, quantitative trading systems need to process market data from different trading sessions. As global exchanges have opened up multiple non-mainstream trading sessions such as pre-market, after-market, and night trading, the trend of 24-hour continuous trading has become increasingly prominent. There are huge differences in market liquidity, volatility, and market data characteristics in different trading sessions. For example, pre-market sessions usually have low liquidity and high volatility, while intraday sessions have relatively sufficient liquidity and more stable price trends.
[0004] Existing quantitative trading systems typically employ fixed time-period configurations when processing multi-period market data. This means users manually specify that a strategy runs only during a particular time period or simply concatenate data from multiple time periods. This fixed configuration approach has several technical drawbacks: First, the strategy's demand for market data is dynamic. Market conditions change in real time, with volatility spikes and liquidity shrinking. Fixed time-period configurations cannot adaptively adjust to these market conditions, leading to a mismatch between the market data used for strategy calculations and the current market environment, thus degrading the quality of strategy signals. Second, traditional systems execute orders immediately upon meeting trading conditions. First, it completely ignores the significant differences in transaction execution costs at different points in time. Blindly submitting orders when market liquidity is insufficient or volatility is high will result in unnecessary slippage losses. This is especially true for large orders or high-turnover strategies, where this execution method will significantly increase transaction costs and affect the overall strategy returns. Second, current technology lacks the ability to adaptively manage multi-level sliding window caching, and cannot dynamically adjust the range of market data retention according to strategy characteristics, leading to wasted computing resources or insufficient data. Finally, the lack of intelligent execution cost prediction and timing mechanisms makes it impossible to select the optimal execution time from multiple candidate time points. These technical problems collectively restrict the performance and strategy returns of quantitative trading systems.
[0005] In view of the shortcomings of existing technologies, such as fixed time period configuration, unstable signal quality, inappropriate order execution timing, and lack of adaptive capabilities, the proposed adaptive processing method and system for quantitative trading data in this invention is particularly important. Summary of the Invention
[0006] The purpose of this invention is to provide an adaptive processing method and system for quantitative trading data, which solves the problems mentioned in the background art.
[0007] This invention is implemented as follows: an adaptive processing method for quantitative trading data, comprising the following steps: S1, in response to the start command of a target quantitative trading strategy, obtaining a time-sensitivity parameter of the strategy, wherein the time-sensitivity parameter characterizes the strategy's preference weight for the timeliness of market data relative to data stability; S2, obtaining the current market state feature vector in real time, wherein the state feature vector includes at least: the basic trading time period category to which the current moment belongs, the historical volatility within the most recent preset time window, and the buy / sell depth of the current order book; S3, inputting the time-sensitivity parameter and the market state feature vector into a pre-trained adaptive time-period decision model, wherein the model dynamically outputs a target market time period combination, wherein the target market time period combination includes one or more time periods with continuous or non-continuous time intervals; S4, based on the target market time period combination, from... The corresponding market data is extracted from the dynamically maintained multi-level sliding window cache, and the technical indicator values required by the quantitative trading strategy are calculated based on the extracted market data; wherein, the data retention length and time coverage of the multi-level sliding window cache are adaptively adjusted according to the time period sensitivity parameter; S5, when the technical indicator value meets the preset trigger condition of the quantitative trading strategy, an order to be executed is generated and stored in an execution queue with a timestamp; S6, a pre-trained execution cost prediction model is called, and the current market microstructure data, the order information of the order to be executed, and the expected market state of multiple candidate execution time points in the future are input to predict the expected execution cost of each candidate time point; S7, the candidate time point with the lowest expected execution cost is selected as the target execution time point, and when the target execution time point is reached, the order to be executed is submitted to the exchange server.
[0008] Preferably, step S4 specifically includes the following steps: S41, obtaining the minimum amount of market data required for calculating the technical indicators of the quantitative trading strategy; S42, determining an initial time window backward from the current time; S43, dynamically adjusting the window length according to the time sensitivity parameter based on the time preference value, wherein the larger the time preference value, the shorter the window, indicating a greater preference for using recent data; S44, retaining all market data in the cache whose timestamps are within the adjusted window range, and clearing or archiving the remaining data; S45, when new market data is received, adding it to the cache and repeating the above adjustment process to keep the cache in a dynamic sliding window state.
[0009] Preferably, the adaptive time period decision model is a supervised learning model based on gradient boosting tree, and its training samples include: historical time period sensitivity parameters, historical market state feature vectors, and optimal market time period labels determined by manual annotation or backtesting.
[0010] Preferably, the execution cost prediction model is a time-series prediction model based on a long short-term memory network. Its input features include: the order's buy / sell direction, quantity, limit price, the current bid and ask prices and quantities, the average slippage under the same basic trading period in the past preset trading days, and the expected volatility at the prediction time point. The output is the expected execution cost.
[0011] Preferably, step S7 specifically includes the following steps: S71, continuously monitor real-time changes in market status before the target execution time point arrives; S72, when a drastic change in market status is detected that causes a significant increase in the original forecast cost, trigger the re-forecasting process; S73, re-execute step S6, and update the expected execution cost of each candidate time point based on the latest market data; S74, based on the updated expected execution cost, reselect the optimal candidate time point as the new target execution time point, and update the timestamp information in the queue to be executed.
[0012] Preferably, the market state feature vector further includes the following features: market bid-ask spread, deviation of volume-weighted average price from the latest transaction price, market order flow imbalance, and historical average volatility for the current period.
[0013] Preferably, the target market time period combination output by the adaptive time period decision model can be a single continuous time period or a combination of multiple non-continuous time periods. The model autonomously determines the division of time periods based on strategy characteristics and the current market state.
[0014] Preferably, the multi-level sliding window cache adopts a hierarchical storage architecture. The first layer stores the raw market data within the most recent preset time range, the second layer stores the preprocessed aggregated market data, and the third layer stores the intermediate result data used for strategy calculation. The data in each layer is dynamically updated according to the timeliness requirements.
[0015] A quantitative trading data processing system for implementing the above method includes: a parameter acquisition module for acquiring time-period sensitivity parameters of the strategy; a market monitoring module for acquiring market state feature vectors in real time; an adaptive decision-making module for running a pre-trained time-period decision-making model and outputting a target market time-period combination; a dynamic cache management module for managing multi-level sliding window caches and adjusting the cache range according to the sensitivity parameters; a strategy execution engine for calculating technical indicators and generating orders to be executed; a cost prediction and timing module for predicting execution costs and determining the optimal submission time; and an order submission module for sending orders to the exchange at the target time.
[0016] Compared with existing technologies, the advantages of this invention are as follows: By introducing a time-period sensitivity parameter and an adaptive time-period decision model, this invention enables quantitative trading systems to dynamically determine the required time-period range of market data based on the strategy's own characteristics and the real-time market state, thereby solving the technical problem that fixed time-period configurations cannot adapt to changes in market conditions. First, the time-period sensitivity parameter quantitatively characterizes the strategy's preference weight for the timeliness of market data relative to its stability, providing a reliable input basis for subsequent adaptive decision-making. Second, the adaptive time-period decision model, trained based on historical data, can learn the correlation between market characteristics and strategy returns in different time periods, thus outputting the optimal combination of market time periods based on the current market state during runtime. Third, the multi-level sliding window cache dynamically adjusts the data retention range according to the time-period sensitivity parameter, ensuring sufficient data for strategy calculation while avoiding unnecessary data storage overhead. In summary, this invention achieves adaptive quantitative trading data processing, significantly improving strategy signal quality and data utilization efficiency.
[0017] Furthermore, the introduction of the execution cost prediction model transforms order execution from passive waiting to proactive timing. This model, based on a Long Short-Term Memory (LSTM) network, fully learns the temporal correlation between market microstructure characteristics and execution costs, accurately identifying the execution opportunity with the lowest expected cost among multiple candidate time points. This effectively avoids slippage losses caused by blindly submitting orders in traditional systems when market liquidity is insufficient or volatility is high. Especially for large orders or high-turnover strategies, it significantly reduces transaction costs and improves overall strategy returns.
[0018] Furthermore, the introduction of a re-forecasting mechanism enhances the system's robustness. This mechanism monitors market conditions in real time, and automatically triggers a re-forecasting process and updates the target execution time point when it detects a significant increase in the original forecast cost due to drastic market fluctuations. This dynamic adjustment capability ensures the continuous accuracy of execution cost forecasts, enabling the system to adapt to instantaneous market changes and avoiding unnecessary losses caused by sudden market changes.
[0019] Furthermore, the multi-level sliding window cache's tiered storage architecture achieves efficient utilization of storage resources by differentiating the timeliness requirements of data at different levels. The first layer retains the original data with high timeliness to meet the computational needs of high-frequency strategies. The second layer stores aggregated data to support the calculation of indicators for medium- and long-term strategies. The third layer saves intermediate results to accelerate the strategy iteration process. The update frequency of data in each layer is dynamically adjusted according to the time-sensitivity parameter, which significantly reduces storage overhead and computational burden while ensuring computational accuracy. Attached Figure Description
[0020] Figure 1 This is a schematic diagram of the overall technical architecture of an adaptive processing method and system for quantitative trading data. Figure 2 This is a schematic diagram of the core principle framework of an adaptive time-period decision-making and intelligent timing mechanism based on time-period sensitivity parameters in an adaptive processing method for quantitative trading data. Detailed Implementation
[0021] To further illustrate the technical means and effects of the present invention in achieving its intended purpose, the following detailed description of the specific implementation methods, structures, features, and effects of the present invention, in conjunction with the accompanying drawings and preferred embodiments, is provided below.
[0022] Example 1 This embodiment uses the domestic A-share market as an example to explain in detail the specific implementation process of the adaptive processing method for quantitative trading data proposed in this invention. In this embodiment, it is assumed that the target quantitative trading strategy is an intraday short-term trading strategy based on the mean reversion principle. This strategy is highly sensitive to the timeliness of market data and prefers to use recent data to calculate indicators in order to capture short-term price fluctuation opportunities.
[0023] In step S1, when the quantitative trading system receives the start command of the target quantitative trading strategy, the parameter acquisition module immediately extracts the pre-configured time-sensitivity parameter of the strategy from the strategy configuration database. The time-sensitivity parameter includes multiple dimensions, the most important of which is the ratio between the timeliness preference value and the time stability preference value. In this embodiment, the timeliness preference value is set to 0.8, and the time stability preference value is set to 0.2, meaning that the strategy clearly favors timeliness over data stability. Furthermore, the time-sensitivity parameter also includes a minimum data volume threshold parameter, which specifies the minimum number of market data points required for the strategy to calculate technical indicators; in this embodiment, this threshold is set to 50 data points. Additionally, the parameter includes a historical window baseline parameter, used to determine the baseline length of the initial time window; in this embodiment, this parameter is set to 300 seconds.
[0024] In step S2, the market monitoring module obtains the current market state feature vector in real time through the exchange's market data interface. The process of obtaining the market state feature vector is as follows: First, by parsing the timestamp field in the market data stream, the basic trading session category to which the current moment belongs is determined. In this embodiment, the system divides trading sessions into four basic categories: pre-market session, morning trading session, midday break session, and afternoon trading session. Each basic category corresponds to a unique category identifier in the system; for example, the pre-market session corresponds to identifier 0, the morning trading session to identifier 1, the midday break session to identifier 2, and the afternoon trading session to identifier 3. Second, the system calculates the historical volatility within the most recent 300-second time window. The specific calculation method is as follows: extract the return series of all transaction prices within the time window, calculate the standard deviation of the series, and annualize it to obtain the historical volatility value. In this embodiment, the historical volatility calculation result for the current moment is 0.025, indicating an annualized volatility of 2.5%. Next, the system reads the order book depth information from the current order book. This information includes the order prices and quantities for the top ten bids and asks. In this embodiment, the order quantity corresponding to the top bid price is 1200 lots, the order quantity corresponding to the top ask price is 800 lots, the total bid depth is 15000 lots, and the total ask depth is 12000 lots.
[0025] In addition to the core features mentioned above, the market state feature vector in this embodiment also includes the following extended features: the market bid-ask spread is calculated by dividing the difference between the current best ask price and the best bid price by the bid-ask midpoint. In this embodiment, the value is 0.0008, representing a spread of 8 basis points; the deviation between the volume-weighted average price and the latest transaction price is obtained by calculating the ratio of the difference between the two to the latest transaction price. In this embodiment, the value is 0.0012; the market order flow imbalance is obtained by comparing the ratio of the volume of active buying to the volume of active selling in the last 100 transactions. In this embodiment, the value is 1.15, indicating that the buy order flow is slightly dominant; the historical average volatility of the current period is obtained by statistically analyzing the price volatility of the same trading period over the past 20 trading days and taking the average value. In this embodiment, the value is 0.018.
[0026] In step S3, the adaptive decision-making module combines the time-period sensitivity parameters obtained in step S1 with the market state feature vector obtained in step S2 to form a complete input feature vector, which is then input into the pre-trained adaptive time-period decision-making model. This model is built based on the gradient boosting tree algorithm and contains multiple decision tree nodes. Each node makes conditional judgments based on the values of the input features and passes the judgments down the tree. Finally, the leaf nodes output the identification information of the target market time-period combination.
[0027] The specific operation of the model is as follows: First, the timeliness preference value of 0.8 is input into the first-level decision node of the model. This node determines that the value is greater than 0.5, so the decision path enters the branch focusing on timeliness. Under this branch, the model further judges the relationship between the current historical volatility of 0.025 and the volatility threshold of 0.02. Since 0.025 is greater than 0.02, the decision path enters the high volatility branch. Under the high volatility branch, the model judges that the bid-ask depth ratio is 15000 divided by 12000, which equals 1.25. Since this value is greater than 1.1, the decision path enters the sufficient liquidity branch. Finally, the model combines the current basic trading session category (morning trading session identifier 1) with all the above judgment conditions, and determines the target market time period combination in the model's output layer as the most recent 120-second time period. This time period goes back 120 seconds from the current moment and ends at the current moment, forming a continuous time interval.
[0028] The output of the target market time period combination also includes a validity label, which indicates the confidence level of the output result. In this embodiment, because the input feature vector has high integrity and all judgment conditions can be clearly matched, the confidence level of the model output is high.
[0029] In step S4, the dynamic cache management module extracts the corresponding market data from the multi-level sliding window cache based on the target market time period combination output in step S3. The multi-level sliding window cache adopts a hierarchical storage architecture, and its specific structure and working principle are as follows: The first layer is the raw data layer, storing all raw market data within the most recent 600 seconds, including tick-by-tick transaction data, tick-by-tick order data, and market snapshot data. In this embodiment, the first layer stores all raw market data within the 600 seconds preceding the current moment, totaling approximately 8,000 records. The second layer is the aggregated data layer, storing preprocessed aggregated market data, including candlestick data for different time periods such as 1 second, 5 seconds, 15 seconds, and 60 seconds, as well as volume-weighted average price data at the minute and hourly levels. In this embodiment, the second layer stores the OHLCV values of candlestick data for each period, namely the five core fields: opening price, highest price, lowest price, closing price, and volume. The third layer is the intermediate result layer, storing intermediate result data used for strategy calculation, including intermediate calculated values of various technical indicators, normalized feature vectors, and pre-calculated feature statistics.
[0030] When retrieving data, the dynamic cache management module first determines the time range of 120 seconds based on the target market time period combination, and then determines the starting time of this range as the current time minus 120 seconds. Next, the management module sends a data retrieval request to the first-layer storage engine, including the time range parameter of 120 seconds and the starting time parameter. Upon receiving the request, the storage engine scans all original market data records in the first layer whose timestamps fall within the range from the starting time to the current time, and retrieves these records. In this embodiment, a total of 1200 original market data records meet the time range condition.
[0031] The extracted raw market data is then fed into the strategy execution engine for technical indicator calculations. Based on the requirements of the mean reversion strategy, the strategy execution engine calculates the following technical indicators: Moving Average indicator, which calculates the volume-weighted average price over the last 120 seconds as the mean reference line; Price Deviation indicator, which calculates the degree of deviation between the latest transaction price and the mean; Volatility indicator, which calculates the standard deviation of the return series over the last 120 seconds; and Momentum indicator, which calculates the first difference of price changes over the last 120 seconds.
[0032] In this embodiment, the calculated technical indicator values are as follows: the volume-weighted average price is 10.25 yuan, the latest transaction price is 10.32 yuan, the price deviation is 0.0068, the volatility is 0.0032, and the momentum indicator is 0.07.
[0033] The process of adaptively adjusting the data retention length and time coverage range of the multi-level sliding window cache based on the time period sensitivity parameter is as follows: First, the minimum amount of market data required for the strategy to calculate technical indicators is obtained, which is read from the strategy configuration as 50 data points. Second, an initial time window is determined backward from the current time, and the length of this window is determined by the historical window baseline parameter, which is 300 seconds in this embodiment. Third, the window length is dynamically adjusted according to the timeliness preference value in the time period sensitivity parameter. Since the timeliness preference value is 0.8, the system uses a specific adjustment logic to shorten the window length to one-fifth of the original, resulting in an adjusted window length of 60 seconds. Finally, all market data with timestamps within the adjusted window range are retained in the cache, while data with timestamps outside the range are cleared or archived to the historical database. When new market data is received, the system adds it to the cache and repeats the above adjustment process to keep the cache in a dynamic sliding window state.
[0034] In step S5, the strategy execution engine compares the calculated technical indicator values with preset trigger conditions. The trigger conditions include the following logic: a buy signal is generated when the price deviation is greater than 0.005 and the momentum indicator is greater than 0.05; a sell signal is generated when the price deviation is less than -0.005 and the momentum indicator is less than -0.05. In this embodiment, the price deviation is 0.0068, which is greater than 0.005, and the momentum indicator is 0.07, which is greater than 0.05, thus satisfying the buy signal trigger condition.
[0035] The strategy execution engine generates orders to be executed based on this information. Each order contains the following key information: order direction is buy, order quantity is 10,000 shares, limit price is 10.35 yuan, order type is a limit order, and order validity is valid for the current day. After generating an order, the system assigns it a unique identifier and stores it at the tail of the execution queue. Each order in the execution queue has a timestamp accurate to milliseconds, recording the order's generation time. In this embodiment, the order's generation timestamp is 10:30:25.123 milliseconds on March 15, 2024.
[0036] In step S6, the cost prediction and timing module calls the pre-trained execution cost prediction model to predict the expected execution cost for each candidate execution time point. The execution cost prediction model is built on a long short-term memory network, which can learn the temporal correlation between market microstructure characteristics and execution costs.
[0037] The process of acquiring model input features is as follows: First, acquire current market microstructure data, including the bid and ask prices and quantities in the current order book, the depth distribution of each bid and ask level, the current transaction price, the average transaction speed over the past 60 seconds, and the current bid-ask spread. In this embodiment, the bid price is 10.32 yuan corresponding to a quantity of 800 lots, and the ask price is 10.33 yuan corresponding to a quantity of 1200 lots. Second, acquire the order information of the orders to be executed, including the order direction as buy, the order quantity as 10,000 shares, and the limit price as 10.35 yuan. Third, determine the set of candidate execution time points. The system calculates backward from the current time point to generate multiple candidate time points, namely the current time, 30 seconds after the current time, 60 seconds after the current time, 90 seconds after the current time, and 120 seconds after the current time. For each candidate time point, the system needs to predict the expected market state at that time point, including expected volatility, expected liquidity changes, and expected spread changes.
[0038] The model works as follows: all the input features are combined into a feature vector, which is then input into the network layer of a Long Short-Term Memory (LSTM) network. The network layer contains multiple memory units, each capable of remembering and forgetting specific market feature patterns based on historical information. After temporal processing by the network layer, the model outputs the expected execution cost for each candidate time point. In this embodiment, the predicted execution cost for each candidate time point is as follows: the expected execution cost at the current time is 15 basis points; the expected execution cost 30 seconds after the current time is 12 basis points; the expected execution cost 60 seconds after the current time is 8 basis points; the expected execution cost 90 seconds after the current time is 10 basis points; and the expected execution cost 120 seconds after the current time is 14 basis points.
[0039] In step S7, the cost prediction and timing module compares the expected execution cost values of each candidate time point and selects the candidate time point with the lowest expected execution cost as the target execution time point. In this embodiment, the expected execution cost 60 seconds after the current time is 8 basis points, which is the lowest among all candidate time points, so this time point is determined as the target execution time point.
[0040] The order submission module continuously monitors the system clock before the target execution time arrives. When the system clock reaches the target execution time, i.e., 60 seconds after the current time, the order submission module sends the order to be executed to the exchange server through the trading channel interface. The specific process of order sending is as follows: First, the order submission module converts the format of the order to be executed into the FIX protocol format required by the exchange or other specified protocol format. Then, it sends the order message to the exchange trading system through the network interface. After receiving the order, the exchange system returns an order receipt confirmation message, which contains the order number assigned by the exchange. In this embodiment, the order was successfully submitted to the exchange system, and the order number returned by the exchange is 2024031510300001.
[0041] Furthermore, in step S7, the system also implements a re-prediction mechanism to cope with drastic changes in market conditions. The triggering conditions for the re-prediction mechanism are as follows: Before the target execution time point is reached, the system checks the real-time changes in market conditions every 5 seconds. When a drastic change in market conditions is detected, such as the bid-ask spread suddenly expanding to more than twice its original value, or the number of bids suddenly decreasing to more than 50% of its original value, the system determines that the original predicted cost is unreliable. At this time, the system triggers the re-prediction process, re-executing step S6 to update the expected execution cost of each candidate time point based on the latest market data. After the update is completed, the system compares the updated expected execution cost values, reselects the optimal candidate time point as the new target execution time point, and updates the timestamp information of the order in the queue to be executed.
[0042] Example 2 This embodiment uses quantitative trading in the cryptocurrency market as an application scenario to explain in detail the adaptive processing method of the present invention in a 24-hour continuous trading environment. In this embodiment, it is assumed that the target quantitative trading strategy is a mid-frequency trading strategy based on the trend-following principle. This strategy needs to strike a balance between the timeliness and stability of market data. Therefore, the timeliness preference value in its time sensitivity parameter is set to 0.5, which is at a medium level.
[0043] In step S1, the parameter acquisition module extracts the time-sensitivity parameter of the trend-following strategy from the strategy configuration. The strategy's timeliness preference value is set to 0.5, and its time stability preference value is also set to 0.5, maintaining a balance between the two. The minimum data volume threshold parameter is set to 200 data points, and the historical window baseline parameter is set to 1800 seconds. Furthermore, the strategy is configured with a special time-period preference parameter, indicating that the strategy performs relatively stably during Asian and European trading sessions, but fluctuates significantly during American trading sessions; therefore, the model needs to consider this characteristic when making time-period decisions.
[0044] In step S2, the market monitoring module acquires the current market state feature vector in real time. Because the cryptocurrency market trades continuously 24 hours a day, the system's trading sessions are divided more finely, with a day divided into 8 trading sessions, each lasting 3 hours. The session identifiers range from 0 to 7, each corresponding to a different trading session. In this embodiment, the current time belongs to the European trading session, and its identifier is 3.
[0045] The historical volatility calculation window is set to 600 seconds. The calculated current historical volatility is 0.045, which represents an annualized volatility of 4.5%, significantly higher than the volatility level of the A-share market. The order book depth information is obtained in the same way as in Example 1. In this example, the total buy order depth is equivalent to $50,000, and the total sell order depth is equivalent to $45,000.
[0046] The extended features of the market state feature vector include: a bid-ask spread of 0.0005 (5 basis points), a deviation of 0.0008 between the volume-weighted average price and the latest transaction price, an order flow imbalance of 0.95, and a historical average volatility of 0.052 for the current period.
[0047] In step S3, the adaptive decision-making module inputs the time-period sensitivity parameter and the market state feature vector into the adaptive time-period decision-making model. The model's decision-making process fully considers the high volatility characteristics of the cryptocurrency market: First, it determines that the timeliness preference value of 0.5 is at a moderate level, and the decision path enters the equilibrium branch. Then, it determines that the historical volatility of 0.045 is greater than the high volatility threshold of 0.03, and the decision path enters the high volatility processing branch. Under this branch, the model further determines that the current trading session identifier is 3, corresponding to the European trading session, which, according to historical data, indicates good market liquidity but moderate to high volatility. Finally, the model combines the order book depth ratio of 50,000 divided by 45,000, which equals 1.11, and determines that the market liquidity is at a normal level.
[0048] Based on the above criteria, the model outputs a target market time period combination of two non-contiguous time periods: the first period is the most recent 300 seconds, and the second period is the period from 720 seconds to 480 seconds ago. This non-contiguous time period combination design allows the strategy to capture the timeliness of recent data while utilizing data from earlier periods to smooth fluctuations and filter noise.
[0049] The output of the target market time period combination also includes a confidence level label for each time period, with the first segment having a high confidence level and the second segment having a medium confidence level.
[0050] In step S4, the dynamic cache management module extracts data from the multi-level sliding window cache based on the combination of the two non-contiguous time periods mentioned above. Since the strategy is configured with a historical window benchmark of 1800 seconds, the first layer of the multi-level sliding window cache actually stores raw market data within a range of 2400 seconds to ensure that there is enough data available for extraction.
[0051] For the first timeframe (the most recent 300 seconds), the cache management module extracted approximately 3,000 raw market data records. For the second timeframe (from the most recent 720 seconds to 480 seconds ago), the management module filtered by time range and extracted approximately 2,400 raw market data records. The two data sets total approximately 5,400 records, meeting the strategy's minimum data requirement of 200 data points.
[0052] The strategy execution engine calculates the following technical indicators based on the extracted market data: the moving average indicator uses a 20-period simple moving average calculation method; the MACD indicator uses a 12-period minus a 26-period difference line, a 9-period signal line, and a MACD histogram; the trend strength indicator uses the ADX average trend index; and the volatility indicator uses the ATR average true range.
[0053] The calculated technical indicator values are as follows: 20-period simple moving average is $2450.5, MACD difference line is 15.2, MACD signal line is 12.8, MACD histogram is 2.4, ADX is 28.5, and ATR is $68.3.
[0054] The adaptive adjustment process of the multi-level sliding window cache is similar to that in Example 1, but because the timeliness preference value is 0.5, the adjusted window length is 900 seconds, that is, 900 seconds backward from the current moment. This window length is significantly longer than the 60-second window in Example 1, reflecting the trend-following strategy's requirement for data stability.
[0055] In step S5, the strategy execution engine compares the technical indicator values with the trigger conditions. The trigger conditions include: the MACD histogram showing positive and increasing values for three consecutive periods, an ADX value greater than 25, and the current price being greater than the 20-period moving average. A buy signal is generated when all the above conditions are met simultaneously. In this embodiment, the MACD histogram is 2.4, and the previous two periods were 1.8 and 1.2, showing an increasing trend; the ADX value is 28.5, greater than 25; and the current price is $2462.3, greater than the 20-period moving average of $2450.5, satisfying all buy trigger conditions.
[0056] The order information for the pending orders is as follows: order direction is buy, order quantity is 2 virtual currencies, limit price is $2465, order type is limit order, and order validity period is 4 hours.
[0057] In step S6, the cost prediction and timing module calls the execution cost prediction model to make predictions. Because the trading mechanism of the cryptocurrency market differs from that of the stock market, the input features of this model have been adjusted accordingly: liquidity parameters specific to the cryptocurrency have been added to the input features, such as the trading volume and order book depth distribution of the trading pair over the past 24 hours. Furthermore, the candidate time points are also set differently; the system generates six candidate time points: 15 seconds, 30 seconds, 45 seconds, 60 seconds, 90 seconds, and 120 seconds after the current time.
[0058] The model predictions are as follows: the expected execution cost at the current moment is 25 basis points, the expected execution cost 30 seconds after the current moment is 18 basis points, the expected execution cost 45 seconds after the current moment is 12 basis points, the expected execution cost 60 seconds after the current moment is 15 basis points, the expected execution cost 90 seconds after the current moment is 20 basis points, and the expected execution cost 120 seconds after the current moment is 28 basis points.
[0059] In step S7, the system selects the candidate time point with the lowest expected execution cost, i.e., 45 seconds after the current time, as the target execution time point. When the system clock reaches this time point, the order submission module sends the order to the cryptocurrency exchange system. In this embodiment, the exchange immediately performs order verification and fund verification upon receiving the order, and generates an order transaction number after confirming that everything is correct.
[0060] The re-forecasting mechanism also plays a role in this embodiment. The system checks the market status every 3 seconds. When it detects that the order book thickness has changed by more than 40% within 30 seconds or the price difference has changed by more than 1.5 times the original value, it determines that the market status has changed drastically, triggers the re-forecasting process, and updates the target execution time point.
[0061] Example 3 This embodiment uses quantitative trading in the futures market as an application scenario to explain in detail the adaptive processing method of the present invention in leveraged trading instruments. In this embodiment, it is assumed that the target quantitative trading strategy is a pair trading strategy based on the principle of statistical arbitrage. This strategy simultaneously trades two futures contracts with cointegration relationships, such as the CSI 300 index futures and the SSE 50 index futures. The pair trading strategy has high requirements for data stability; therefore, the timeliness preference value in its time sensitivity parameter is set to 0.3, which clearly favors data stability.
[0062] In step S1, the parameter acquisition module extracts the time-sensitivity parameter of the pair trading strategy. The strategy's timeliness preference value is set to 0.3, and its time stability preference value is set to 0.7. The minimum data volume threshold parameter is set to 500 data points, because the pair trading strategy requires sufficient data to calculate the statistical characteristics of the price difference between the two contracts. The historical window benchmark parameter is set to 3600 seconds, i.e., a 1-hour time window.
[0063] In addition, this strategy is configured with special pairing parameters, including the codes of the two contracts, historical values of the cointegration coefficient, and a standard deviation threshold for the price spread. These parameters are used for subsequent price spread calculations and arbitrage opportunity assessment.
[0064] In step S2, the market monitoring module simultaneously acquires the market state feature vectors of two futures contracts. Taking the CSI 300 index futures as an example, the current trading session is the morning session, identified by the symbol 1. The historical volatility over the last 600 seconds is 0.032, the total buy depth in the order book is 800 lots, and the total sell depth is 750 lots. Regarding extended features, the bid-ask spread is 0.0004 (4 basis points), the deviation between the volume-weighted average price and the latest transaction price is 0.0005, the order flow imbalance is 1.08, and the historical average volatility for the current session is 0.028.
[0065] For the SSE 50 index futures, the corresponding market characteristics are as follows: the trading session identifier is 1, the historical volatility is 0.028, the total depth of buy orders is 600 lots, the total depth of sell orders is 550 lots, and the bid-ask spread is 0.0005, or 5 basis points.
[0066] In step S3, the adaptive decision-making model fully considers the characteristics of the paired trading strategy: First, it determines that the timeliness preference value of 0.3 is low, and the decision path enters the branch focusing on stability. Then, it determines that the historical volatility of the two contracts are 0.032 and 0.028, respectively, both at a moderate level without significant fluctuations. Further, it determines that the current trading session is the morning session, and historical data for this session indicates that the market is operating smoothly with ample liquidity. Finally, it determines that the order book depth ratio is close to 1, indicating that market liquidity is in equilibrium.
[0067] Based on the above analysis, the target market time period output by the model is a single continuous time period with a length of 1800 seconds, i.e., 1800 seconds backward from the current moment. This time period covers a sufficiently long period of historical data to meet the data requirements for calculating cointegration relationships and price spread statistical characteristics for paired trading strategies.
[0068] In step S4, the dynamic cache management module extracts market data for the two futures contracts from the multi-level sliding window cache. Approximately 3600 raw market data records are extracted for each contract within an 1800-second timeframe, totaling approximately 7200 records for both contracts.
[0069] The strategy execution engine calculates the following technical indicators based on the extracted data: the closing price sequence of the two contracts, the price spread sequence, the moving average of the price spread, the standard deviation of the price spread, the Z-score (standardized price spread), the estimated cointegration coefficient, and the Hurst index to determine the autocorrelation characteristics of the price spread sequence.
[0070] The calculated technical indicator values are as follows: the closing price of the CSI 300 is 3850.2, the closing price of the SSE 50 is 2680.5, the price difference is 1169.7, the 20-period moving average of the price difference is 1172.3, the standard deviation of the price difference is 15.8, the Z-score is -0.16, the cointegration coefficient is 0.695, and the Hurst index is 0.45.
[0071] The adaptive adjustment process of the multi-level sliding window cache is as follows: the adjusted window length is 2100 seconds, that is, 2100 seconds backward from the current time. Due to the low timeliness preference value, the window length is significantly larger than the previous two embodiments, which reflects the pairing transaction strategy's preference for data stability.
[0072] In step S5, the strategy execution engine compares the technical indicator values with the trigger conditions. The trigger conditions are: when the absolute value of the Z-score is greater than 2.0, it indicates that the price spread deviates from the equilibrium position by more than 2 standard deviations, and there is an arbitrage opportunity. When the Z-score is greater than 2.0, a sell arbitrage signal is generated, i.e., selling the overvalued contract and buying the undervalued contract. When the Z-score is less than -2.0, a buy arbitrage signal is generated, i.e., buying the overvalued contract and selling the undervalued contract.
[0073] In this embodiment, the Z-score is -0.16, and the absolute value is less than 2.0, which does not meet the triggering condition. Therefore, the system does not generate arbitrage orders but continues to monitor.
[0074] In step S6, it is assumed that the system has generated an order to be executed in the previous moment. This order is a sell arbitrage order, which includes selling 1 lot of CSI 300 index futures and buying 2 lots of SSE 50 index futures. The cost prediction and timing module predicts the expected costs for the candidate execution time points of this order.
[0075] The selection of candidate time points takes into account the characteristics of the futures market's trading sessions. During the morning trading session, five candidate time points were set: the current time, 10 seconds, 20 seconds, 30 seconds, and 60 seconds after the current time.
[0076] The model prediction results are as follows: the expected execution cost at the current moment is 30 yuan, the expected execution cost 10 seconds after the current moment is 25 yuan, the expected execution cost 20 seconds after the current moment is 22 yuan, the expected execution cost 30 seconds after the current moment is 28 yuan, and the expected execution cost 60 seconds after the current moment is 35 yuan.
[0077] In step S7, the system selects the candidate time point with the lowest expected execution cost, i.e., 20 seconds after the current time, as the target execution time point. When the target time point arrives, the order submission module sends the arbitrage order to the futures exchange system.
[0078] The application of re-forecasting mechanisms in the futures market requires special attention to contract expiration risk. In addition to monitoring changes in market conditions, the system also monitors changes in the remaining time to expiration of contracts. When changes in the remaining time to expiration cause the position risk parameter to exceed a threshold, the system triggers a re-forecast and may cancel the original order.
[0079] Example 4 This embodiment uses quantitative trading in the Hong Kong stock market as an application scenario to explain in detail the adaptive processing method of the present invention in a mixed trading environment involving both stocks and stock derivatives. In this embodiment, it is assumed that the target quantitative trading strategy is an option hedging strategy based on the volatility arbitrage principle. This strategy simultaneously holds a long position in the underlying stock and a corresponding short position in put options, and obtains volatility spread profits through dynamic hedging. The strategy has high requirements for the timeliness of market data because volatility calculation needs to react quickly to short-term price changes.
[0080] In step S1, the parameter acquisition module extracts the time-sensitivity parameter of the volatility arbitrage strategy. The strategy's timeliness preference value is set to 0.85, and its time stability preference value is set to 0.15, reflecting the strategy's high sensitivity to recent price data. The strategy's minimum data volume threshold parameter is set to 100 data points, and the historical window benchmark parameter is set to 600 seconds.
[0081] The strategy's specific parameters include: option contract codes and expiration months, hedging ratio parameters, volatility calculation window parameters, and Delta threshold parameters. These parameters are used for subsequent volatility calculations and hedging decisions.
[0082] In step S2, the market monitoring module simultaneously acquires the market state feature vectors of the underlying stock and options. Taking Tencent Holdings stock as an example, the current basic trading session is a continuous trading session, identified by the identifier 1. The historical volatility over the last 120 seconds is 0.038, the total buy depth in the order book is 20,000 lots, and the total sell depth is 18,000 lots. Regarding extended features, the bid-ask spread is 0.0006, or 6 basis points.
[0083] The state characteristics of the options market require special attention to implied volatility data. In this embodiment, the system obtained the implied volatility data of a put option with a strike price to underlying asset price ratio of 1.0, which is 0.28, annualized to 28%. It also obtained the historical volatility data of the underlying stock, which is 0.032. The ratio of implied volatility to historical volatility is 0.875.
[0084] In step S3, the adaptive decision-making model's decision-making process is as follows: First, it determines that the timeliness preference value of 0.85 is at an extremely high level, and the decision path enters the branch that highly focuses on timeliness. Then, it determines that the historical volatility of 0.038 is at a moderately high level, requiring a balance to be found between timeliness and stability. Further, it determines that the current trading session is a continuous trading session, during which market liquidity is sufficient but price volatility may be relatively high. Finally, it determines that the order book depth ratio is greater than 1, indicating that buying pressure is slightly dominant.
[0085] After comprehensive evaluation, the model outputs a target market timeframe based on the most recent 60 seconds. This timeframe is very short, primarily intended to capture the latest price movement information for volatility calculation.
[0086] The target market time period combination also includes an auxiliary time period of the most recent 180 seconds to 120 seconds, which is used to compare and verify the stability of the short-term volatility calculation.
[0087] In step S4, the data extraction process of the dynamic cache management module is divided into two parts: the first part extracts about 600 pieces of raw market data from the most recent 60 seconds for calculating short-term volatility; the second part extracts about 600 pieces of raw market data from the most recent 180 to 120 seconds for comparative analysis.
[0088] The strategy execution engine calculates the following technical indicators: short-term volatility is calculated using the return series within a 60-second window to calculate annualized volatility; medium-term volatility is calculated using a 180-second window to calculate annualized volatility; volatility change rate is the ratio of short-term volatility to medium-term volatility; Delta value is calculated using the option pricing model to obtain the first derivative of the option price with respect to the underlying asset price; Gamma value is calculated to obtain the second derivative of the option price with respect to the underlying asset price.
[0089] The calculated technical indicators are as follows: short-term volatility is 0.042, annualized to 42%; medium-term volatility is 0.035, annualized to 35%; volatility change rate is 1.2; Delta is -0.45; and Gamma is 0.08.
[0090] The adaptive adjustment process of multi-level sliding window caching is as follows: The adjusted window length is calculated by multiplying the baseline window length of 600 seconds by the reciprocal of the timeliness preference value. Since the timeliness preference value is high, the window length is significantly compressed and finally adjusted to 120 seconds.
[0091] In step S5, the strategy execution engine compares the technical indicator values with the trigger conditions. The trigger conditions include: when the absolute value of Delta is greater than 0.3, an option hedging operation is required, i.e., buying or selling the corresponding number of underlying shares to bring the Delta value back to a preset threshold range. When the Gamma value is greater than 0.1, it may be necessary to adjust the hedging frequency or use options to hedge Gamma risk.
[0092] In this embodiment, the Delta value is -0.45, and the absolute value is greater than 0.3, which meets the hedging trigger condition. Based on this, the strategy execution engine generates a hedging order: the hedging direction is buy because Delta is negative, so the underlying stock needs to be bought for hedging, and the hedging quantity is 4,500 shares. The calculation method is to multiply the absolute value of Delta by the number of underlying stock holdings and then divide by 100.
[0093] The generated pending order contains the following information: the order direction is buy, the order quantity is 4,500 shares, the limit price is the opening price of the day plus 0.2 yuan, and the order type is an active limit order.
[0094] In step S6, the cost prediction and timing module calls the execution cost prediction model. Since the Hong Kong stock market operates on a T+2 settlement system and supports short selling, the model's input features need to include relevant market microstructure data. The candidate execution time points are set to six points: the current time, 5 seconds, 10 seconds, 15 seconds, 20 seconds, and 30 seconds after the current time.
[0095] The model predictions are as follows: the expected execution cost at the current moment is 20 basis points, the expected execution cost 10 seconds after the current moment is 15 basis points, the expected execution cost 15 seconds after the current moment is 12 basis points, and the expected execution cost 20 seconds after the current moment is 18 basis points.
[0096] In step S7, the system selects the candidate time point with the lowest expected execution cost, i.e., 15 seconds after the current time, as the target execution time point. When the system clock reaches the target time point, the order submission module sends the hedging order to the Hong Kong Stock Exchange system.
[0097] In this embodiment, the re-prediction mechanism needs to pay special attention to sudden market events. The system sets up multiple market status monitoring indicators, including volatility mutation threshold, trading volume mutation threshold, and order book thickness mutation threshold. When any of these indicators triggers a mutation condition, the system immediately triggers the re-prediction process.
[0098] Example 5 This embodiment uses fund market making as an application scenario to explain in detail the adaptive processing method of the present invention in market maker pricing strategies. In this embodiment, it is assumed that the target strategy is a two-sided pricing strategy for market makers, which simultaneously provides buy and sell quotes for multiple ETF products, profiting from the bid-ask spread. The strategy has extremely high requirements for the timeliness of market data, because market makers need to update quotes within milliseconds to reflect market changes.
[0099] In step S1, the parameter acquisition module extracts the time-sensitivity parameter of the market maker strategy. The strategy's timeliness preference value is set to 0.95, and its time stability preference value is set to 0.05, which is the highest timeliness preference value among all types of strategies. The minimum data volume threshold parameter is set to 30 data points, because market makers need to quickly respond to the latest prices. The historical window benchmark parameter is set to 30 seconds.
[0100] The specific parameters of the strategy include: the list of quoted products, the minimum number of quotes for each product, the maximum number of quotes, the bid-ask spread setting parameter, and the quote update frequency parameter.
[0101] In step S2, the market monitoring module simultaneously acquires market status feature vectors for multiple ETF products. In this embodiment, the Huaxia SSE 50 ETF is used as an example. The current trading session is the intraday trading session, identified by the number 1. The historical volatility over the last 30 seconds is 0.0018, the total buy order depth is 50,000 units, and the total sell order depth is 45,000 units. Regarding extended features, the bid-ask spread is 0.0002, or 2 basis points, which is a very tight spread reflecting the high liquidity of the ETF product.
[0102] In step S3, the decision-making process of the adaptive decision-making model reflects the special needs of the market maker strategy: First, it determines that the timeliness preference value of 0.95 is at an extremely high level, and the decision path enters the ultra-short-term timeliness branch. Then, it determines that the historical volatility of 0.0018 is at an extremely low level, indicating that the market is operating smoothly. Further, it determines that the current trading session is an intraday trading session, during which liquidity is at its best. Finally, it determines that the order book depth ratio is greater than 1, indicating strong market demand.
[0103] After comprehensive analysis, the model outputs a target market timeframe based on the most recent 10 seconds. This ultra-short timeframe ensures that market makers can capture the latest price changes and quickly adjust their quotes.
[0104] In step S4, the dynamic cache management module extracts approximately 100 pieces of raw market data from the most recent 10 seconds. The strategy execution engine calculates the following technical indicators: latest transaction price, bid-ask price, best bid-ask spread, order book depth-weighted price, and short-term price momentum.
[0105] The calculated technical indicator values are as follows: the latest transaction price is 3.256 yuan, the best bid price is 3.255 yuan, the best ask price is 3.257 yuan, the bid-ask spread is 0.002 yuan, the order book depth weighted price is 3.256 yuan, and the short-term price momentum is 0.
[0106] The adaptive adjustment process of the multi-level sliding window cache is as follows: the adjusted window length is compressed to 15 seconds, reflecting the market maker strategy's high dependence on ultra-short-term data.
[0107] In step S5, the strategy execution engine generates quotes based on technical indicators and preset pricing rules. The pricing rules include: the bid-ask spread must not be less than 0.002 yuan, the buy quote quantity is 10,000 units, and the sell quote quantity is 10,000 units. The quote calculation method is as follows: the buy quote price equals the order book depth-weighted price minus half of the bid-ask spread, and the sell quote price equals the order book depth-weighted price plus half of the bid-ask spread.
[0108] The calculated quotes are: a buy quote of 3.255 yuan and a sell quote of 3.257 yuan. The strategy execution engine generates buy and sell orders based on these quotes and stores them in the execution queue.
[0109] In step S6, the cost forecasting and timing module forecasts the expected execution cost of the quoted orders. For market maker strategies, predicting the probability of execution is crucial because the market maker's quotes may be executed by the counterparty. Candidate time points are set to the current moment and multiple time points every 100 milliseconds thereafter.
[0110] The model's predictions include not only the expected execution cost but also the expected probability of a successful transaction. The predictions show that the expected execution cost at the current moment is 0.5 basis points, and the expected probability of a successful transaction is 85%.
[0111] In step S7, the system selects the time point with the lowest expected execution cost and the expected transaction probability meeting the threshold as the target execution time point. In the market maker scenario, the selection of the quote submission time point needs to balance execution cost and transaction probability. The system combines the two indicators to select the optimal time point and submit the quote.
[0112] In market-making scenarios, the re-prediction mechanism needs to respond particularly quickly because market conditions can change within milliseconds. The system uses an event-driven monitoring approach rather than timed checks, immediately assessing the market condition upon receiving new market data.
[0113] Example 6 This embodiment uses the simultaneous operation of multiple strategies in a fund of funds as an application scenario to explain in detail the adaptive processing method of the present invention in a multi-strategy environment. In this embodiment, it is assumed that the quantitative trading system runs three different types of sub-strategies simultaneously: the first is a mean-based statistical arbitrage strategy, the second is a trend-based momentum strategy, and the third is a volatility strategy based on volatility options. Each strategy has different time-period sensitivity parameters, and the system needs to perform unified market data management to avoid data duplication and storage waste.
[0114] In step S1, the parameter acquisition module extracts the time-sensitivity parameters for the three sub-strategies. The statistical arbitrage strategy has a time sensitivity preference value of 0.3, favoring stability; the momentum strategy has a time sensitivity preference value of 0.7, favoring time sensitivity; and the volatility strategy has a time sensitivity preference value of 0.6, which is at an intermediate level. The system needs to coordinate and manage multi-level sliding window caching based on the parameters of each strategy.
[0115] In step S2, the market state feature vector acquired by the market monitoring module is shared by the three strategies to avoid performance overhead caused by repeated acquisition. The acquisition frequency of the market state is determined based on the highest timeliness preference value among the three strategies. In this embodiment, the acquisition frequency is determined to be 10 times per second according to the requirements of the momentum strategy.
[0116] In step S3, the adaptive decision-making module runs an adaptive time-period decision model for each strategy, resulting in three target market time-period combinations. The target market time-period combination for the statistical arbitrage strategy is a single time period of 1800 seconds; the target market time-period combination for the momentum strategy is a single time period of 90 seconds; and the target market time-period combination for the volatility strategy is a single time period of 120 seconds.
[0117] The system determines the storage strategy of the multi-level sliding window cache based on the combination of target market time periods of the three strategies. The cache needs to cover the longest time span of all strategies, i.e., 1800 seconds, to ensure that each strategy can obtain the required historical data.
[0118] In step S4, the dynamic cache management module extracts data from the cache according to the storage strategy determined above and provides it to each strategy. Each strategy calculates the required technical indicators based on the extracted data.
[0119] In step S5, the three strategies generate their respective orders to be executed and store them in a unified queue. The system needs to handle priority conflicts and resource contention between orders from different strategies in its order queue management.
[0120] In steps S6 and S7, the cost prediction and timing module performs a unified prediction of execution costs and determines the optimal execution time for all orders in the queue. The system comprehensively considers the optimal execution cost of each order and overall resource constraints to determine the actual submission time for each order.
[0121] Through the aforementioned multi-strategy coordination mechanism, this invention can achieve unified management and efficient utilization of market data in an environment where multiple strategies operate in parallel. This satisfies the different data timeliness requirements of each strategy while avoiding the waste of resources caused by repeated data acquisition and storage.
[0122] Example 7 This embodiment uses a cross-market arbitrage strategy as an application scenario to explain in detail the adaptive processing method of the present invention when multiple exchanges and multiple trading instruments are involved. In this embodiment, it is assumed that the target strategy is a cross-border ETF arbitrage strategy, which simultaneously trades ETF products tracking the same index in the Chinese market and the US market, and obtains arbitrage profits by capturing price differences between the two markets. The strategy needs to maintain the time synchronization of data acquisition between the two markets.
[0123] In step S1, the parameter acquisition module extracts the time-sensitivity parameter of the cross-market arbitrage strategy. The strategy's timeliness preference value is set to 0.75 because cross-border arbitrage requires quickly capturing price differences between markets. The strategy also includes a cross-border synchronization parameter to control the time alignment accuracy of data acquisition from the two markets.
[0124] In step S2, the market monitoring module needs to obtain market data from both Chinese and American stock exchanges simultaneously. Due to time zone differences between the two markets, the system needs to perform timestamp standardization, converting timestamps from different time zones into a unified UTC timestamp. The obtained market state feature vectors include: the current price, order book depth, and bid-ask spread of the Hang Seng ETF in the Chinese market; and the current price, order book depth, and bid-ask spread of the S&P 500 ETF in the American market.
[0125] In step S3, the adaptive decision model needs to consider the state characteristics of the two markets to make a joint decision. The model output is a target market time period combination that covers the trading hours of both the Chinese and US markets, ensuring that the data obtained by the arbitrage strategy reflects the synchronized state of the two markets.
[0126] In step S4, the dynamic cache management module extracts historical data from the two markets from the multi-level sliding window cache, performs time alignment processing, and then provides the paired data to the strategy execution engine. The strategy execution engine calculates the price ratio, price difference, and rolling statistical characteristics of these indicators between the two ETFs.
[0127] In step S5, the strategy execution engine compares the price spread indicator with the trigger conditions. When the price spread exceeds two standard deviations above the historical average, an arbitrage order is generated. Order submission needs to take into account the differences in opening times and liquidity between the two markets.
[0128] In steps S6 and S7, the cost forecasting and timing module forecasts the execution costs of orders in the two markets and determines the actual order submission time by comprehensively considering the optimal execution time points of the two markets.
[0129] An adaptive processing system for quantitative trading data includes: a parameter acquisition module for acquiring time-period sensitivity parameters of a strategy; a market monitoring module for acquiring market state feature vectors in real time; an adaptive decision-making module for running a pre-trained time-period decision-making model and outputting a target market time-period combination; a dynamic cache management module for managing multi-level sliding window caches and adjusting the cache range according to the sensitivity parameters; a strategy execution engine for calculating technical indicators and generating orders to be executed; a cost prediction and timing module for predicting execution costs and determining the optimal submission time; and an order submission module for sending orders to the exchange at the target time.
[0130] Through the aforementioned cross-market data synchronization mechanism, this invention enables effective management of market data and smooth execution of arbitrage strategies in cross-border trading environments.
[0131] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. An adaptive processing method for quantitative trading data, characterized in that, Includes the following steps: S1. In response to the start command of the target quantitative trading strategy, obtain the time sensitivity parameter of the strategy, wherein the time sensitivity parameter is used to characterize the strategy's preference weight for the timeliness of market data relative to the stability of the data; S2. Real-time acquisition of the current market state feature vector, which includes at least: the basic trading session category of the current moment, the historical volatility within the most recent preset time window, and the buy / sell depth of the current order book; S3. Inputting the session sensitivity parameter and the market state feature vector into a pre-trained adaptive session decision model, which dynamically outputs a target market session combination, comprising one or more time periods with continuous or non-continuous time intervals; S4. Based on the target market session combination, extracting corresponding market data from a dynamically maintained multi-level sliding window cache, and calculating the technical indicator values required by the quantitative trading strategy based on the extracted market data; wherein... The data retention length and time coverage of the multi-level sliding window cache are adaptively adjusted according to the time period sensitivity parameter; S5, when the technical indicator value meets the preset trigger condition of the quantitative trading strategy, an order to be executed is generated and stored in an execution queue with a timestamp; S6, a pre-trained execution cost prediction model is called, and the current market microstructure data, the order information of the order to be executed, and the expected market state of multiple candidate execution time points are input to predict the expected execution cost of each candidate time point; S7, the candidate time point with the lowest expected execution cost is selected as the target execution time point, and when the target execution time point is reached, the order to be executed is submitted to the exchange server.
2. The adaptive processing method for quantitative trading data according to claim 1, characterized in that, Step S4 specifically includes the following steps: S41, obtaining the minimum amount of market data required for calculating the technical indicators of the quantitative trading strategy; S42, determining an initial time window backward from the current time as the endpoint; S43, dynamically adjusting the window length according to the time sensitivity parameter based on the time preference value, wherein the larger the time preference value, the shorter the window; S44, retaining all market data in the cache whose timestamps are within the adjusted window range, and clearing or archiving the remaining data; S45, when new market data is received, adding it to the cache and repeating the above adjustment process to keep the cache in a dynamic sliding window state.
3. The adaptive processing method for quantitative trading data according to claim 1, characterized in that, The adaptive time-period decision model is a supervised learning model based on gradient boosting trees. Its training samples include: historical time-period sensitivity parameters, historical market state feature vectors, and optimal market time-period labels determined manually or through backtesting.
4. The adaptive processing method for quantitative trading data according to claim 1, characterized in that, The execution cost prediction model is a time-series prediction model based on long short-term memory networks. Its input features include: the order's buy / sell direction, quantity, limit price, the current bid and ask prices and quantities, the average slippage under the same basic trading period in the past preset trading days, and the expected volatility at the prediction time point. The output is the expected execution cost.
5. The adaptive processing method for quantitative trading data according to claim 1, characterized in that, Step S7 specifically includes the following steps: S71, continuously monitor real-time changes in market status before the target execution time point arrives; S72, when a drastic change in market status is detected that causes a significant increase in the original forecast cost, trigger the re-forecasting process; S73, re-execute step S6, and update the expected execution cost of each candidate time point based on the latest market data; S74, based on the updated expected execution cost, reselect the optimal candidate time point as the new target execution time point, and update the timestamp information in the queue to be executed.
6. The adaptive processing method for quantitative trading data according to claim 1, characterized in that, The market state feature vector also includes the following features: market bid-ask spread, deviation of volume-weighted average price from the latest transaction price, market order flow imbalance, and historical average volatility for the current period.
7. The adaptive processing method for quantitative trading data according to claim 1, characterized in that, The multi-level sliding window cache adopts a hierarchical storage architecture. The first layer stores the raw market data within the most recent preset time range, the second layer stores the pre-processed aggregated market data, and the third layer stores the intermediate result data used for strategy calculation. The data in each layer is dynamically updated according to the timeliness requirements.
8. An adaptive processing system for quantitative trading data, comprising: The parameter acquisition module is used to obtain the time-period sensitivity parameters of the strategy; The market monitoring module is used to acquire market status feature vectors in real time. The adaptive decision-making module runs a pre-trained time-period decision-making model and outputs the target market time-period combination; the dynamic cache management module manages multi-level sliding window caches and adjusts the cache range according to sensitivity parameters; the strategy execution engine calculates technical indicators and generates orders to be executed; and the cost prediction and timing module predicts execution costs and determines the optimal submission time. The order submission module is used to send orders to the exchange at the target time.