Combination strategy backtest method and device, storage medium and computer program product
By using a combined backtesting module based on a backtesting tree structure in the backtesting strategy backtesting of financial product portfolio strategy, the problem of manual allocation of assets and low calculation accuracy is solved, and a more accurate and comprehensive backtesting report is achieved.
Patent Information
- Application Number
- CN202411043039.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2025-03-11
AI Technical Summary
In the backtesting of financial product portfolio strategy, the existing technology relies on manual allocation of assets and the accuracy is not high when calculating complex indicators, resulting in the backtesting results being unreliable and rich enough.
By obtaining the combined backtesting instructions sent by the client, the initial fund product combination and position adjustment records are retrieved, and the combined backtesting module constructed based on the backtesting tree structure is input for calculation to generate a deep backtesting report.
It improves the accuracy and speed of backtesting of financial product portfolio strategies, can calculate complex financial indicators, generate in-depth backtesting reports with multi-dimensional analysis, and provide a more comprehensive backtesting report.
Smart Images

Figure CN119599796A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a combination strategy backtesting method, device, storage medium and computer program product. Background Art
[0002] Backtesting the combination strategy of financial products is an important part of the development process of quantitative trading strategies, and it is also an important means to understand the profitability of financial product portfolios in the future market environment. When backtesting the combination strategy of financial products, asset allocation is one of the important steps to ensure that the backtest results are accurate and reliable. At present, the allocation ratio of assets mainly depends on manual configuration, and the backtesting logic of the combination strategy of financial products is relatively simple. It can only calculate indicators with relatively simple business logic, and it is difficult to calculate complex indicators, and the calculation accuracy is not high. The dependence of asset allocation on manual work and the difficulty in calculating complex indicators make it difficult to present reliable, rich and professional backtest indicator data reports, and it is impossible to provide investment references for investors.
[0003] Therefore, how to improve the backtesting accuracy of financial product portfolio strategies to obtain more comprehensive backtesting reports has become a problem that needs to be solved urgently.
[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention
[0005] The main purpose of this application is to provide a combination strategy backtesting method, device, storage medium and computer program product, aiming to solve the technical problem of how to improve the backtesting accuracy of financial product combination strategies to obtain a more comprehensive backtesting report.
[0006] To achieve the above objectives, the present application proposes a combination strategy backtesting method, the method comprising:
[0007] Get the combined backtesting instructions and deep backtesting report generation instructions sent by the client;
[0008] Retrieve the initial fund product portfolio and initial position adjustment records according to the portfolio backtesting instructions;
[0009] Input the initial fund product portfolio and the initial position adjustment record into a combination backtesting module constructed based on a backtesting tree structure for calculation to obtain daily position results and daily return results;
[0010] Generate a deep backtesting report based on the daily position results, the daily return results and the deep backtesting report generation instruction.
[0011] In one embodiment, before the step of retrieving the initial fund product portfolio and the initial portfolio adjustment record according to the portfolio backtesting instruction, the step further includes:
[0012] Obtain the initial fund product pool;
[0013] The initial fund product pool is input into an asset allocation module constructed based on a preset algorithm toolkit for processing to obtain an initial fund product portfolio and an initial position adjustment record.
[0014] In one embodiment, the step of inputting the initial fund product pool into an asset allocation module constructed based on a preset algorithm toolkit for processing to obtain an initial fund product portfolio and an initial position adjustment record further includes:
[0015] Setting different asset allocation modes according to the initial fund product pool, wherein the asset allocation modes include one or more of a manual creation mode, a fund allocation mode, and a top-down mode;
[0016] Perform asset model configuration for the fund configuration mode and the top-down mode according to a preset algorithm toolkit;
[0017] An asset configuration module is constructed based on the asset model configuration and the manual creation mode.
[0018] In one embodiment, the step of inputting the initial fund product pool into an asset allocation module constructed based on a preset algorithm toolkit for processing to obtain an initial fund product portfolio and an initial position adjustment record includes:
[0019] Get asset allocation request;
[0020] Input the initial fund product pool and the asset allocation request into the asset allocation module for preliminary analysis to obtain a fund product selection list;
[0021] Performing initial weight setting and ratio allocation of position adjustment records on the fund product selection list through the asset allocation model;
[0022] The initial fund product portfolio and initial position adjustment record are obtained according to the initial weight setting and the proportion allocation of the position adjustment record.
[0023] In one embodiment, the step of inputting the initial fund product portfolio and the initial position adjustment record into a combination backtesting module constructed based on a backtesting tree structure for calculation to obtain daily holding results and daily return results includes:
[0024] Get the backtest tree structure;
[0025] Creating a backtesting subtree structure according to the backtesting tree structure;
[0026] Establishing a deep analysis subtree structure based on the backtest subtree structure;
[0027] A backtesting module is constructed according to the backtesting subtree structure and the deep analysis subtree structure.
[0028] In one embodiment, the step of inputting the initial fund product portfolio and the initial position adjustment record into a combination backtesting module constructed based on a backtesting tree structure for calculation to obtain daily holding results and daily return results includes:
[0029] Establishing a long connection between the combined backtesting module and the client according to the combined backtesting instruction;
[0030] Based on the long connection, the initial fund product portfolio and the initial position adjustment record are input into the combination backtesting module for calculation to obtain daily holding results and daily return results.
[0031] In one embodiment, the step of inputting the initial fund product portfolio and the initial position adjustment record into the portfolio backtesting module for calculation based on the long connection to obtain the daily position result and the daily return result further includes:
[0032] Feedback the calculation progress in real time through the long connection, and write the daily position results and the daily income results into the cache;
[0033] After the daily position result and the daily income result are calculated, a calculation completion message is sent to the client through the long connection.
[0034] In one embodiment, the step of generating a deep backtesting report based on the daily position result, the daily return result and the deep backtesting report generation instruction includes:
[0035] Generate a portfolio overview report based on the calculation completion message and the daily return result;
[0036] A deep backtesting report is generated according to the deep backtesting report generation instruction, the portfolio overview report, and the daily position results.
[0037] In addition, to achieve the above-mentioned purpose, the present application also proposes a combination strategy backtesting device, which includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, and the computer program is configured to implement the steps of the combination strategy backtesting method as described above.
[0038] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the combination strategy backtesting method described above are implemented.
[0039] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the combined strategy backtesting method as described above.
[0040] One or more technical solutions proposed in this application have at least the following technical effects:
[0041] By obtaining the combination backtesting instructions and deep backtesting report instructions sent by the user on the client, the initial fund portfolio and initial position adjustment records are retrieved according to the combination backtesting instructions, and the asset allocation of the initial fund portfolio and initial position adjustment records is no longer dependent on manual work. The automated process greatly improves the speed and accuracy of the backtesting. The initial fund portfolio and initial position adjustment records are input into the pre-built combination backtesting module for calculation to obtain the daily position results and daily return results. The combination backtesting module has rich backtesting logic and can backtest different financial product combination strategies. It combines daily position results, daily return results, and deep backtesting report instructions to generate a multi-dimensional analysis of the deep backtesting report, which can evaluate the financial product combination strategy more comprehensively. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0044] Figure 1 A schematic diagram of a flow chart provided for the first embodiment of the combined strategy backtesting method of the present application;
[0045] Figure 2 A flowchart of the second embodiment of the combined strategy backtesting method of the present application is provided;
[0046] Figure 3 A flowchart diagram of the third embodiment of the combined strategy backtesting method of the present application;
[0047] Figure 4 This is a structural diagram of the asset configuration module;
[0048] Figure 5 A flowchart diagram of the fifth embodiment of the combined strategy backtesting method of the present application;
[0049] Figure 6 This is a diagram of the backtest Actor tree structure;
[0050] Figure 7 This is a schematic diagram of the overall architecture of online backtesting;
[0051] Figure 8 This is the online backtest timing diagram;
[0052] Fig. 9 This is a schematic diagram of the module structure of the combined strategy backtesting device according to an embodiment of the present application;
[0053] Fig.10 Schematic diagram of the device structure of the hardware operating environment involved in the combined strategy backtesting method in the embodiment of the present application.
[0054] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0055] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0056] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0057] The main solution of the embodiment of the present application is: by pre-building an asset allocation module and a combination backtesting module, an intelligent, distributed, and highly concurrent fund portfolio backtesting calculation platform is formed. By obtaining the combination backtesting instructions and deep backtesting report instructions sent by the user on the client, the initial fund portfolio and the initial position adjustment records are retrieved according to the combination backtesting instructions, and the asset allocation of the initial fund portfolio and the initial position adjustment records is no longer dependent on manual work. The automated process greatly improves the speed and accuracy of the backtest. The initial fund product portfolio and the initial position adjustment records are retrieved to facilitate subsequent backtesting of the portfolio strategy and improve the accuracy of the portfolio strategy backtesting. The initial fund product portfolio and the initial position adjustment records are input into the combination backtesting module for calculation, and a deep backtesting report is generated in combination with the calculated daily holding results and daily return results to improve the calculation accuracy of the backtest.
[0058] The embodiment of the present application takes into account that: in the current full-process solution for online backtesting of fund portfolio strategies, the allocation of assets mainly relies on manual work, which not only affects the effect and efficiency of asset allocation, but also has an adverse impact on the accuracy of subsequent deep backtesting. At the same time, the backtesting logic for backtesting fund portfolio strategies is too simple, and can only calculate indicators with relatively simple business logic. The calculation of complex indicators takes a long time and the calculation accuracy is not high, and the obtained backtesting report does not have an investment reference effect.
[0059] Therefore, the present application provides a solution, which constitutes an intelligent, distributed, and highly concurrent fund portfolio backtesting calculation platform by pre-building an asset allocation module and a portfolio backtesting module, reducing manual dependence and ensuring the accuracy of subsequent deep backtesting. By obtaining the portfolio backtesting instructions and deep backtesting report instructions sent by the user on the client, the initial fund portfolio and the initial position adjustment records are retrieved according to the portfolio backtesting instructions, so as to subsequently backtest the portfolio strategy. The initial fund product portfolio initial position adjustment records are input into the pre-built portfolio backtesting module. The portfolio backtesting module has a powerful backtesting processing logic and can calculate complex financial indicators. The deep backtesting report generated by the daily position results and daily return results processed by the portfolio backtesting module evaluates the effectiveness and future profitability of the portfolio strategy from multiple dimensions and in an all-round way, solving the technical problem of how to improve the backtesting accuracy of the financial product portfolio strategy to obtain a more comprehensive backtesting report.
[0060] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a fund portfolio backtesting calculation platform, etc. The following takes the fund portfolio backtesting calculation platform as an example to illustrate this embodiment and the following embodiments.
[0061] Based on this, the present application embodiment provides a combination strategy backtesting method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the combination strategy backtesting method of the present application.
[0062] In this embodiment, the combined strategy backtesting method includes steps S10 to S40:
[0063] Step S10, obtaining the combined backtesting instruction and the deep backtesting report generation instruction sent by the client;
[0064] The combined backtesting instruction is a backtesting request of the WebSocket communication type, which realizes full-duplex communication between the browser and the server, can better save server resources and bandwidth, and achieve the purpose of real-time communication. The user builds a deep backtesting report generation instruction according to his own needs in the client, that is, the visual interface, and the backtesting module obtains the deep backtesting report generation instruction.
[0065] The fund portfolio backtesting calculation platform obtains the portfolio backtesting instructions and deep backtesting report generation instructions sent by the client, and backtests the portfolio strategy according to the obtained instructions.
[0066] Step S20, retrieving the initial fund product portfolio and initial position adjustment record according to the portfolio backtesting instruction;
[0067] Parse the received portfolio backtesting instructions to ensure the integrity and correctness of the instructions, and verify whether the parameters in the instructions meet the system requirements or market rules during the parsing process. According to the parsed backtesting instructions, retrieve the corresponding initial fund product portfolio information, which may include the fund's name, code, holding ratio, purchase date, etc.
[0068] Furthermore, the initial position adjustment record related to the initial fund product portfolio is retrieved according to the backtesting instruction. The initial position adjustment record includes detailed information such as the time of position adjustment, position changes before and after the position adjustment, and the reason for the position adjustment.
[0069] Step S30, inputting the initial fund product portfolio and the initial position adjustment record into a combination backtesting module constructed based on a backtesting tree structure for calculation to obtain daily position results and daily return results;
[0070] After the initial fund product portfolio and the initial position adjustment records are input into the combination backtesting module built based on the backtesting tree structure, the combination backtesting module starts to execute the backtesting logic and calculates the daily holding results and daily return results of the portfolio within the backtesting time interval based on the initial fund product portfolio and the initial position adjustment records.
[0071] The portfolio backtesting module loads the required market data and ensures that the data of the initial fund product portfolio and the initial rebalancing record have been correctly entered into the backtesting system. Set the start and end dates of the backtest and determine the time range of the backtest, which should match the time background of the initial fund product portfolio and the initial rebalancing record.
[0072] Based on the initial fund product portfolio and the initial rebalancing record, simulate the portfolio's position changes. On each trading day during the backtest time period, adjust the position ratio according to the rebalancing record and calculate the corresponding holding cost. At the end of each trading day, calculate the portfolio's return based on the position and market data. This usually includes capital appreciation (changes in the value of holdings due to price changes) and dividend income (if the holdings include dividend-type financial products).
[0073] Step S40, generating a deep backtesting report based on the daily position results, the daily return results and the deep backtesting report generation instruction.
[0074] An in-depth backtesting report is generated based on the calculated daily holding results and daily return results. The analysis dimensions supported by the in-depth backtesting report include performance overview, position penetration, position adjustment analysis, risk analysis, scenario analysis, performance attribution, etc. The report contains charts, tables, text summaries and other information, and provides professional analysis and evaluation of the performance of the portfolio strategy generated after processing by the asset allocation module.
[0075] This embodiment provides a combination strategy backtesting method, which obtains the combination backtesting instructions and deep backtesting report instructions sent by the user on the client, retrieves the initial fund combination and the initial position adjustment record according to the combination backtesting instructions, and no longer relies on manual asset allocation of the initial fund combination and the initial position adjustment record. The automated process greatly improves the speed and accuracy of the backtest. The initial fund combination and the initial position adjustment record are input into the pre-built combination backtesting module for calculation to obtain the daily position results and daily return results. The combination backtesting module has rich backtesting logic, and can backtest different financial product combination strategies. It combines the daily position results, daily return results, and deep backtesting report instructions to generate a deep backtesting report with multi-dimensional analysis, and more comprehensively evaluates the financial product combination strategy.
[0076] Based on the first embodiment of the present application, the second embodiment of the present application is proposed. In the second embodiment of the present application, the same or similar contents as those of the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following.
[0077] On this basis, please refer to Figure 2 , Figure 2 A schematic diagram of the second embodiment of the flow chart of the combined strategy backtesting method of the present application.
[0078] In this embodiment, before step S20 of retrieving the initial fund product portfolio and the initial position adjustment record according to the combination backtesting instruction, steps S121 to S122 are also included:
[0079] Step S121, obtaining an initial fund product pool;
[0080] The initial fund product pool is a collection of various different types of fund products, including stock funds, bond funds, hybrid funds, index funds, money market funds and other categories. It represents different investment directions, risk levels and return potentials, and is the basic element for building a fund portfolio based on strategy.
[0081] Load the configuration file containing the API interface on the fund portfolio backtesting calculation platform, and send an API request to the financial data information library of the professional financial data provider through the API interface in the configuration file to apply for access rights to the API interface. Once the response to the API request is received, verify the response status code to confirm whether the request is successful. The fund portfolio backtesting calculation platform parses the received response, extracts relevant information about funds and other financial products, and builds an initial fund product pool so that the product portfolio can be configured based on the initial fund product pool in the future.
[0082] It should be noted that the scheduled task execution cycle is set in the configuration file to automatically trigger the API call and data update process to update the fund product information in the initial fund product pool, providing a basis for subsequent backtesting with higher accuracy.
[0083] Step S122, input the initial fund product pool into the asset allocation module constructed based on the preset algorithm toolkit for processing, and obtain the initial fund product portfolio and the initial position adjustment record.
[0084] For the input initial fund product pool, the reference adjustment weight is calculated through tools such as the major asset allocation model and the fund weight allocation optimization model in the asset allocation module to construct the initial fund product portfolio and initial adjustment record.
[0085] The purpose of the asset allocation module is to provide an initial fund product portfolio and the initial portfolio adjustment record for portfolio backtesting. Different configuration methods are set according to different types of financial products in the initial fund product pool, so that fund products can be efficiently configured.
[0086] The initial fund product pool is input into the pre-configured asset allocation module. The asset allocation module converts the data format in the initial fund product pool into a format that matches the input end of the asset allocation module. The asset allocation module processes the data in the initial fund product pool after the format conversion, uses parallel computing and optimization algorithm technology to accelerate the calculation process, and monitors various indicators in the calculation process (such as convergence speed, error rate, etc.) to ensure the accuracy and reliability of the calculation results.
[0087] The initial fund product portfolio and initial rebalancing record are generated based on the calculation results of the asset allocation module. The initial fund product portfolio includes the selected fund products, the investment ratio of each product, expected returns and risks, etc. If the initial fund product portfolio is different from the existing investment portfolio (for example, the investor already holds some fund products), the asset allocation module needs to generate an initial rebalancing record, which will guide the investor on how to adjust his investment portfolio to match the initial fund product portfolio. The asset allocation module outputs the initial fund product portfolio and initial rebalancing record in an appropriate format for calculation and processing by the combined backtesting module.
[0088] In this embodiment, by processing the initial fund product pool in a pre-built asset allocation module, the real investment environment is better simulated, the initial fund portfolio and initial position adjustment records are constructed, and manual asset allocation is no longer required, thereby improving the accuracy and practicality of the backtest results.
[0089] Based on the first embodiment and / or the second embodiment of the present application, the third embodiment of the present application is proposed. In the third embodiment of the present application, the same or similar contents as those of the above-mentioned first and second embodiments can be referred to the above introduction, and will not be repeated in the following.
[0090] On this basis, please refer to Figure 3 , Figure 3 A schematic diagram of the third embodiment of the flow chart of the combined strategy backtesting method of the present application.
[0091] In this embodiment, the initial fund product pool is input into the asset allocation module constructed based on the preset algorithm toolkit for processing, and steps A121 to A123 are included before step S122 of obtaining the initial fund product portfolio and the initial position adjustment record:
[0092] Step A121, setting different asset allocation modes according to the initial fund product pool, wherein the asset allocation modes include one or more of a manual creation mode, a fund allocation mode, and a top-down mode;
[0093] Different asset allocation modes are set according to the product types of the initial fund product pool. Different asset allocation modes can generate portfolio strategies that are more in line with market rules, so as to improve the accuracy of subsequent backtesting. Among them, the manual creation mode is for users to customize the weights of portfolio products, and the fund allocation mode and top-down mode support the intelligent construction of product weights with the help of asset allocation models under multiple strategy objectives.
[0094] Step A122, configuring asset models for the fund configuration mode and the top-down mode according to a preset algorithm toolkit;
[0095] The algorithm toolkit provides two model toolkits: the mean-variance model and the Black-Litterman model, and accepts the call of the asset allocation module. Figure 4 As shown, Figure 4 The diagram is a structural diagram of the asset allocation module. The algorithm toolkit provides models for the fund allocation mode and the top-down mode of the asset allocation module as part of the asset model configuration of the fund allocation mode and the top-down mode.
[0096] Configuring asset models for fund allocation mode and top-down mode according to the preset algorithm toolkit is part of the final asset model configuration. In addition, the fund portfolio backtesting calculation platform also provides upper and lower limit settings and position adjustment settings for the fund allocation mode; and provides major asset allocation, upper and lower limit settings, and position adjustment settings for the top-down mode.
[0097] Step A123: construct an asset configuration module based on the asset model configuration and the manual creation mode.
[0098] After building asset model configuration for fund allocation mode and top-down mode, the asset allocation module is composed of the most critical asset model configuration and manual creation mode according to fund allocation mode and top-down mode. The asset allocation module combines the fund products in the initial fund product pool to obtain the initial fund product portfolio and portfolio adjustment records. The portfolio backtesting module performs portfolio backtesting on the initial fund product portfolio and portfolio adjustment records to test the profitability of the combination strategy that forms the initial fund product portfolio and portfolio adjustment records in the future market.
[0099] In this embodiment, different asset allocation modes are constructed based on the product characteristics of the initial fund product pool, asset model configuration is performed for the fund allocation mode and the top-down mode in the asset allocation mode, and the main asset allocation module is constructed by combining the asset model configuration and the manual creation mode in the asset allocation mode. The asset allocation module not only supports user-defined combination product weights, but also supports intelligent construction of product weights of multiple asset allocation models under multiple strategy objectives, which can form different types of combination strategies and improve the backtesting accuracy of subsequent backtesting to obtain a more comprehensive backtesting report.
[0100] Based on the above embodiments of the present application, a fourth embodiment of the method of the present application is proposed. In the fourth embodiment of the present application, the same or similar contents as those in the above embodiments can be referred to the above introduction, and will not be repeated in the following.
[0101] In this embodiment, the initial fund product pool is input into an asset allocation module constructed based on a preset algorithm toolkit for processing, and step S122 of obtaining an initial fund product portfolio and an initial position adjustment record includes steps S1 to S4:
[0102] Step S1, obtaining an asset allocation request;
[0103] The asset configuration request is a RESTful type request, which is sent to the asset configuration module by the user after operating in the visual interface. In web development, RESTful is a design style and development method for network applications, based on HTTP, stateless, client / server, cache communication protocol.
[0104] Step S2, inputting the initial fund product pool and the asset allocation request into an asset allocation module for preliminary analysis to obtain a fund product selection list;
[0105] The asset allocation module receives asset allocation requests sent by users in the visual interface and performs preliminary analysis on the initial fund product pool. For the input fund product pool, the reference position adjustment weight is calculated through tools such as the major asset allocation model and the fund weight allocation optimization model to construct the fund portfolio and position adjustment record.
[0106] Step S3, performing initial weight setting and ratio allocation of position adjustment records on the fund product selection list through the asset allocation model;
[0107] If the asset allocation mode is manual creation mode, the user selects a fund from the fund product selection list, and sets the weight and allocates the ratio of the selected fund.
[0108] If the asset allocation mode is the fund allocation mode, the fund products in the fund product selection list will be set with the configuration target through three steps: setting upper and lower limits of position holdings, setting models, and setting position adjustments. The system will automatically perform initial weight settings and proportion allocation of position adjustment records for the fund list selected by the user.
[0109] Among them, the model setting supports five options: equal weight, market value weight, Sharpe ratio maximization, risk minimization, and expected return maximization. Among them, equal weight means that the system automatically divides the total weight of the portfolio equally for the selected funds, and market value weight means that the system automatically allocates the total weight of the portfolio according to the scale ratio of the selected funds in the market on the trading day before the rebalancing day. The three methods of Sharpe ratio maximization, risk minimization, and expected return maximization are based on the historical return data of the funds selected by the user, and use the mean-variance model to allocate weights to the selected funds to achieve the optimization goal of the portfolio under the conditions set by the user. For example, expected return maximization means using the mean-variance model to allocate fund weights to achieve the goal of maximizing the annualized expected return of the portfolio when the portfolio meets the annualized risk cap set by the user.
[0110] When setting the position adjustment record, the user selects the position opening date and sets the rebalancing method. The rebalancing methods include: buy and hold, regular rebalancing, and designated date. The balancing rules include: return to initial weight and return to investment target.
[0111] If the fund allocation mode is a top-down mode, the fund product selection list will conduct asset allocation for the portfolio through a top-down weight distribution method, such as allocating the proportion of major asset categories and the proportion of funds in the major categories.
[0112] You can select asset classes (equity, debt, alternative, currency) for major class allocation, or you can choose indexes to replace asset classes for allocation between indexes. The allocation model provides two options: mean-variance model and Black-Litterman model. All four major categories use benchmark indices to calculate their major class returns. When using the mean-variance model, the supported allocation objectives include: minimizing risk, maximizing expected returns, maximizing the Sharpe ratio, and setting risk aversion. When using the Black-Litterman model, users can make biased opinions on major asset classes by setting risk aversion coefficients, scaling, return views, prior asset weights and other conditions. The model will output allocation recommendations for the major asset class based on the investor's biased opinions.
[0113] Step S4, obtaining the initial fund product portfolio and the initial position adjustment record according to the initial weight setting and the ratio allocation of the position adjustment record.
[0114] The initial fund product portfolio and initial reposition record are formed by the initial weight settings and reposition record allocations formed under the different asset allocation modes selected. For example, when the top-down mode is selected in the asset allocation module to perform asset allocation on the fund product selection list, the asset allocation module needs to select the corresponding configured funds for each asset category or index after selecting the configured asset category or index, and assign weights to the funds in each category. The funds corresponding to each category or index need to conform to the category type, and then the initial fund product portfolio and reposition record are generated in the same way as the fund allocation mode.
[0115] In this embodiment, by obtaining an asset allocation request, the asset allocation request and the initial fund product pool are input into the asset allocation module. The asset allocation module not only supports user-defined portfolio product weights, but also supports intelligent construction of product weights for multiple asset allocation models under multiple strategy objectives. By constructing product weights and adjusting the portfolio ratio, the initial fund product portfolio and initial portfolio adjustment record are obtained. Different asset allocation modes and automated asset allocation improve the accuracy of subsequent asset backtesting and can obtain a more comprehensive backtesting report.
[0116] Based on the above embodiments of the present application, a fifth embodiment of the method of the present application is proposed. In the fifth embodiment of the present application, the same or similar contents as those in the above embodiments can be referred to the above introduction, and will not be repeated in the following.
[0117] On this basis, please refer to Figure 5 , Figure 5 A flowchart diagram of the fifth embodiment of the combination strategy backtesting method of the present application is provided.
[0118] In this embodiment, the initial fund product portfolio and the initial position adjustment record are input into a combination backtesting module constructed based on a backtesting tree structure for calculation, and steps S231 to S234 are also included before step S30 to obtain daily position results and daily return results:
[0119] Step S231, obtaining a backtest tree structure;
[0120] The backtesting module is implemented based on the Actor model of the Akka framework. The Actor model of the Akka framework is a tree-structured concurrent programming model that decomposes computing tasks into independent Actors. Each Actor has its own state and behavior, and communicates with each other through asynchronous messaging.
[0121] The backtest tree structure obtained is actually based on the Actor tree structure model of the Akka framework, such as Figure 6 As shown, Figure 6 This is a schematic diagram of the backtesting Actor tree structure. This embodiment adds tasks to the basic tree structure to implement the construction of the backtesting module. When a deep backtesting task instruction is received, a corresponding sub-Actor (deep analysis) is created for execution.
[0122] Step S232, creating a backtesting subtree structure according to the backtesting tree structure;
[0123] refer to Figure 6 ,like Figure 6 As shown, first, a routing sub-root Actor (router) is created based on the initialization root Actor (root). The router's responsibility is to interact with the client (browser), accept client instructions, and create different sub-actors to perform corresponding tasks according to different instructions. After the task is completed, the result is responded to the client. Furthermore, according to the structural characteristics of the backtest tree structure, a sub-actor named backtest is created, that is, the backtest sub-tree structure. When receiving the backtest instruction, backtest splits the backtest task according to the position adjustment record, and multiple sub-tasks are parallelly calculated by multiple sub-actors (position_calc) to calculate the daily position of the combination.
[0124] Step S233, establishing a depth analysis subtree structure based on the backtest subtree structure;
[0125] refer to Figure 6 ,like Figure 6 As shown in the figure, after the backtest subtree structure is constructed, since the backtest subtree structure is mainly used to perform the calculation of the daily position task, after the daily position task is completed, a child Actor named factor_calc is created according to the backtest subtree structure, that is, backtest, which is the deep analysis subtree structure, to perform the calculation of daily returns and generate a portfolio overview report, including the portfolio's cumulative returns, maximum drawdown, annualized volatility, Sharpe ratio and other indicators.
[0126] Step S234, constructing a backtest module according to the backtest subtree structure and the depth analysis subtree structure.
[0127] The backtesting module actually calculates the daily positions and daily returns of the portfolio within the backtesting time period based on the initial portfolio weights and position adjustment records. The backtesting subtree structure is mainly used to perform the task of calculating daily positions, and the deep analysis subtree structure is mainly used to perform the task of calculating daily returns. Therefore, the backtesting subtree structure and the deep analysis subtree structure ultimately constitute the backtesting module.
[0128] refer to Figure 7 , Figure 7 The figure is a schematic diagram of the overall architecture of online backtesting. After the backtesting module is built, the backtesting module and the previously built asset allocation module together form a service module, which receives requests of the Restful communication type and the WebSocket communication type from the visual interface. Both the asset allocation and portfolio backtesting microservice components are distributed architectures, supporting multi-cluster and multi-instance deployment. The asset allocation service is of the Restful type, accepts asset allocation requests sent through the browser, and intelligently generates fund product weights and position adjustment records in the portfolio for users. The portfolio backtesting service is of the WebSocket type. Users initiate backtesting instructions, and the server executes the backtesting logic. Figure 7 The model algorithm module shown provides the asset allocation module with a toolkit of two models, the mean-variance model and the Black-Litterman model, accepts asset allocation service calls, and generates the optimal asset portfolio weights. The data module provides the asset allocation module and the portfolio backtesting module with basic information and market data such as funds, indexes, stocks, and risk-free interest rates.
[0129] In this embodiment, by obtaining the basic backtesting tree structure, the structural characteristics of the backtesting tree structure are used to construct a backtesting subtree for performing daily return and daily position calculation tasks, because the tree structure naturally supports modularization and detailed decomposition. In the backtesting process, the complex backtesting tasks are decomposed into subtasks such as daily return and daily position calculation, and organized through a tree structure, so that each subtask can be more focused on its specific function, thereby improving the accuracy of the overall backtesting. Each subtree is responsible for processing specific data and time periods, reducing the complexity of data processing and the possibility of errors, and improving the accuracy and reliability of backtesting.
[0130] Based on the above embodiments of the present application, a sixth embodiment of the method of the present application is proposed. In the sixth embodiment of the present application, the same or similar contents as those in the above embodiments can be referred to the above introduction, and will not be repeated in the following.
[0131] In this embodiment, the step S30 of inputting the initial fund product portfolio and the initial position adjustment record into a combination backtesting module constructed based on a backtesting tree structure for calculation to obtain daily position results and daily return results may include steps S301 to S302:
[0132] Step S301, establishing a long connection between the combined backtesting module and the client according to the combined backtesting instruction;
[0133] Receive the backtesting request of WebSocket communication type sent by the user through the browser, and establish a long connection between the combined backtesting module and the client. Long connection refers to a persistent TCP connection established between the client and the server. Unlike the short connection of the HTTP protocol, the long connection will not be disconnected immediately after the connection is established, but will remain active for a period of time so that data can be quickly transmitted when needed.
[0134] It should be noted that some issues need to be paid attention to when making long connections, such as the mechanism to keep the connection active (such as heartbeat packets), connection timeout and reconnection strategy, etc. Since TCP connections may be disconnected due to network problems or other reasons, a mechanism is needed to detect the status of the connection and reconnect when necessary.
[0135] Step S302: Based on the long connection, the initial fund product portfolio and the initial position adjustment record are input into the portfolio backtesting module for calculation to obtain daily holding results and daily return results.
[0136] like Figure 8 As shown, Figure 8It is an online backtesting sequence diagram. By receiving the backtesting instructions initiated by the user, the backtesting server executes the backtesting logic, calculates the daily position and daily income of the combination within the backtesting time interval according to the initial combination weights and the position adjustment records, and feeds back the calculation progress in real time through the long connection. The initial fund product combination and the initial position adjustment records are input into the combination backtesting module for calculation. The combination backtesting module splits the position calculation subtasks according to the initial position adjustment records, and calculates the daily position results and daily income results in parallel according to the initial fund product combination.
[0137] In this embodiment, a combination backtest instruction with a communication type of WebSocket is obtained, and the combination backtest instruction is input into the backtest module to build a long connection between the backtest module and the client. The combination backtest module uses the built long connection to calculate the initial fund combination and the initial position adjustment record to obtain the daily position results and daily return results. The long connection feature of WebSocket ensures real-time communication between the client and the backtest module. This means that the client can send backtest instructions or adjust parameters in real time, and the backtest module can respond immediately and return the calculation results. This real-time performance reduces the error caused by data synchronization delays, thereby improving the accuracy of the backtest. At the same time, because WebSocket supports the real-time transmission of large amounts of data, it can handle more complex backtest scenarios, thereby improving the accuracy and reliability of the backtest results.
[0138] Based on the above embodiments of the present application, a seventh embodiment of the method of the present application is proposed. In the seventh embodiment of the present application, the same or similar contents as those in the above embodiments can be referred to the above introduction, and will not be repeated in the following.
[0139] In this embodiment, based on the long connection, the initial fund product portfolio and the initial position adjustment record are input into the combination backtesting module for calculation to obtain the daily position result and the daily return result, and then the steps S303 to S304 are further included:
[0140] Step S303, providing real-time feedback of the calculation progress through the long connection, and writing the daily position results and the daily income results into the cache;
[0141] During the backtest calculation process, the backtest module encapsulates the calculation progress information into a message and sends it to the client through a WebSocket persistent connection. After receiving the progress information, the client parses it and displays it to the user so that the user can understand the real-time status of the backtest calculation.
[0142] The backtesting service module also organizes the daily position results and daily income results into a standardized data format for storage and query, and sends the daily position results and daily income results to the cache system through appropriate interfaces (such as API calls, direct operation of cache services, etc.). After receiving the data, the cache system stores the data in memory according to the configured cache strategy (such as expiration time, cache elimination algorithm, etc.).
[0143] It should be noted that in the process of feeding back the calculation progress and writing the calculation results into the cache, it is necessary to add an appropriate error handling mechanism to deal with connection failures, data format errors, cache system failures, etc.
[0144] Step S304, after the daily position result and the daily income result are calculated, a calculation completion message is sent to the client through the long connection.
[0145] In the backtesting module, when all calculation tasks (including daily position and profit calculations) have been completed and the results have been generated accurately, a clear flag or status is required to indicate that the calculation is complete. Therefore, a message object containing the calculation completion information is created. This message object should contain enough information so that the client can recognize that this is a notification of calculation completion, and may also contain some additional information, such as the total time taken for the calculation, whether any exceptions occurred, etc.
[0146] Furthermore, the message object is serialized into a format that can be transmitted by WebSocket, usually JSON or binary format. Make sure the serialized data is compact and easy to parse. Using the WebSocket connection, send the serialized message to the client. This usually involves calling one of the send methods in the WebSocket API and passing the serialized message as a parameter.
[0147] In this embodiment, the calculation progress is fed back in real time through the WebSocket long connection, and the daily position results and daily income results are written into the cache. After the daily position results and daily income results are calculated, the calculation completion message is sent to the client through the long connection. The real-time feedback of the calculation progress allows the client to understand the status of the backtesting process in a timely manner, which is crucial for timely discovery and handling of potential problems. If an exception or error occurs during the calculation process, it can be adjusted or corrected immediately to avoid the accumulation and expansion of errors, thereby improving the accuracy of the backtest.
[0148] Based on the above embodiments of the present application, an eighth embodiment of the method of the present application is proposed. In the eighth embodiment of the present application, the same or similar contents as those in the above embodiments can be referred to the above introduction, and will not be repeated in the following.
[0149] In this embodiment, the step S40 of generating a deep backtesting report based on the daily position result, the daily return result and the deep backtesting report generation instruction includes steps S401 to S402:
[0150] Step S401, generating a portfolio overview report according to the calculation completion message and the daily income result;
[0151] The portfolio overview report is a report that summarizes the key indicators and statistics of the portfolio performance over a specific time period. This report is usually used to show investors or analysts the overall performance and risk profile of the portfolio. In a backtesting environment, the portfolio overview report is an important tool for evaluating the effectiveness of trading strategies. The portfolio overview report is generated based on the calculation completion message and daily return results. The portfolio overview report includes return indicators, risk indicators, statistical distribution, detailed transaction records, etc.
[0152] Step S402, generating a deep backtesting report according to the deep backtesting report generation instruction, the portfolio overview report, and the daily position results.
[0153] like Figure 8 As shown in the figure, a deep backtest report is generated by combining the deep backtest report generation instruction, the portfolio overview report obtained in the previous step, and the daily position results. The analysis dimensions supported by the deep backtest report include performance overview, position penetration, position adjustment analysis, risk analysis, scenario analysis, performance attribution, etc. The report contains information such as graphs, tables, and text summaries, providing professional analysis and evaluation of the portfolio's performance.
[0154] In this embodiment, by obtaining the deep backtesting report generation instruction and combining it with the calculation completion message, the final deep backtesting report is generated according to the daily return results and daily position results, and the portfolio strategy is comprehensively analyzed. Through highly accurate historical market data, an investment transaction process that approximates the real thing is simulated to present a reliable, rich and professional backtesting indicator data report. The risk and return of the investment strategy are measured through the historical performance of the portfolio to improve the backtesting accuracy.
[0155] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the combination strategy backtesting method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0156] This application also provides a combined strategy backtesting device, please refer to Fig. 9 , the combined strategy backtesting device comprises:
[0157] The instruction acquisition module 10 is used to acquire the combined backtesting instruction and the deep backtesting report generation instruction sent by the client;
[0158] The fund portfolio backtesting calculation platform obtains the portfolio backtesting instructions and deep backtesting report generation instructions sent by the client, and backtests the portfolio strategy according to the obtained instructions.
[0159] The asset allocation module 20 is used to retrieve the initial fund product portfolio and the initial position adjustment record according to the portfolio backtesting instruction;
[0160] Parse the received portfolio backtesting instructions to ensure the integrity and correctness of the instructions, and verify whether the parameters in the instructions meet the system requirements or market rules during the parsing process. According to the parsed backtesting instructions, retrieve the corresponding initial fund product portfolio information, which may include the fund's name, code, holding ratio, purchase date, etc.
[0161] A combination backtesting module 30 inputs the initial fund product combination and the initial position adjustment record into a combination backtesting module constructed based on a backtesting tree structure for calculation to obtain daily position results and daily return results;
[0162] After the initial fund product portfolio and initial rebalancing records are input into the pre-built portfolio backtesting module, the portfolio backtesting module starts to execute the backtesting logic and calculates the daily holding results and daily return results of the portfolio within the backtesting time period based on the initial fund product portfolio and initial rebalancing records.
[0163] The report generation module 40 generates a deep backtesting report based on the daily position results, the daily return results and the deep backtesting report generation instruction.
[0164] An in-depth backtesting report is generated based on the calculated daily holding results and daily return results. The analysis dimensions supported by the in-depth backtesting report include performance overview, position penetration, position adjustment analysis, risk analysis, scenario analysis, performance attribution, etc. The report contains charts, tables, text summaries and other information, and provides professional analysis and evaluation of the performance of the portfolio strategy generated after processing by the asset allocation module.
[0165] The combined strategy backtesting device provided by the present application adopts the combined strategy backtesting method in the above embodiment, which can solve the technical problems of combined strategy backtesting. Compared with the prior art, the beneficial effects of the combined strategy backtesting device provided by the present application are the same as the beneficial effects of the combined strategy backtesting method provided by the above embodiment, and other technical features in the combined strategy backtesting device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0166] The present application provides a combination strategy backtesting device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the combination strategy backtesting method in the above-mentioned embodiment 1.
[0167] Reference below Fig.10 , which shows a schematic diagram of the structure of a combined strategy backtesting device suitable for implementing the embodiment of the present application. The combined strategy backtesting device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig.10 The combined strategy backtesting device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0168] like Fig.10As shown, the combined strategy backtesting device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the combined strategy backtesting device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the combined strategy backtesting device to communicate with other devices wirelessly or by wire to exchange data. Although the combined strategy backtesting device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or provided instead.
[0169] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0170] The combined strategy backtesting device provided by the present application adopts the combined strategy backtesting method in the above embodiment, which can solve the technical problems of combined strategy backtesting. Compared with the prior art, the beneficial effects of the combined strategy backtesting device provided by the present application are the same as the beneficial effects of the combined strategy backtesting method provided by the above embodiment, and the other technical features in the combined strategy backtesting device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0171] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0172] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0173] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the combination strategy backtesting method in the above-mentioned embodiment.
[0174] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0175] The above-mentioned computer-readable storage medium may be included in the combination strategy backtesting device; or it may exist independently without being assembled into the combination strategy backtesting device.
[0176] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the combination strategy backtesting device, the combination strategy backtesting device: obtains the combination backtesting instruction and the deep backtesting report generation instruction sent by the client; retrieves the initial fund product portfolio and the initial position adjustment record according to the combination backtesting instruction; inputs the initial fund product portfolio and the initial position adjustment record into the combination backtesting module constructed based on the backtesting tree structure for calculation to obtain daily position results and daily return results; generates a deep backtesting report based on the daily position results, the daily return results and the deep backtesting report generation instruction.
[0177] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0178] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0179] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0180] The readable storage medium provided in the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned combination strategy backtesting method, and can solve the technical problems of combination strategy backtesting. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the present application are the same as the beneficial effects of the combination strategy backtesting method provided in the above-mentioned embodiment, and will not be elaborated here.
[0181] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned combination strategy backtesting method when executed by a processor.
[0182] The computer program product provided by the present application can solve the technical problem of combined strategy backtesting. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the combined strategy backtesting method provided by the above embodiment, which will not be repeated here.
[0183] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A combination strategy backtesting method, characterized in that: Applied to a fund portfolio backtesting calculation platform, the method includes: Get the combined backtesting instructions and deep backtesting report generation instructions sent by the client; Retrieve the initial fund product portfolio and initial position adjustment records according to the portfolio backtesting instructions; Input the initial fund product portfolio and the initial position adjustment record into a combination backtesting module constructed based on a backtesting tree structure for calculation to obtain daily position results and daily return results; Generate a deep backtesting report based on the daily position results, the daily return results and the deep backtesting report generation instruction.
2. The method according to claim 1, characterized in that Before the step of retrieving the initial fund product portfolio and the initial position adjustment record according to the combination backtest instruction, the following steps are further included: Obtain the initial fund product pool; The initial fund product pool is input into an asset allocation module constructed based on a preset algorithm toolkit for processing to obtain an initial fund product portfolio and an initial position adjustment record.
3. The method according to claim 2, characterized in that Before the step of inputting the initial fund product pool into an asset allocation module constructed based on a preset algorithm toolkit for processing to obtain an initial fund product portfolio and an initial position adjustment record, the step further includes: Setting different asset allocation modes according to the initial fund product pool, wherein the asset allocation modes include one or more of a manual creation mode, a fund allocation mode, and a top-down mode; Perform asset model configuration for the fund configuration mode and the top-down mode according to a preset algorithm toolkit; An asset configuration module is constructed based on the asset model configuration and the manual creation mode.
4. The method according to claim 3, characterized in that The step of inputting the initial fund product pool into an asset allocation module constructed based on a preset algorithm toolkit for processing to obtain an initial fund product portfolio and an initial position adjustment record comprises: Get asset allocation request; Input the initial fund product pool and the asset allocation request into the asset allocation module for preliminary analysis to obtain a fund product selection list; Performing initial weight setting and ratio allocation of position adjustment records on the fund product selection list through the asset allocation model; The initial fund product portfolio and initial position adjustment record are obtained according to the initial weight setting and the proportion allocation of the position adjustment record.
5. The method according to claim 1, characterized in that The step of inputting the initial fund product portfolio and the initial position adjustment record into a combination backtesting module constructed based on a backtesting tree structure for calculation to obtain daily position results and daily return results includes: Get the backtest tree structure; Creating a backtesting subtree structure according to the backtesting tree structure; Establishing a deep analysis subtree structure based on the backtest subtree structure; A backtesting module is constructed according to the backtesting subtree structure and the deep analysis subtree structure.
6. The method according to claim 1, characterized in that The step of inputting the initial fund product portfolio and the initial position adjustment record into a combination backtesting module constructed based on a backtesting tree structure for calculation to obtain daily position results and daily return results comprises: Establishing a long connection between the combined backtesting module and the client according to the combined backtesting instruction; Based on the long connection, the initial fund product portfolio and the initial position adjustment record are input into the combination backtesting module for calculation to obtain daily holding results and daily return results.
7. The method according to claim 6, characterized in that After the step of inputting the initial fund product portfolio and the initial position adjustment record into the combination backtesting module for calculation based on the long connection to obtain the daily position result and the daily return result, the following step further comprises: Feedback the calculation progress in real time through the long connection, and write the daily position results and the daily income results into the cache; After the daily position result and the daily income result are calculated, a calculation completion message is sent to the client through the long connection.
8. The method according to claim 7, characterized in that The step of generating a deep backtest report based on the daily position result, the daily return result and the deep backtest report generation instruction comprises: Generate a portfolio overview report based on the calculation completion message and the daily return result; A deep backtesting report is generated according to the deep backtesting report generation instruction, the portfolio overview report, and the daily position results.
9. A combined strategy backtesting device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the combination strategy backtesting method according to any one of claims 1 to 8.
10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the combination strategy backtesting method according to any one of claims 1 to 8 are implemented.
11. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the combined strategy backtesting method according to any one of claims 1 to 8 are implemented.