Backtesting data processing method and apparatus, and device and storage medium

By generating a backtest progress bar in quantitative backtesting and determining the target backtesting time point, the problem that the existing technology cannot view the intermediate state of the quantitative trading strategy is solved, and information backtracking of the state at any time point in the quantitative backtesting process is realized , improving the comprehensiveness of backtesting.

WO2025025438A1PCT designated stage expired Publication Date: 2025-02-06FUTU NETWORK TECH (SHENZHEN) CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/135247
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-07-28
Filing Date
2023-11-29
Publication Date
2025-02-06

AI Technical Summary

Technical Problem

The existing quantitative backtesting function cannot view the intermediate state of the quantitative trading strategy during the backtesting process, and there are certain limitations.

Method used

By generating a backtest progress bar, users can determine the target backtest time point through touch operations, and determine the target backtest status at the target backtest time point based on the order operation information and historical market data in the quantitative trading strategy.

Benefits of technology

It realizes information backtracking of the target backtest status at any backtest time point during the quantitative backtesting process, supports users to better view the intermediate states during the quantitative backtesting process, and improves the comprehensiveness of the quantitative backtesting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023135247_06022025_PF_FP_ABST
    Figure CN2023135247_06022025_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the embodiments of the present application are a backtesting data processing method and apparatus, and a device and a storage medium. The method comprises: on the basis of backtesting start and end time points of any quantitative trading strategy, displaying a corresponding backtesting progress bar; in response to a touch-control operation for the backtesting progress bar, determining a target backtesting time point; and on the basis of order operation information and historical market data of a trading target in the quantitative trading strategy within a target backtesting time period, determining a target backtesting state at the target backtesting time point, wherein the target backtesting time period is a time period between the backtesting start time point and the target backtesting time point in the backtesting progress bar. By means of the embodiments of the present application, information backtracking of a target backtesting state at any backtesting time point during a quantitative backtesting process is implemented, supporting a user to better view a target intermediate state during the quantitative backtesting process, thereby improving the comprehensiveness of quantitative backtesting.
Need to check novelty before this filing date? Find Prior Art

Description

Backtest data processing method, device, equipment and storage medium

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims priority to Chinese patent application number 202310940682.3, filed on July 28, 2023, entitled “Backtest data processing method, device, equipment and storage medium”. The entire contents of that application are incorporated herein by reference. Technical Field

[0003] The embodiments of the present application relate to the field of data processing technology, and more particularly to a backtest data processing method, apparatus, device, and storage medium. Background Art

[0004] Quantitative backtesting is one of the core functions of quantitative trading platforms. Users can edit quantitative trading strategies on the platform and verify the accuracy and effectiveness of quantitative trading strategies through quantitative backtesting, thus avoiding logical loopholes in the design process.

[0005] The current quantitative backtesting function usually only supports viewing the final status of the trading target within any quantitative trading strategy after the backtest is completed, but cannot view the intermediate status of the trading target within the quantitative trading strategy during the backtest process, which makes quantitative backtesting have certain limitations.

[0006] Summary of the Invention

[0007] The embodiments of the present application provide a backtest data processing method, apparatus, device, and storage medium to enable information backtracking of the target backtest status at any backtest time point during the quantitative backtest process, allowing users to better view the intermediate status of the target during the quantitative backtest process, thereby improving the comprehensiveness of the quantitative backtest.

[0008] In a first aspect, an embodiment of the present application provides a backtest data processing method, the method comprising:

[0009] Display the corresponding backtest progress bar according to the backtest start and end time points of any quantitative trading strategy;

[0010] In response to a touch operation on the backtest progress bar, determining a target backtest time point;

[0011] Determine the target backtest status at the target backtest time point based on the order operation information and historical market data of the trading target within the quantitative trading strategy during the target backtest period;

[0012] The target backtesting period is the time period from the backtesting start time point to the target backtesting time point in the backtesting progress bar.

[0013] In a second aspect, an embodiment of the present application provides a backtest data processing device, the device comprising:

[0014] The progress bar generation module is used to display the corresponding backtest progress bar according to the backtest start and end time points of any quantitative trading strategy;

[0015] a backtest time determination module, configured to determine a target backtest time point in response to a touch operation on the backtest progress bar;

[0016] A backtest status determination module, configured to determine the target backtest status at the target backtest time point based on order operation information and historical market data of the trading target within the quantitative trading strategy within the target backtest period;

[0017] The target backtesting period is the time period from the backtesting start time point to the target backtesting time point in the backtesting progress bar.

[0018] In a third aspect, an embodiment of the present application provides an electronic device, the electronic device comprising:

[0019] A processor and a memory, wherein 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 backtest data processing method provided in the first aspect of the present application.

[0020] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium for storing a computer program, wherein the computer program enables a computer to execute the backtest data processing method provided in the first aspect of the present application.

[0021] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the backtest data processing method provided in the first aspect of the present application.

[0022] The technical solution provided by the embodiment of the present application can display a corresponding backtesting progress bar for the quantitative backtesting of any quantitative trading strategy based on the backtesting start and end time points of the quantitative trading strategy. Then, after the quantitative backtesting is completed, the target backtesting time point is determined in response to the touch operation on the backtesting progress bar; further, the target backtesting status of the target at the target backtesting time point is determined based on the order operation information and historical market data of the trading target within the quantitative trading strategy during the target backtesting period, thereby realizing the information backtracking of the target backtesting status at any backtesting time point during the quantitative backtesting process, supporting users to better view the backtesting status of the trading target at any intermediate time point during the quantitative backtesting process, and improving the comprehensiveness of the quantitative backtesting. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0024] FIG1 is a flow chart of a backtest data processing method provided in an embodiment of the present application;

[0025] FIG2 is a schematic diagram of a backtesting progress bar provided in an embodiment of the present application;

[0026] FIG3 is a flow chart of a method for determining a target backtest status at any target backtest time point provided by an embodiment of the present application;

[0027] FIG4 is a flow chart of a method for determining target transaction information at a target backtesting time point according to an embodiment of the present application;

[0028] FIG5 is a schematic diagram showing the principle of archiving a position list according to an embodiment of the present application;

[0029] FIG6 is a schematic diagram of the principle of the order association record table provided in an embodiment of the present application;

[0030] FIG7 is a flow chart of a method for determining underlying market information at a target backtesting time point according to an embodiment of the present application;

[0031] FIG8 is a schematic diagram showing the principle of historical K-line data within the K-line period at the target backtest time point provided by an embodiment of the present application;

[0032] FIG9 is a functional block diagram of a backtest data processing device provided in an embodiment of the present application;

[0033] FIG10 is a schematic block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0034] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0035] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.

[0036] Regarding the quantitative functions of various quantitative trading platforms, users can design quantitative trading strategies based on the graphical controls provided by the client, or by writing the corresponding strategy code in the code editor provided by the client, thereby objectively analyzing trading risks and returns. Furthermore, to ensure the accuracy of quantitative trading strategies, quantitative backtesting functions are often used to analyze the specific trading performance of quantitative trading strategies to verify the effectiveness of quantitative trading strategies.

[0037] However, the current quantitative backtesting function usually only supports viewing the final trading status of the quantitative trading strategy after the backtest is completed, but cannot view the intermediate trading status of the quantitative trading strategy during the backtesting process. For example, for a certain quantitative trading strategy, the market data in the past five days (such as Monday to Friday) can be used to perform quantitative backtesting to test the performance of the quantitative trading strategy (the rise and fall of the total value of assets in the account). However, when the user wants to view the performance of the quantitative trading strategy on a certain day during this backtesting process, such as Wednesday, it is often necessary to re-use the market data from Monday to Wednesday to perform quantitative backtesting again, which makes quantitative backtesting have certain limitations. Therefore, in order to solve the above technical problems, the present application can generate a backtesting progress bar for quantitative backtesting, so that after the quantitative backtest is completed, the progress of the backtesting progress bar can be adjusted to realize the information backtracking of the target backtesting status at any backtesting time point during the quantitative backtesting process.

[0038] FIG1 is a flow chart of a backtest data processing method provided in an embodiment of the present application. The method can be executed by the backtest data processing device provided in the present application. The backtest data processing device can be implemented by any software and / or hardware. Exemplarily, the backtest data processing device can be applied to any electronic device, which may include but is not limited to tablet computers, mobile phones (such as foldable screen mobile phones, large screen mobile phones, etc.), wearable devices, vehicle-mounted devices, laptop computers, ultra-mobile personal computers (ultra-mobile personal computers, UMPCs), netbooks, personal digital assistants (personal digital assistants, PDAs), smart TVs, smart screens, high-definition TVs, 4K TVs, smart projectors and other types of computing devices. The present application does not impose any restrictions on the specific type of electronic device. In addition, the backtest data processing device can also be applied to any server, which can be an independent server or a server cluster composed of multiple servers.

[0039] Specifically, as shown in FIG1 , taking the method applied to an electronic device as an example, the electronic device runs a client application for performing quantitative backtesting. The method may include the following steps:

[0040] S110, displaying a corresponding backtesting progress bar according to the backtesting start and end time points of any quantitative trading strategy.

[0041] In order to enable the user to view the intermediate trading status of the quantitative trading strategy during the backtesting process after the quantitative backtesting is completed, the electronic device of the present application can set a backtesting progress bar for the entire quantitative backtesting process of the quantitative trading strategy through the client of the application program, and display it in the visual interface provided by the client (such as the quantitative function interface), so that the user can view the intermediate trading status at any backtesting time point during the quantitative backtesting process by dragging the backtesting progress bar.

[0042] In one embodiment, for quantitative trading strategies, users can design quantitative trading strategies based on graphical controls provided by the client of the application used for quantitative backtesting, or they can design quantitative trading strategies by writing corresponding strategy codes in the code editor provided by the client, so as to objectively analyze trading risks and returns.

[0043] After designing a quantitative trading strategy, you can use the quantitative backtesting function provided by the client to analyze its specific profit effects. Then, by evaluating the specific trading performance of the quantitative trading strategy, you can verify its effectiveness and advantages.

[0044] Before initiating a quantitative backtesting instruction for any quantitative trading strategy, you must first set the corresponding backtesting parameters for the quantitative trading strategy. These backtesting parameters can include the time period for the quantitative backtest, thereby determining the backtesting start and end points for the quantitative trading strategy. For example, a user can use the quantitative function interface provided by the application client to select the stock trading data of a specific stock market within a specific time period as historical trading data to conduct a quantitative backtest on the quantitative trading strategy.

[0045] Then, the user triggers the "Start Backtesting" control in the quantitative function interface to initiate the corresponding quantitative backtesting instruction for the quantitative trading strategy designed in the quantitative interface, so that the client can perform the corresponding quantitative backtesting operation on the quantitative trading strategy based on the quantitative backtesting instruction.

[0046] It should be noted that the backtesting start and end time points in this application may include a backtesting start time point and a backtesting stop time point. Before performing a quantitative backtest on a quantitative trading strategy, a corresponding quantitative backtesting selection box will pop up in the visual quantitative interface. The user can select the backtesting start and end time points specified in the quantitative backtesting selection box in order to evaluate the specific trading performance of the quantitative trading strategy during that period.

[0047] In this application, in order to realize the information backtracking of the intermediate transaction status at any backtesting time point during the quantitative backtesting process, a corresponding backtesting progress bar can be generated for the entire quantitative backtesting process according to the backtesting start time point and backtesting stop time point determined before the start of the quantitative backtesting.

[0048] The starting point of the backtest progress bar can be used to indicate the backtest start time point, and the end point of the backtest progress bar can be used to indicate the backtest stop time point. Therefore, based on the correspondence between the overall length of the backtest progress bar and the overall backtest duration from the backtest start time point to the backtest stop time point, the backtest time point represented by any position of the progress cursor within the backtest progress bar can be determined. Therefore, by dragging the progress cursor within the backtest progress bar, the user can determine the target backtest time point they want to backtrack to.

[0049] With respect to the backtesting progress bar, in some possible implementations, the present application may directly generate the backtesting progress bar at the start of the quantitative backtesting to support the user in backtracking the information at any backtesting time point during the quantitative backtesting process. In other possible implementations, the present application may also generate the backtesting progress bar after the quantitative backtesting is completed to support the user in backtracking the information at any backtesting time point during the quantitative backtesting process after the quantitative backtesting is completed, thereby avoiding adjusting the backtesting progress in the middle of the quantitative backtesting, which may affect the accuracy of the quantitative backtesting.

[0050] S120 : In response to a touch operation on the backtest progress bar, determining a target backtest time point.

[0051] The target backtesting time point refers to the middle time point between the backtesting start time point and the backtesting stop time point.

[0052] For the backtesting progress bar, users are supported to perform corresponding progress manipulation on the backtesting progress bar. Specifically, the touch operation can be a click operation. The user can click a certain position on the backtesting progress bar through the visual interface provided by the client. In response to the click operation, the client can adjust the progress cursor on the backtesting progress bar used to identify the backtesting progress to the click position corresponding to the click operation, so as to adjust the backtesting progress of the quantitative trading strategy and determine the target backtesting time point corresponding to the click position. The touch operation can also be a sliding operation. The user can drag the backtesting progress control on the backtesting progress bar used to identify the backtesting progress through the visual interface provided by the client, and slide the backtesting progress control to a certain position on the backtesting progress bar. In response to the sliding operation, the client can adjust the progress cursor on the backtesting progress bar to the end position of the sliding operation and determine the target backtesting time point corresponding to the end position, so as to adjust the backtesting progress of the quantitative trading strategy.

[0053] S130, determining the target backtesting status at the target backtesting time point based on the order operation information and historical market data of the trading target in the quantitative trading strategy during the target backtesting period.

[0054] Among them, the target backtest status in this application may include but is not limited to the market value of the trading target at the target backtest time point, and the trading status of related transactions of the trading target based on the quantitative trading strategy before the target backtest time point, such as order information and position information.

[0055] The trading targets can be stocks, funds, options, or a combination of these, or a combination of these. Considering that quantitative trading strategies are typically formed by configuring corresponding processing logic for multiple trading targets, quantitative backtesting of quantitative trading strategies can actually be performed by retrospectively analyzing the specific trading conditions of multiple trading targets defined within the quantitative trading strategy within a certain time interval, thereby obtaining the various trading states of each trading target during the quantitative backtesting process.

[0056] Upon detecting a user's touch operation on the backtesting progress bar to advance the backtesting progress to any target backtesting time point, the client can first determine the trading targets within the quantitative trading strategy, so as to determine the target backtesting status of the trading targets at the target backtesting time point by analyzing the actual trading behavior and / or actual market value of each trading target executed before the target backtesting time point, thereby realizing the backtesting status analysis of the trading targets at any intermediate time point during the quantitative backtesting process.

[0057] Furthermore, in order to accurately analyze the actual trading behavior and / or actual market value executed by the transaction target, as shown in Figure 2, the present application can use the time period from the backtest start time point to the target backtest time point in the backtest progress bar as the corresponding target backtest period, and obtain the order operation information related to the actual trading behavior and the historical market data related to the actual market value within the target backtest period. Based on the order operation information and historical market data within the target backtest period, the market value and trading situation of the transaction target at the target backtest time point are determined to obtain the target backtest status of the transaction target.

[0058] It can be explained that for the actual transaction information of the transaction target in the historical transaction process, this application can store it accordingly through the following functional modules to achieve quantitative backtesting.

[0059] 1) Account module

[0060] Basic account information and asset change information for each transaction target can be stored. Within the Account module, an asset overview list can be set up to store corresponding asset change information. This asset change information may include, but is not limited to, net asset value, maximum drawdown, and Sharpe ratio. Market information for each transaction target at different points in time can also be stored.

[0061] 2) Risk Control (MaxQty) Module

[0062] It can determine the purchasing power of each trading target when the user places an order and triggers a conditional order, and calculate the corresponding margin, etc.

[0063] 3) Fee module

[0064] It can calculate the various transaction fees that need to be paid or collected during the transaction process for each transaction object.

[0065] 4) Order Operation (OrderOp) Module

[0066] When an order operation is executed for each trading target, a corresponding order operation record is generated and stored in the order operation list within the OrderOp module. Since each order operation cannot be reversed after completion, order operation records stored in the order operation list are only added, not deleted or modified. Furthermore, by analyzing the order operation records in the order operation list during the quantitative backtesting process, a historical order list can be calculated at any backtesting time point.

[0067] 5) Basic Order Module

[0068] A list of executed basic orders for each transaction object can be stored.

[0069] Among them, basic orders may include but are not limited to limit orders and market orders.

[0070] 6) Conditional Order Module

[0071] A list of conditional orders triggered by each transaction target can be stored.

[0072] Conditional orders may include, but are not limited to, stop-limit orders, stop-market orders, limit-on-hit orders, market-on-hit orders, trailing stop-limit orders, and trailing stop-market orders.

[0073] 7) Deal Module

[0074] It stores information about each completed order for each trading target. Since orders cannot be withdrawn after execution, the "Deal" module stores only new orders, not deleted or modified. Furthermore, by analyzing each executed order in the "Deal" module during quantitative backtesting, it is possible to calculate a historical position list at any backtesting point in time.

[0075] 8) Position Module

[0076] The latest position list of each trading target can be stored.

[0077] 9) Cache module

[0078] Target-related information stored in the aforementioned other functional modules can be cached, such as order lists, transaction lists, position lists, and order operation information in asset overviews. The unique computational logic within the Cache module can then, upon detecting a user's progress adjustment for any target backtesting time point within the backtesting progress bar, directly read the target's order operation information and historical market data for the corresponding backtesting period to analyze the target's backtesting status at any target backtesting time point during the backtesting process.

[0079] The order operation information in this application may refer to the record data of various operations of buying, selling, and completing transactions performed on any trading target based on the quantitative trading strategy, which can be determined by the order operation records stored in the order operation list in the above-mentioned order operation (OrderOp) module within the target backtest period.

[0080] Historical market data can refer to the historical price and historical K-line data of each trading target at any backtesting time point during the quantitative backtesting process, and can be stored in dedicated backtesting market modules such as quotation modules and K-line modules.

[0081] After determining the target backtesting time point, the present application can read the order operation information of the trading target in the quantitative trading strategy that has been executed during the target backtesting period from the cache module. In addition, the historical market information of the trading target pre-set during the target backtesting period can also be read from the backtesting market modules such as the above-mentioned quotation module and K-line module.

[0082] Then, by comprehensively analyzing the order operation information and historical market data of the trading target within the target backtesting period, the actual trading behavior of the trading target that has been executed before the target backtesting time point can be determined, thereby determining the trading status of the trading target at the target backtesting time point, which is used as the target backtesting status at the target backtesting time point, thereby realizing the information backtracking of the target backtesting status at any backtesting time point in the quantitative backtesting process.

[0083] After determining the target backtest status at the target backtest time point, the present application can also display the target backtest status in a visualization interface, such as displaying the transaction status and market data of the transaction target on the user account at the target backtest time point. Among them, the visualization interface can be the interface where the backtest progress bar is located. Specifically, the visualization interface may include a K-line chart area and an asset status area, wherein the K-line chart area is used to display the target market information, and the asset status area is used to display the target transaction information; after determining the target backtest status at the target backtest time point, based on the target transaction information in the target backtest status, the target transaction list and target position list of the transaction target at the target backtest time point can be generated and displayed in the asset status area of ​​the visualization interface, and based on the target market information in the target backtest status, the K-line chart of the transaction target can be generated and displayed in the K-line chart area of ​​the visualization interface.

[0084] Furthermore, the visualization interface includes multiple K-line chart controls of different periods; in response to a trigger operation on a target K-line chart control, a target K-line chart of the period corresponding to the target K-line chart control can be generated based on the underlying market information and displayed on the visualization interface. For example, the visualization interface includes a daily K-line chart control, a weekly K-line chart control, a 1-hour K-line chart control, etc. When a user clicks on a weekly K-line chart control in the visualization interface, in response to a trigger operation (i.e., a click operation) on the weekly K-line chart control, a target weekly K-line chart can be generated based on the underlying market information and displayed on the visualization interface; when a user clicks on a 1-hour K-line chart control in the visualization interface, in response to a trigger operation (i.e., a click operation) on the 1-hour K-line chart control, a target 1-hour K-line chart can be generated based on the underlying market information, and the target weekly K-line chart in the visualization interface is switched to a target 1-hour K-line chart.

[0085] In one embodiment, after determining the target backtesting state at the target backtesting time point, the method may further include: determining the strategy type of the quantitative trading strategy based on the target trading information in the target backtesting state of the trading target at the target backtesting time point, and the initial trading information in the initial backtesting state of the trading target at the backtesting stop time point; it can be understood that the strategy type includes trend following and high-frequency trading. The trend following type indicates that the quantitative trading strategy performs better in the long term, and the high-frequency trading type indicates that the quantitative trading strategy performs better in the short term.

[0086] Specifically, considering that the performance of quantitative trading strategies varies in different periods, the execution efficiency of the quantitative trading strategy during the quantitative trading period corresponding to the backtesting duration can be calculated using the following formula based on the target trading information in the backtesting state at the target backtesting time point and the initial trading information in the initial backtesting state at the backtesting stop time point, as follows:

[0087] Where E represents the execution efficiency of the quantitative trading strategy at the target backtest time point compared to the backtest stop time point, Obj_i (i=1, 2, ...) represents the transaction information of the i-th target of the trading target at the target backtest time point, and Ren_i represents the i-th initial transaction information at the backtest stop time point. When the execution efficiency is greater than a preset threshold, the quantitative trading strategy's performance during the time period corresponding to the target backtest time point is more different than during the time period corresponding to the backtest stop time point, indicating that it is a high-frequency trading quantitative trading strategy. When the execution efficiency is less than the preset threshold, the quantitative trading strategy's performance during the time period corresponding to the target backtest time point is more similar than during the time period corresponding to the backtest stop time point, indicating that it is a trend-following quantitative trading strategy. By determining the strategy type of the quantitative trading strategy, when a run request for a real-time run of the quantitative trading strategy is subsequently received, quantitative trading strategy recommendations can be made based on the run time contained in the run request and the strategy type of each user-designed quantitative trading strategy.

[0088] The technical solution provided by the embodiment of the present application can display a corresponding backtesting progress bar for the quantitative backtesting of any quantitative trading strategy based on the backtesting start and end time points of the quantitative trading strategy. Then, after the quantitative backtesting is completed, the target backtesting time point is determined in response to the touch operation on the backtesting progress bar; furthermore, the target backtesting status of the target at the target backtesting time point can be determined based on the order operation information and historical market data of the trading target within the quantitative trading strategy during the target backtesting period, thereby realizing the information backtracking of the target backtesting status at any backtesting time point during the quantitative backtesting process, supporting users to better view the target status at any intermediate time point during the quantitative backtesting process, and improving the comprehensiveness of the quantitative backtesting.

[0089] As an optional implementation in this application, to ensure a comprehensive backtest of the underlying asset's intermediate state at any backtesting time point during the quantitative backtesting process, it is generally necessary to analyze the entire historical trading state of the underlying asset prior to any backtesting time point and the current market value of the underlying asset at any backtesting time point. Therefore, the backtested state of the underlying asset at any backtesting time point can be analyzed from both the historical trading state and the current market value of the underlying asset.

[0090] 3 , the present application will provide a detailed explanation of the specific backtesting process of the target backtesting status of the trading target within the quantitative trading strategy at any target backtesting time point during the quantitative backtesting process.

[0091] FIG3 is a flow chart of a method for determining the target backtest status at any target backtest time point provided by an embodiment of the present application. The method may specifically include the following steps:

[0092] S310: Determine the transaction target within the quantitative trading strategy.

[0093] When a touch operation on the backtest progress bar is detected, this application first analyzes the code functions actually called in the quantitative trading strategy. Then, by analyzing the input parameters defined in each code function, the corresponding trading target can be determined.

[0094] S320: Determine the target transaction information at the target backtest time point based on the order operation information of the transaction target within the target backtest period.

[0095] In order to accurately analyze the historical transaction information of the transaction target before the target backtest time point, the present application can first read out the various order operation records of the transaction target that have been cached in the cache module during the historical transaction process and are within the target backtest period. Then, by analyzing each order operation record, the historical order information of each operation performed by the transaction target during the target backtest period is determined, thereby determining the order operation status of each order that has been operated by the transaction target at the target backtest time point. Furthermore, by analyzing the operation status of each order that has been operated by the transaction target at the target backtest time point, the target transaction information at the target backtest time point can be determined.

[0096] The underlying transaction information may indicate various transaction performances of the underlying transaction before the target backtesting time point, including the order quantity, transaction status, and position status of the underlying transaction.

[0097] As an optional implementation scheme in this application, the order operation information in this application may include but is not limited to order transaction information and order operation status, and the target transaction information may include but is not limited to the target transaction list, target position list and target order list of the transaction target at the target backtest time point.

[0098] Order execution information may include data related to orders executed within the target backtesting period, such as order type, order execution time, and transaction volume. Order operation status may include status information for each order that has been created, submitted, executed, or withdrawn within the target backtesting period, indicating the specific operation performed on any order.

[0099] Then, for the underlying transaction information at the target backtesting time point, as shown in FIG4 , this application can determine it through the following steps:

[0100] S41, based on the order execution information of the transaction target within the target backtesting period, generate a target transaction list and a target position list at the target backtesting time point.

[0101] Since in the quantitative backtesting process, once the order operations executed by the transaction target are recorded, they cannot be modified or deleted. Therefore, after determining the target backtesting time point, the present application can find the transaction information of each order in the target backtesting period, that is, before the target backtesting time point, from the stored order operation records. Then, by analyzing the transaction information of each order in the target backtesting period, a target transaction list under the target backtesting time point can be generated. Among them, the target transaction list includes but is not limited to the number of transaction orders of the transaction target before the target backtesting time point, the transaction time of each transaction order, the transaction price, the transaction type, the transaction volume and other relevant transaction information. In other words, the target transaction list can be a list generated by statistically analyzing the transaction information of each order of the transaction target in the target backtesting period under a unified format, which is convenient for users to query and browse the specific transaction information of each transaction order.

[0102] For the underlying position list, the position list may include multiple fields, including the profit amount, latest price, unrealized profit and loss of the transaction target, etc., which will change with the changes in the underlying market quotes when different orders are executed. It may also include the second type of fields such as the number of positions held by the transaction target, diluted cost price, realized profit and loss, today's buy and sell, etc., which change according to the specific order execution behavior. Specifically, the position list can be accumulated based on the order execution information; in response to the user's touch operation on the backtest progress bar to advance the backtest progress to any target backtest time point, when the transaction information of each order within the target backtest period is obtained, the number of positions held by the transaction target can be determined according to the transaction type and transaction volume of each transaction order. Then, by analyzing the historical K-line prices of the transaction target during the target backtest period, the first type of fields such as the profit amount, latest price, unrealized profit and loss of the transaction target at different order executions, as well as the second type of fields such as diluted cost price, realized profit and loss, today's buy and sell, which change with the specific order execution behavior, are calculated, thereby determining the target position list at the target backtest time point.

[0103] In some implementations, considering that there may be a large number of traded orders during a long quantitative backtesting process, if all order traded information within the target backtesting period is traversed in full each time to calculate the corresponding target position list, it will consume a huge amount of computing overhead and backtesting performance. Therefore, in order to ensure the efficiency of the target position list, this application can record the historical position list at any backtesting time point in real time through temporary archiving during the quantitative backtesting process of the quantitative trading strategy.

[0104] Moreover, since the backtest progress bar usually runs backward in the order of the backtest time, for the temporary archive of the position list during the quantitative backtest process, this application can update the temporary archive of the position list every time an order transaction operation is detected during the quantitative backtest process of the quantitative trading strategy; during the quantitative backtest process of the quantitative trading strategy, the current backtest time point is obtained every time the preset number of order transactions is completed, and the currently updated temporary archive of the position list is stored once to obtain the archive of the position list at the current backtest time point;

[0105] That is to say, before the quantitative backtesting of the quantitative trading strategy begins, this application can pre-construct a temporary archive of the position list, and the initial value of the temporary archive of the position list is empty. Then, during the quantitative backtesting process of the quantitative trading strategy, if each order execution operation is detected, it means that a new execution order appears at the current backtesting time point, causing the position information at the current backtesting time point to change. Therefore, this application can use this new execution order to update the various position information in the current temporary archive of the position list, obtain a new temporary archive of the position list, and repeat this cycle until the end of the quantitative backtesting, and then obtain the final temporary archive of the position list.

[0106] In order to avoid obtaining the full amount of order transaction information when backtesting the target position list at any backtesting time point during the quantitative backtesting process, this application can pre-set an order transaction number for storing the temporary archive of the position list at each interval during the quantitative backtesting process of the quantitative trading strategy, that is, the preset order transaction number in this application, so that the current position list temporary archive is stored once at each preset order transaction number during the quantitative backtesting process, thereby storing the corresponding position list archives at multiple backtesting time points corresponding to each preset order transaction number.

[0107] Furthermore, during the quantitative backtesting of a quantitative trading strategy, each time an order execution operation is detected, a determination is made as to whether the number of order executions between the occurrence of the newly executed order at the current backtesting time point and the last time the position list was temporarily archived as the corresponding position list archive has reached a preset number of order executions. If the preset number of order executions has been reached, the updated position list at the current backtesting time point is temporarily archived as the position list archive at the current backtesting time point. This ensures that during the quantitative backtesting process, a position list archive is stored at the corresponding backtesting time point at each interval of the preset number of order executions.

[0108] For example, as shown in Figure 5, assume the preset number of executed orders is 30. During the quantitative backtesting process, a position list archive is saved every 30 executed orders. During the real-time backtesting process, a temporary position list archive is saved.

[0109] Based on the above content, for the target position list at the target backtest time point, this application can determine the latest position list archive within the target backtest period and the historical backtest time point corresponding to the latest position list archive; based on the latest position list archive and the order transaction information of the trading target within the period to be traversed, generate the target position list at the target backtest time point.

[0110] That is to say, when a user's touch operation on the backtest progress bar is detected to advance the backtest progress to any target backtest time point, the present application will first find out the archived time of the multiple position lists stored at each preset order transaction number within the target backtest period, and the position list archive with the archive time less than the target backtest time point and the closest distance to the target backtest time point, as the corresponding latest position list archive. Moreover, the historical backtest time point at which the latest position list archive is located during the quantitative backtest process can be determined. Then, as shown in Figure 5, the time period from the historical backtest time point to the target backtest time point is used as the time period to be traversed to read out the various order transaction records within the time period to be traversed. Furthermore, by analyzing the position information corresponding to the order transaction records within the time period to be traversed, the latest position list archive is updated, and the target position list at the target backtest time point can be generated.

[0111] S42: Generate a target order list at the target backtesting time point based on the order operation status of the transaction target within the target backtesting period.

[0112] In the present application, the cached order operation records within the target backtest period can be read out in the cache module to analyze the various order operations that have been executed for each order placed within the target backtest period. Then, by analyzing the information of each order operation, it is possible to determine the various order operations that have been executed for each order successfully placed by the user within the target backtest period. Furthermore, for each order successfully placed before the target backtest time point, the present application can merge the latest order operations executed for each order before the target backtest time point to generate a list of target orders at the target backtest time point.

[0113] In some implementations, all order creation, execution, and cancellation operations are controlled by the order operation records stored in the OrderOp module. Once an order is created, it can only be modified, not deleted. Therefore, unlike the position count in the position list, it cannot be reduced. Therefore, the number of orders in the order list is constantly growing. If the entire order list is archived during quantitative backtesting, as the number of orders increases, the archived content will grow, occupying a large amount of memory space and easily causing program crashes.

[0114] Therefore, in order to ensure that the space occupancy rate of orders is further reduced on the basis of low computing overhead, this application can generate a new order operation record under the associated order in the order association record table every time an order execution operation is detected during the quantitative backtesting process of the quantitative trading strategy.

[0115] The order execution operation may include, but is not limited to, any of the order-related operations such as order placement, triggering, submission, execution, and cancellation. The order execution operation is one type of order execution operation.

[0116] Each order operation record uniquely represents a record of the specific operation information performed on an order after executing one of the order operations (create, fill, submit, or cancel). The order operation information in this application may be composed of multiple order operation records corresponding to each order operation performed on each order, used to represent the specific order operations performed on each order during the target backtesting period.

[0117] In other words, since the quantitative component currently does not support order modification for trading targets, the complete life cycle of an order corresponding to a trading target may include the following situations:

[0118] 1) Place order (waiting for submission) Submit (submitted) Cancel order (cancel all orders)

[0119] 2) Order placed (waiting for submission) Submitted (submitted) Executed (all executed)

[0120] 3) Place an order (wait for submission) Cancel an order (cancel all orders)

[0121] 4) Place order (waiting for submission) Trigger (waiting for submission) Submit (submitted) Cancel order (cancel all orders)

[0122] 5) Order placed (waiting for submission) triggered (waiting for submission) submitted (submitted) executed (all executed)

[0123] 1) and 2) are possible operation paths for basic orders, while 3), 4), and 5) are possible operation paths for conditional orders. During the operation of each order, only the order status changes; fields such as price and quantity remain unchanged.

[0124] Therefore, in order to comprehensively and efficiently analyze the latest operation status of each order executed before the target backtest time point, this application can pre-build an order association record table. This order association record table can use key-value pairs to store each order operation executed.

[0125] Therefore, during the quantitative backtesting of a quantitative trading strategy, whenever an order execution operation is detected, this application will first determine the order ID corresponding to the order execution operation, thereby determining the associated order to which the order execution operation refers. The order execution operation may include order placement, order triggering, order submission, order execution, and order cancellation.

[0126] Then, as shown in Figure 6, a new order operation record is generated for the order execution operation under the associated order in the order association record table. The order operation record may include an order ID, an order operation status, and an order operation timestamp.

[0127] From this, we can see that the order association record uses the order ID of each order as the key name and the order operation records corresponding to each operation executed for the order as the value, and can store multiple order operation records executed for each order.

[0128] Based on the above content, for the target order list at the target backtesting time point, this application can select the latest order operation record for each order within the target backtesting period in the order association record table; and generate the target order list at the target backtesting time point based on the order identifier and order operation status in the latest order operation record.

[0129] In other words, when a user's progress adjustment operation for any target backtesting time point within the backtesting progress bar is detected, the system can search for the last order operation record before the target backtesting time point from the multiple order operation records corresponding to each order in the order association record table. This record is used as the latest order operation record for that order within the target backtesting period. Subsequently, by merging the order identifiers and order operation statuses within each of the latest order operation records, a list of target orders at the target backtesting time point can be generated.

[0130] Taking order 1000, order 1001, and order 1002 shown in Figure 6 as an example, during the quantitative backtesting process, order 1000 was placed on January 1, submitted on January 2, and canceled on January 6; order 1001 was placed on January 3, submitted on January 5, and executed on January 8; order 1002 was placed on February 1, submitted on February 5, and canceled on February 6.

[0131] Then, if the target backtesting time point is January 3, the target order list may show order 1000 in the submitted state, order 1001 in the pending submission state, and order 1002 not displayed.

[0132] If the target backtesting time point is January 7, the target order list may show order 1000 in the fully canceled state, order 1001 in the submitted state, and order 1002 not displayed.

[0133] If the target backtesting time point is February 5, the target order list may be that order 1000 is in the fully canceled state, order 1001 is in the fully executed state, and order 1002 is in the submitted state.

[0134] If the target backtesting time point is February 6, the target order list may be that order 1000 is in a fully cancelled state, order 1001 is in a fully executed state, and order 1002 is in a fully executed state.

[0135] S330, determining the target market information at the target backtest time point based on the historical market data of the transaction target within the target backtest period.

[0136] In order to ensure a comprehensive backtest of the target's backtest status at any backtest time point during the quantitative backtesting process, in addition to determining the target's trading information at the target backtest time point by analyzing the entire historical trading status of the trading target executed before the target backtest time point, this application also requires analyzing the current market value of the trading target at the target backtest time point.

[0137] In this application, the historical market data of the trading target set during the target backtest period, such as historical K-line and historical prices, can be read from the backtest market modules such as the above-mentioned quotation module and K-line module. Then, by analyzing this historical market data, the target market information at the target backtest time point can be determined.

[0138] It should be noted that S320 and S330 in this application are specific steps for analyzing the target backtest status at the target backtest time point from two different aspects. There is no specific order of execution between S320 and S330. They can be executed simultaneously or sequentially, and this application does not limit this.

[0139] As an optional implementation scheme in the present application, the target market information at the target backtesting time point in the present application may include but is not limited to the transaction price and historical K-line data of the transaction target at the target backtesting time point.

[0140] Then, for the underlying market information at the target backtest time point, as shown in FIG7 , this application can determine it through the following steps:

[0141] S71, determining the target transaction price at the target backtest time point based on the associated K-line data of the transaction target at the target backtest time point.

[0142] Considering that K-line data comprehensively describes the opening price, closing price, highest price, and lowest price of the transaction target within the K-line period, thereby indicating the market value trend of the transaction target within the K-line period, in order to ensure the accuracy of the transaction price analysis of the target through K-line data, this application can use segmented K-line data.

[0143] Therefore, for any target backtest time point, this application can first determine whether the target backtest time point is in the trading period of the trading target. If so, the 1-minute K-line data of the target backtest time point is obtained as the associated sub-K-line data of the trading target at the target backtest time point. If not, the 1-minute K-line data corresponding to the previous minute before the target backtest time point is obtained as the associated sub-K-line data of the trading target at the target backtest time point.

[0144] Then, by determining the order between the target backtest time point and the closing time point of the associated sub-K line data, we can determine whether the associated sub-K line data has closed. If the associated sub-K line data has closed, the closing price of the associated sub-K line data can be directly used as the underlying transaction price at the target backtest time point.

[0145] If the associated sub-K-line data has not yet closed, the target transaction price at the target backtest time point is determined from the opening price, closing price, highest price and lowest price of the associated sub-K-line data by analyzing the specific interval in which the target backtest time point is located within the K-line period of the associated sub-K-line data.

[0146] Specifically, the present application can evenly divide the K-line period of the associated sub-K-line data into four time intervals, and each time interval can be associated with one of the opening price, closing price, highest price, and lowest price of the associated sub-K-line data. The corresponding remainder is obtained by performing a modulo-60 operation on the target backtest time point.

[0147] If the remainder is less than 15, it means that the target backtest time point is within the first quarter time interval of the K-line period of the associated sub-K-line data, so the opening price of the associated sub-K-line data can be used as the underlying transaction price at the target backtest time point.

[0148] If the remainder is greater than or equal to 15 but less than 30, it means that the target backtest time point is within the second quarter time interval of the K-line period of the associated sub-K-line data, so the lowest price of the associated sub-K-line data can be used as the underlying transaction price at the target backtest time point.

[0149] If the remainder is greater than or equal to 30 but less than 45, it means that the target backtest time point is within the third quarter time interval of the K-line period of the associated sub-K-line data, so the highest price of the associated sub-K-line data can be used as the underlying transaction price at the target backtest time point.

[0150] If the remainder is greater than 45, it means that the target backtest time point is within the fourth quarter time interval of the K-line period of the associated sub-K-line data, so the closing price of the associated sub-K-line data can be used as the underlying transaction price at the target backtest time point.

[0151] In some implementations, given that the market prices of trading targets such as stocks and funds may fluctuate due to company actions such as dividends, rights issues, stock splits, and stock consolidations, without price adjustment, the market price data will not accurately reflect the actual fluctuations in the trading targets. Therefore, to ensure the accuracy of the target trading price, this application may also adjust the target trading price at the target backtesting time point to accurately represent the actual fluctuations in the trading targets.

[0152] S72, determining historical K-line data within the K-line period at the target backtest time point based on the target K-line data of the transaction subject corresponding to the K-line period selected at the target backtest time point within the target backtest period.

[0153] Optionally, this application can provide the user with all K-line periods of the K-line data that he currently wants to view, such as minute K-line, hourly K-line, daily K-line, monthly K-line, etc., to support the user to view historical K-line data of different periods at a certain backtest time point.

[0154] Among them, the K-line cycle provided to the user for selection can be customized in advance. For example, 20 days can be used as a K-line cycle, or one week can be used as a K-line cycle. This application does not limit this.

[0155] In this application, for any target backtest time point, the K-line period selected by the user for viewing at that target backtest time point can first be determined. Then, by analyzing the asset change information of the transaction target during the period of overlap between the target backtest period and the K-line period, the target K-line data corresponding to that K-line period can be determined. Furthermore, by processing this target K-line data, the historical K-line data within that K-line period at the target backtest time point can be obtained.

[0156] In some implementations, by analyzing the relationship between the target backtest time point and the K-line period selected by the user at the target backtest time point, it is possible to determine whether the K-line data for a K-line period has closed at the target backtest time point. If the K-line data for that K-line period has closed at the target backtest time point, it indicates that the unadjusted K-line data backdated at the target backtest time point is identical to the actual K-line data at the target backtest time point. Therefore, the K-line data for that K-line period can be directly retrieved as the historical K-line data for that K-line period.

[0157] However, if the K-line data of the K-line period has not closed at the target backtest time point, then the non-adjusted K-line data traced back at the target backtest time point will be different from the real K-line data at the target backtest time point, and the real K-line data of the K-line period cannot be directly used to determine the historical K-line data within the K-line period.

[0158] For example, if the target backtesting time point is 12:00 noon on Wednesday, and the user wants to view the weekly K-line chart for that week, then the backend can obtain the complete K-line pattern for that week (that is, the real K-line data after Friday's close), which includes the market data after 12:00 noon on Wednesday. However, it is actually impossible to obtain future market data at the target backtesting time point, making it impossible to directly use the real K-line data of the K-line period to determine the historical K-line data within the K-line period at the target backtesting time point.

[0159] Therefore, for the historical K-line data within the K-line cycle at the target backtest time point, this application can determine the divisible sub-cycles of the K-line cycle within the target backtest period based on the K-line cycle selected at the target backtest time point; and determine the historical K-line data within the K-line cycle at the target backtest time point based on the target K-line data of the trading target in each divisible sub-cycle.

[0160] In other words, based on the K-line period selected by the user at the target backtest time point, the K-line start time point and the actual K-line closing time point corresponding to the historical K-line data for that K-line period can be determined. If the K-line data for that K-line period has not yet closed at the target backtest time point, the target backtest time point can be determined to be before the actual K-line closing time point, as shown in Figure 8.

[0161] Then, in order to avoid the influence of market data after the target backtest time point on the historical K-line data in the K-line cycle at the target backtest time, the present application can divide the time period from the K-line start time point within the K-line cycle to the target backtest time point according to the K-line closing situation of different cycles, and obtain multiple divisible sub-cycles of the K-line cycle within the target backtest period, so that the K-line data in each divisible sub-cycle has been closed.

[0162] Then, you can directly obtain the target K-line data of the trading target in each divisible sub-period. Then, according to the time sequence of each divisible sub-period, you can merge the target K-line data of each divisible sub-period to obtain the historical K-line data within the K-line period at the target backtest time point.

[0163] For example, as shown in Figure 8, a specific K-line period can be divided into multiple K-line periods corresponding to closed daily K-lines, hourly K-lines, and minute K-lines within the target backtest period. The last remaining period is less than one minute and can be ignored. By merging the target K-line data for each divisible sub-period, namely the target daily K-line, target hourly K-line, and target minute K-line, the historical K-line data for that K-line period at the target backtest time point can be obtained.

[0164] For example, if the target backtesting time is 12:00 PM on Wednesday and the user is viewing a week's worth of candlestick chart data, the candlestick chart period could include all of Monday, all of Tuesday, and multiple hours on Wednesday morning. Therefore, by combining Monday's daily candlestick chart, Tuesday's daily candlestick chart, and each hourly candlestick chart on Wednesday morning, we can obtain the candlestick chart data for the week ending at 12:00 PM on Wednesday.

[0165] For example, if the target backtesting time is 11:53:40 a.m. on Wednesday and the user is viewing a week's worth of candlestick chart data, the candlestick chart cycle would include all of Monday, all of Tuesday, the hourly intervals from 9:00 to 10:00 and 10:00 to 11:00 a.m. on Wednesday, and the 53 minute intervals from 11:00 to 11:53 a.m. Therefore, by combining Monday's daily candlestick chart, Tuesday's daily candlestick chart, the hourly candlestick charts from 9:00 and 10:00 a.m. on Wednesday, and the 53 minute candlestick charts from 11:00 to 11:53 a.m., we can obtain the candlestick chart data for the week ending at 11:53:40 a.m. on Wednesday.

[0166] It can be understood that when determining the historical K-line data within the K-line period at the target backtest time point, yesterday's closing price of the historical K-line data can be yesterday's closing price of the target K-line data in the first divisible sub-period.

[0167] The opening price of the historical K-line data may be the opening price of the target K-line data in the first divisible sub-period.

[0168] The closing price of the historical K-line data may be the closing price of the target K-line data in the last divisible sub-period.

[0169] The highest price of the historical K-line data may be the maximum value among the highest prices of the target K-line data in each divisible sub-period.

[0170] The lowest price of the historical K-line data may be the minimum value among the lowest prices of the target K-line data in each divisible sub-period.

[0171] The transaction volume of the historical K-line data may be the sum of the transaction volumes of the target K-line data in each divisible sub-period.

[0172] The transaction volume of the historical K-line data may be the sum of the transaction volumes of the target K-line data in each divisible sub-period.

[0173] The technical solution provided in the embodiments of the present application comprehensively analyzes the target backtesting status at the target backtesting time point from two aspects: the historical trading status and the current market value of the trading target at the target backtesting time point. This enables information backtracking of the target backtesting status at any backtesting time point during the quantitative backtesting process, supports users in viewing the intermediate status of the target during the quantitative backtesting process more comprehensively, and improves the comprehensiveness of the quantitative backtesting.

[0174] According to one or more embodiments of the present application, during the quantitative backtesting of a quantitative trading strategy, each time an order is executed by the trading target, the historical position list is updated through temporary archiving. Furthermore, each time the trading target executes any of the following operations, such as order creation, execution, submission, and cancellation, an order association record table is maintained to store each executed order operation record. Order execution is one type of order execution operation.

[0175] Therefore, in order to ensure the accurate update of the temporary archive of the position list and the order association record table, this application can explain the specific update process of the temporary archive of the position list and the order association record table by analyzing any order operation executed each time the trading target is in the quantitative backtesting process.

[0176] During the quantitative backtesting process of the quantitative trading strategy, it will be detected in real time whether the trading target is currently executing any of the various order execution operations, such as order creation, order completion, order submission, and order cancellation, to determine whether the position list needs to be temporarily archived and the order association record table needs to be updated.

[0177] Whenever an order execution operation is detected, the order ID corresponding to the order execution operation is first determined, thereby identifying the associated order targeted by the order execution operation. A new order operation record is then generated for the order execution operation under the associated order in the maintained order association record table. This order operation record may include the order ID of the associated order, the order operation status, and the order operation timestamp.

[0178] Then, for each order execution operation performed by the trading target during the quantitative backtesting process, the order association record will use the order ID of each order as the key name and the order operation record corresponding to each operation performed by the trading target on the order as the value to store multiple order operation records executed for each order, so that the corresponding target order list can be generated by subsequently querying the order operation records within the target backtesting period.

[0179] Since order completion operations are a type of order execution operations, each time an order execution operation is detected during the quantitative backtesting process, while updating the order operation record in the maintained order association record table, it will also determine whether the order execution operation is an order completion operation.

[0180] If the order execution operation is a fill operation, it means that a new fill order has occurred at the current backtest time point, causing the current position information to change. Therefore, this application can use this new fill order to update the position information in the current position list temporary archive, obtaining a new position list temporary archive. This cycle will continue until the quantitative backtest is completed, and the final position list temporary archive will be obtained.

[0181] In order to avoid obtaining the full amount of order transaction information when backtracking the target position list at any backtesting time point during the quantitative backtesting process, the present application can pre-set a number of order transactions for each interval storage of the position list temporary archive during the quantitative backtesting process of the quantitative trading strategy, that is, the preset order transaction number in the present application. Then, during the quantitative backtesting process, the number of detected order transaction operations can be counted to analyze the current order transaction number in real time. Furthermore, during the quantitative backtesting process, when the preset order transaction number is reached at each interval, the current position list temporary archive can be stored once to store the corresponding position list archive at multiple backtesting time points corresponding to each preset order transaction number, thereby realizing the interval storage of the position list archive during the quantitative backtesting process.

[0182] FIG9 is a block diagram of a backtest data processing device provided in an embodiment of the present application. As shown in FIG9 , the device 900 may include:

[0183] The progress bar generation module 910 is used to display the corresponding backtest progress bar according to the backtest start and end time points of any quantitative trading strategy;

[0184] A backtest time determination module 920 is configured to determine a target backtest time point in response to a touch operation on the backtest progress bar;

[0185] A backtest status determination module 930 is configured to determine the target backtest status of the target at the target backtest time point based on the order operation information and historical market data of the target within the quantitative trading strategy during the target backtest period;

[0186] The target backtesting period is the time period from the backtesting start time point to the target backtesting time point in the backtesting progress bar.

[0187] In some implementations, the backtest status determination module 930 may include:

[0188] A target determination unit, configured to determine a transaction target within the quantitative trading strategy;

[0189] A transaction information backtracking unit, configured to determine the target transaction information at the target backtesting time point based on the order operation information of the transaction target within the target backtesting period;

[0190] The market information backtracking unit is used to determine the target market information at the target backtest time point based on the historical market data of the transaction target within the target backtest period.

[0191] In some possible implementations, the order operation information includes: order transaction information and order operation status, and the target transaction information includes a target transaction list, a target position list, and a target order list.

[0192] Accordingly, the transaction information backtracking unit may include:

[0193] The first backtesting sub-unit is configured to generate a target transaction list and a target position list at the target backtesting time point based on the order execution information of the transaction target within the target backtesting period;

[0194] The second backtesting sub-unit is used to generate a target order list at the target backtesting time point according to the order operation status of the transaction target within the target backtesting period.

[0195] In some implementations, the backtest data processing device 900 may further include a position list archiving module. The position list archiving module may be used to:

[0196] During the quantitative backtesting process of the quantitative trading strategy, each time an order execution operation is detected, the temporary archive of the position list is updated, and the initial value of the temporary archive of the position list is empty;

[0197] During the quantitative backtesting process of the quantitative trading strategy, the current backtesting time point is obtained once every preset number of order transactions, and the currently updated position list is temporarily archived once to obtain the position list archive at the current backtesting time point.

[0198] Accordingly, the first backtracking subunit can be specifically used for:

[0199] Determine the latest position list archive within the target backtest period and the historical backtest time point corresponding to the latest position list archive;

[0200] Based on the latest position list archive and the order transaction information of the trading target in the time period to be traversed, the target position list at the target backtest time point is generated, and the time period to be traversed is the time period from the historical backtest time point to the target backtest time point.

[0201] In some implementations, the backtest data processing device 900 may further include an order association recording module. The order association recording module may be used to:

[0202] During the quantitative backtesting process of the quantitative trading strategy, each time an order execution operation is detected, a new order operation record is generated under the associated order in the order association record table. The order operation record includes an order identifier, an order operation status, and an order operation timestamp.

[0203] Accordingly, the second backtracking subunit can be specifically used for:

[0204] In the order association record table, the latest order operation record within the target backtesting period is selected for each order;

[0205] Generate a target order list at the target backtest time point based on the order identifier and order operation status in the latest order operation record.

[0206] In some implementations, the market information backtracking unit may include:

[0207] A third backtesting sub-unit is configured to determine the underlying transaction price at the target backtesting time point based on the associated K-line data of the transaction target at the target backtesting time point;

[0208] The fourth backtesting sub-unit is used to determine the historical K-line data within the K-line period at the target backtesting time point based on the target K-line data of the trading target corresponding to the K-line period selected at the target backtesting time point during the target backtesting period.

[0209] In some implementations, the fourth backtracking subunit may be specifically configured to:

[0210] Determine, according to the K-line period selected at the target backtest time point, the sub-periods into which the K-line period can be divided within the target backtest period;

[0211] According to the target K-line data of the transaction subject in each of the divisible sub-periods, the historical K-line data within the K-line period at the target backtest time point is determined.

[0212] In an embodiment of the present application, for the quantitative backtesting of any quantitative trading strategy, a corresponding backtesting progress bar can be displayed based on the backtesting start and end time points of the quantitative trading strategy. Then, after the quantitative backtesting is completed, the target backtesting time point is determined in response to a touch operation on the backtesting progress bar; further, based on the order operation information and historical market data of the trading target within the quantitative trading strategy during the target backtesting period, the target backtesting status at the target backtesting time point is determined, thereby realizing information backtracking of the target backtesting status at any backtesting time point during the quantitative backtesting process, supporting users to better view the backtesting status of the trading target at any intermediate time point during the quantitative backtesting process, and improving the comprehensiveness of the quantitative backtesting.

[0213] It should be understood that the device embodiments and method embodiments may correspond to each other, and similar descriptions may refer to the method embodiments. To avoid repetition, they will not be described in detail here. Specifically, the device 900 shown in Figure 9 can execute any method embodiment provided by this application, and the aforementioned and other operations and / or functions of each module in the device 900 are respectively for implementing the corresponding processes in each method of the embodiment of this application. For the sake of brevity, they will not be described in detail here.

[0214] The above describes the device 900 of the embodiment of the present application from the perspective of functional modules in conjunction with the accompanying drawings. It should be understood that the functional module can be implemented in hardware form, can be implemented by instructions in software form, and can also be implemented by a combination of hardware and software modules. Specifically, the steps of the method embodiment in the embodiment of the present application can be completed by the hardware integrated logic circuit and / or software form instructions in the processor. The steps of the method applied in conjunction with the embodiment of the present application can be directly embodied as being executed by a hardware decoding processor, or can be executed by a combination of 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 random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps in the above method embodiment in conjunction with its hardware.

[0215] FIG10 is a schematic block diagram of an electronic device provided in an embodiment of the present application.

[0216] As shown in FIG10 , the electronic device 1000 may include:

[0217] The memory 1010 and the processor 1020 are configured to store computer programs and transmit the program code to the processor 1020. In other words, the processor 1020 can call and execute the computer program from the memory 1010 to implement the method in the embodiment of the present application.

[0218] For example, the processor 1020 may be configured to execute the above method embodiments according to instructions in the computer program.

[0219] In some embodiments of the present application, the processor 1020 may include but is not limited to:

[0220] General-purpose processor, Digital Signal Processor (DSP), Application Specific Integrated Circuit (ASIC), Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc.

[0221] In some embodiments of the present application, the memory 1010 includes but is not limited to:

[0222] Volatile memory and / or non-volatile memory. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus random access memory (DR RAM).

[0223] In some embodiments of the present application, the computer program may be divided into one or more modules, which are stored in the memory 1010 and executed by the processor 1020 to implement the method provided by the present application. The one or more modules may be a series of computer program instruction segments capable of implementing specific functions, and the instruction segments are used to describe the execution process of the computer program in the electronic device.

[0224] As shown in FIG10 , the electronic device may further include:

[0225] The transceiver 1030 may be connected to the processor 1020 or the memory 1010 .

[0226] The processor 1020 may control the transceiver 1030 to communicate with other devices. Specifically, the processor 1020 may send information or data to other devices or receive information or data sent by other devices. The transceiver 1030 may include a transmitter and a receiver. The transceiver 1030 may further include one or more antennas.

[0227] It should be understood that the various components in the electronic device are connected via a bus system, wherein the bus system includes not only a data bus but also a power bus, a control bus and a status signal bus.

[0228] The present application also provides a computer storage medium having a computer program stored thereon, which, when executed by a computer, enables the computer to perform the method of the above-mentioned method embodiment. In other words, the present application also provides a computer program product containing instructions, which, when executed by a computer, enables the computer to perform the method of the above-mentioned method embodiment.

[0229] When software is used for implementation, 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 process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a digital video disc (DVD)), or a semiconductor medium (e.g., a solid state drive (SSD)).

[0230] Those skilled in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments applied for herein can be implemented with electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0231] In the several embodiments provided in this 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 schematic. For example, the division of the modules is merely a logical function division. In actual implementation, there may be other division methods, such as 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 mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0232] Modules described as separate components may or may not be physically separate, and components displayed as modules may or may not be physical modules, i.e., they may be located in one place or distributed across multiple network elements. Some or all of the modules may be selected based on actual needs to achieve the purpose of the present embodiment. For example, the functional modules in the various embodiments of the present application may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into a single module.

[0233] The above are only specific embodiments of the present application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. A backtest data processing method, characterized in that: include: According to the backtest start and end time points of any quantitative trading strategy, the corresponding backtest progress bar is displayed; In response to a touch operation on the backtest progress bar, determining a target backtest time point; Determine the target backtesting status at the target backtesting time point according to the order operation information and historical market data of the trading target in the quantitative trading strategy within the target backtesting period; The target backtesting period is the time period from the backtesting start time point to the target backtesting time point in the backtesting progress bar.

2. The method according to claim 1, characterized in that Determining the target backtesting status at the target backtesting time point according to the order operation information and historical market data of the trading target in the quantitative trading strategy within the target backtesting period includes: Determine the transaction subject within the quantitative trading strategy; Determine the target transaction information at the target backtest time point according to the order operation information of the transaction target within the target backtest period; Determine the target market information at the target backtest time point based on the historical market data of the transaction target within the target backtest period.

3. The method according to claim 2, characterized in that The order operation information includes: order transaction information and order operation status, and the underlying transaction information includes the underlying transaction list, the underlying position list and the underlying order list; Accordingly, determining the target transaction information at the target backtest time point according to the order operation information of the transaction target within the target backtest period includes: Generate a target transaction list and a target position list at the target backtest time point according to the order transaction information of the transaction target within the target backtest period; According to the order operation status of the transaction target within the target backtesting period, a target order list at the target backtesting time point is generated.

4. The method according to claim 3, characterized in that The method further comprises: During the quantitative backtesting process of the quantitative trading strategy, each time an order execution operation is detected, the temporary archive of the position list is updated, and the initial value of the temporary archive of the position list is empty; During the quantitative backtesting process of the quantitative trading strategy, the current backtesting time point is obtained once every preset order transaction quantity, and the currently updated position list is temporarily archived once to obtain the position list archive at the current backtesting time point; Correspondingly, generating a list of target holdings at the target backtesting time point according to the order fulfillment information of the transaction target within the target backtesting period includes: Determine the latest position list archive within the target backtest period and the historical backtest time point corresponding to the latest position list archive; According to the latest position list archive and the order transaction information of the trading target in the time period to be traversed, the target position list at the target backtest time point is generated, and the time period to be traversed is the time period from the historical backtest time point to the target backtest time point.

5. The method according to claim 3, characterized in that: The method further comprises: During the quantitative backtesting process of the quantitative trading strategy, each time an order execution operation is detected, a new order operation record is generated under the associated order in the order association record table, and the order operation record includes an order identifier, an order operation status and an order operation timestamp; Correspondingly, generating a target order list at the target backtest time point according to the order operation status of the transaction target within the target backtest period includes: In the order association record table, the latest order operation record under each order within the target backtesting period is selected respectively; Generate a target order list of the transaction target at the target backtest time point according to the order identifier and the order operation status in the latest order operation record.

6. The method according to claim 2, characterized in that The determining, based on the historical market data of the transaction subject within the target backtesting period, the market information of the subject at the target backtesting time point includes: Determine the target transaction price at the target backtest time point according to the associated K-line data of the transaction target at the target backtest time point; According to the target K-line data of the transaction subject corresponding to the K-line period selected at the target backtesting time point during the target backtesting period, the historical K-line data within the K-line period at the target backtesting time point is determined.

7. The method according to claim 6, characterized in that The determining, according to the target K-line data of the transaction subject corresponding to the K-line period selected at the target backtest time point during the target backtest period, the historical K-line data within the K-line period at the target backtest time point comprises: According to the K-line period selected at the target backtesting time point, determining the sub-periods into which the K-line period can be divided within the target backtesting period; According to the target K-line data of the transaction subject in each of the divisible sub-periods, the historical K-line data within the K-line period at the target backtest time point is determined.

8. A backtest data processing device, characterized in that: include: The progress bar generation module is used to display the corresponding backtest progress bar according to the backtest start and end time points of any quantitative trading strategy; A backtest time determination module, configured to determine a target backtest time point in response to a touch operation on the backtest progress bar; A backtesting status determination module, used to determine the target backtesting status at the target backtesting time point according to the order operation information and historical market data of the trading target in the quantitative trading strategy within the target backtesting period; The target backtesting period is the time period from the backtesting start time point to the target backtesting time point in the backtesting progress bar.

9. An electronic device, characterized in that: include: A processor and a memory, wherein 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 backtest data processing method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: Used to store a computer program, wherein the computer program enables a computer to execute the backtest data processing method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Strategy back test method and strategy back test system

    CN110689436A

  • Financial transaction information back test method, system and device, and storage medium

    CN112184443A

  • Financial transaction data processing method and system

    CN114723566A

  • Market data processing method and device, equipment and storage medium

    CN114881663A

  • Transaction strategy back testing method and device and storage medium

    CN115039119A