Multi-agent-based strategy generation method and device, equipment and storage medium

Through the strategy generation method of multi-agent collaborative work, the problem of insufficient flexibility and intelligence in the generation of strategies of intelligent models is solved, and more flexible and intelligent strategy generation is achieved, improving the effectiveness of the strategy and user satisfaction.

CN119648002APending Publication Date: 2025-03-18CHINA MERCHANTS BANK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411740605.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

The current intelligent model lacks flexibility and intelligence when generating strategies, making it difficult to adapt to complex and changing market environments or specific task needs.

Method used

The initial user needs are obtained through process management agent interaction with the user, the operator is constructed using the operator agent, and the executable policy is constructed through the policy agent combined with the pre-constructed policy library and operator. This method realizes the automated generation and optimization of strategies through the collaborative work of multiple agents.

Benefits of technology

It improves the flexibility and intelligence of strategy generation, can dynamically adjust and optimize strategies according to users' initial needs, generate trading strategies that are more personalized and adaptable to market changes, and improves the effectiveness of the strategy and user satisfaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119648002A_ABST
    Figure CN119648002A_ABST
Patent Text Reader

Abstract

The invention discloses a strategy generation method and device based on multiple agents, equipment and a storage medium. The method comprises the steps that an initial user demand is obtained through interaction between a process management agent and a user; according to the initial user demand, constructing an operator by using a pre-constructed factor library through an operator agent; and according to the initial user demand, constructing an executable strategy by combining a strategy intelligent agent with a pre-constructed strategy library and the operator. Feedback information of the user on the executable strategy is obtained, and iterative optimization is carried out on the executable strategy based on the satisfaction condition of the user. According to the method, calling of all steps is coordinated, so that a user can carry out personalized adjustment on the strategy generation process through multiple rounds of interaction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a multi-agent based strategy generation method, device, equipment and storage medium. Background Art

[0002] In the current application field of intelligent models, automatic strategy generation technology is mainly divided into two categories: algorithm logic driven and large model agent driven. Algorithm logic strategy generation mainly relies on heuristic algorithms. This method builds strategies through a preset set of operators and uses specific evaluation criteria to select the optimal strategy. Although this method with clear structure and fixed process performs well in some scenarios, its innovation is limited and it is difficult to adapt to complex and changing market environments or specific task requirements, reflecting the lack of flexibility.

[0003] The introduction of large-model agent strategy generation technology has improved the flexibility of strategy generation to a certain extent. This type of agent can capture and implement the user's strategy ideas, convert them into executable code and backtesting results, thereby simplifying the coding work. However, general large-model agents do not have the ability to create original strategies. They are more like "translators" that execute user instructions and have not achieved a real intelligent breakthrough in strategy generation.

[0004] For dedicated intelligent agents, although they can discover and construct factor expressions through multi-agent collaboration and perform backtesting verification, showing a certain degree of automated exploration capabilities, human intervention is still required in the process of strategy formation to integrate factors into strategies. Although this mode of interaction between humans and intelligent agents has improved the efficiency of strategy generation, it has not completely gotten rid of human dependence, and its intelligence still needs to be improved. Therefore, the lack of flexibility and intelligence of current intelligent models when generating strategies is still a problem that needs to be solved urgently. Summary of the invention

[0005] The main purpose of this application is to provide a multi-agent based strategy generation method, device, equipment and storage medium, aiming to solve the technical problem that the current intelligent model lacks flexibility and intelligence when generating strategies.

[0006] To achieve the above object, the present application provides a multi-agent based strategy generation method, the multi-agent based strategy generation method comprising the following steps:

[0007] Acquire initial user requirements through interaction between process management agents and users;

[0008] According to the initial user demand, constructing an operator by using a pre-built factor library through an operator agent;

[0009] According to the initial user demand, an executable strategy is constructed by combining a pre-built strategy library and the operator through a strategy agent.

[0010] In one embodiment, after the step of constructing an executable strategy according to the initial user demand by combining a pre-built strategy library and the operator through a strategy agent, the step further includes:

[0011] According to the initial user needs, backtesting the executable strategy through a backtesting agent to generate evaluation indicators;

[0012] The backtest results are summarized according to the evaluation indicators, and the strategy agent makes strategy adjustments based on the feedback backtest results.

[0013] In one embodiment, the step of backtesting the executable strategy to generate evaluation indicators through a backtesting agent according to the initial user demand includes:

[0014] Parsing the initial user requirements by a backtesting agent to obtain a backtesting configuration;

[0015] deploying the executable strategy and the backtest configuration into a backtest framework;

[0016] The backtesting framework is called to execute the backtesting process under the backtesting configuration and generate evaluation indicators.

[0017] In one embodiment, the step of constructing an operator using a pre-built factor library by an operator agent according to the initial user demand includes:

[0018] Parsing the initial user demand through an operator agent to extract demand keywords;

[0019] Screening out key factors matching the demand keywords from the factor library;

[0020] An operator constructor is used to construct an operator based on the factor logic of the key factor.

[0021] In one embodiment, the step of constructing an executable strategy based on the initial user demand by combining a pre-built strategy library and the operator through a strategy agent includes:

[0022] Matching a policy template from a pre-built policy library according to the initial user demand;

[0023] The operator is logically integrated with the policy template to generate an executable policy.

[0024] In one embodiment, after constructing an executable strategy based on the initial user demand by combining a pre-built strategy library and the operator through a strategy agent, the method further includes:

[0025] The executable strategy is iteratively optimized based on the demand feedback information input by the user.

[0026] In one embodiment, the step of iteratively optimizing the executable strategy based on the demand feedback information input by the user includes:

[0027] Obtain demand feedback information input by users through process management agents;

[0028] If the demand feedback information is identified as satisfactory information, the subsequent steps will not be executed;

[0029] If the demand feedback information is identified as unsatisfactory information, iterative execution is performed: strategy optimization is performed by factor optimization and / or logic reconstruction of the executable strategy until the demand feedback information is identified as satisfactory information.

[0030] In addition, to achieve the above-mentioned purpose, the present application also provides a multi-agent-based strategy generation device, the multi-agent-based strategy generation device comprising:

[0031] The acquisition module is used to acquire initial user requirements through the interaction between the process management agent and the user;

[0032] A first construction module is used to construct an operator using a pre-built factor library through an operator agent according to the initial user demand;

[0033] The second construction module is used to construct an executable strategy based on the initial user demand by combining a pre-built strategy library and the operator through a strategy agent.

[0034] In addition, to achieve the above-mentioned purpose, the present application also provides a terminal device, which includes a memory, a processor, and a multi-agent-based policy generation program stored in the memory and executable on the processor, and the multi-agent-based policy generation program, when executed by the processor, implements the steps of the multi-agent-based policy generation method as described above.

[0035] In addition, to achieve the above-mentioned purpose, the present application also provides a computer-readable storage medium, on which a multi-agent-based strategy generation program is stored. When the multi-agent-based strategy generation program is executed by a processor, the steps of the multi-agent-based strategy generation method as described above are implemented.

[0036] One or more technical solutions proposed in this application have at least the following technical effects:

[0037] This application obtains initial user needs through the interaction between the process management agent and the user, and then constructs operators using the pre-built factor library through the operator agent, and finally constructs executable strategies through the strategy agent in combination with the pre-built strategy library and operators. The technical effect of this application is that it can make more in-depth use of the historical knowledge base, and realize the automatic generation of strategies through the collaborative work of the operator agent and the strategy agent. The operator agent can convert factors of diverse nature and frequency into operator form, while the strategy agent can construct executable strategies based on user needs and templates in the strategy library, combined with the operators provided by the operator agent. This method not only improves the flexibility of strategy generation, but also can achieve strategy innovation to a certain extent, because it allows the strategy to be dynamically adjusted and optimized according to the initial needs of the user, rather than relying solely on a preset set of operators. In this way, more personalized and market-adaptive trading strategies can be generated, which improves the effectiveness of the strategy and user satisfaction. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 This is a flow chart of the first exemplary embodiment of the multi-agent-based strategy generation method of the present application;

[0039] Figure 2 This is a flow chart of a second exemplary embodiment of the multi-agent-based strategy generation method of the present application;

[0040] Figure 3 This is a schematic diagram of the module structure of a multi-agent-based strategy generation device according to an embodiment of the present application;

[0041] Figure 4 Schematic diagram of the device structure of the hardware operating environment involved in the multi-agent based strategy generation method in the embodiment of the present application.

[0042] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0043] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0044] The main technical solution of this application is: obtaining initial user needs through interaction between the process management agent and the user; constructing operators through the operator agent using a pre-built factor library based on the initial user needs; and constructing executable strategies through the strategy agent combining the pre-built strategy library and the operator based on the initial user needs.

[0045] This application actually considers that the strategy generation technology based on algorithmic logic constructs strategies through a preset set of operators and uses specific evaluation criteria to screen out the optimal strategy. This method is difficult to adapt to complex and changing market environments or specific task requirements and lacks flexibility. In addition, non-large model technology lacks interactivity in strategy generation and usually relies on preset algorithmic logic, and cannot flexibly adjust or optimize strategies through dynamic dialogue. By introducing large model intelligent agent strategy generation technology, it can capture and implement the user's strategy conception, and through multi-agent collaborative discovery and construction of factor expressions, backtesting verification is performed, showing a certain degree of automated exploration capabilities. However, in the process of strategy formation, these factors still need to be manually integrated into strategies, and intelligence still needs to be improved.

[0046] In addition, the inability to utilize mature factors in depth and in batches is also a common technical defect. Specifically, when building strategies, the intelligent system is unable to utilize existing factors in depth or in batches due to token restrictions, resulting in its inability to fully utilize the historical knowledge base. Even if factors are transmitted through multiple rounds of dialogue, the memory processing limitations of the intelligent agent may lead to insufficient and biased application of factors.

[0047] Based on this, the embodiment of the present application proposes a solution: obtain the initial user needs through the process management agent interacting with the user; construct the operator through the operator agent using the pre-built factor library according to the initial user needs; construct the executable strategy through the strategy agent combining the pre-built strategy library and the operator according to the initial user needs. Obtain user feedback on the executable strategy, and iteratively optimize the executable strategy based on user satisfaction. By coordinating the calls of each step, the user can personalize the strategy generation process through multiple rounds of interaction.

[0048] Specifically, the following are the detailed steps of the first exemplary embodiment of the multi-agent-based strategy generation method of this application:

[0049] Reference Figure 1 , Figure 1 This is a flowchart of the first exemplary embodiment of the multi-agent-based strategy generation method of the present application. In this embodiment, the multi-agent-based strategy generation method includes steps S10 to S30:

[0050] Step S10, obtaining initial user needs through the process management agent interacting with the user;

[0051] The initial user requirements are obtained through direct interaction between the process management agent and the user. The process management agent can understand the user's natural language input and extract key requirement information from it.

[0052] Specifically, first, the user communicates with the process management agent through a user interface, which may be a chat window, a command line interface, or a graphical user interface (GUI), where the user can input their requirements.

[0053] For example, a user may enter: "I need a trading strategy that increases holdings in technology stocks when the market is rising, and reduces holdings when the market is falling." After receiving the user's input, the process management agent uses its natural language processing (NLP) capabilities to parse the user's instructions. This includes identifying keywords such as "trading strategy," "market rising," "increase holdings," and "market falling," as well as understanding the intent behind the user's needs, that is, creating a trading strategy that can automatically adjust positions based on market conditions.

[0054] Next, the process management agent can further inquire the user to refine the requirements. This may include asking the user questions about risk preferences, investment time horizons, specific markets or asset classes, etc. For example, the process management agent may ask: "Under what market conditions do you want this strategy to trigger a buy or sell signal? What is your risk tolerance for the strategy?" The user's answers to these questions will be recorded and analyzed by the process management agent to form more specific strategy requirements. This information will serve as input for subsequent steps, namely the scheduling of operator agents and strategy agents and the basis for strategy generation.

[0055] Finally, the process management agent further confirms that it understands the user's needs and provides a summary of the needs to ensure that all information is understood correctly. For example, the process management agent can output: "According to your needs, we will create a strategy that will increase the holdings of technology stocks when the market index exceeds its 50-day moving average and reduce the holdings when the index is below the moving average. This strategy will take into account your medium risk preference and will be tested over the next six months. Please confirm whether this meets your expectations."

[0056] Through this process, the process management agent ensures that the user's initial needs are accurately captured and provides a solid foundation for subsequent strategy generation and adjustment. This process not only improves the personalization of strategy generation, but also enhances user participation and satisfaction.

[0057] Step S20, constructing an operator using a pre-built factor library through an operator agent according to the initial user demand;

[0058] In a feasible implementation, step S20 may include steps S21 to S23:

[0059] Step S21, parsing the initial user demand through an operator agent to extract demand keywords;

[0060] It should be noted that the main task of the operator agent is to parse the initial user needs collected by the process management agent to extract the demand keywords. This process is based on the interaction results between the user and the process management agent. In step S10, the process management agent collects detailed information about the user's needs in the dialogue with the user, including the goals, conditions and preferences of the transaction strategy that the user hopes to achieve. After confirming the user's needs, the process management agent determines the next operation based on this information.

[0061] Specifically, the nature of the user's needs is evaluated by the process management agent. If the user's needs involve specific factors or data calculations, such as "I want to increase my holdings of technology stocks when the market rises", this indicates that the user needs to use specific market factors to build a strategy. In this case, the process management agent will decide to call the operator agent instead of the strategy agent. The strategy agent is mainly responsible for combining existing strategy templates with operators to generate executable strategies, while the operator agent focuses on extracting and building specific factor operations from the factor library. Therefore, the process management agent will dispatch the operator agent to parse the user's needs.

[0062] Step S22, selecting key factors matching the demand keywords from the factor library;

[0063] It should be noted that the factor library is a database containing a variety of verified factors, which can be technical indicators, fundamental data or other market data.

[0064] Specifically, the operator agent performs keyword matching based on the keywords mentioned in the user's needs, such as "momentum indicator", "price-earnings ratio", etc. Through this matching, the operator agent can identify factors related to the user's needs.

[0065] For example, if the user's demand keywords include "market volatility", the operator agent may select the volatility index (such as the VIX of the S&P 500) as the key factor from the factor library. If the user's demand is "automatically adjust positions", the operator agent may select factors related to market trends, such as moving averages or relative strength indexes (RSI).

[0066] The operator agent matches these factors with the user's needs to determine which factors are most suitable for building the strategy. This step ensures that the factors used in the strategy construction process are closely related to the user's actual needs, improving the relevance and effectiveness of the strategy.

[0067] Step S23: construct an operator based on the factor logic of the key factor using an operator constructor.

[0068] It should be noted that operators are computational components in strategy construction, which can be simple mathematical operations or complex logical judgments.

[0069] The operator constructor defines the calculation rules and parameters of the operator according to the logic of the factors and the needs of the user. Specifically, the operator agent will analyze the selected key factors and determine their calculation formulas and logical relationships. For example, for the "momentum indicator", the operator constructor may define an operator to calculate the percentage of price change in the past 30 days. If the key factor is a moving average, the operator constructor will create an operator to calculate the average stock price within a specific time window. If the key factor is RSI, the operator constructor will create an operator to calculate the relative strength index within a specific time window and set the threshold according to the user's strategy requirements. In this way, the operator agent is able to generate multiple operators, which will be used for subsequent strategy construction. By accurately constructing operators, the strategy agent is able to generate effective trading strategies that meet user needs.

[0070] Step S30, constructing an executable strategy based on the initial user demand through a strategy agent combined with a pre-built strategy library and the operator.

[0071] In a feasible implementation, step S30 may include steps S31 to S32:

[0072] Step S31, matching a policy template from a pre-built policy library according to the initial user demand;

[0073] Specifically, the strategy library is a collection of various strategy templates that are pre-defined based on historical data and market experience. Each template represents a specific trading strategy, such as "Double Moving Average Crossover Strategy" or "Bollinger Band Breakout Strategy". The strategy agent will analyze the user's initial needs, identify the core elements in the needs, such as trading goals, risk preferences, market conditions, etc., and match these elements with the templates in the strategy library.

[0074] For example, if the user's requirement is to "increase the holding of technology stocks when the market rises", the strategy agent may look for a template related to market trend tracking in the strategy library, such as "momentum tracking strategy". This template may contain a series of logic and rules for identifying market trends and adjusting positions accordingly. The strategy agent will evaluate whether this template meets the user's needs and adjust the settings of the template according to the user's specific parameters.

[0075] After selecting a template, the policy agent further analyzes the logic in the policy template to determine which operators are needed to implement the policy logic of the template.

[0076] Step S32: logically integrate the operator with the policy template to generate an executable policy.

[0077] Specifically, the strategy agent will use the operators generated by the operator constructor and embed them into the selected strategy template. This involves using the output of the operator as the input to the template's decision logic, ensuring that each part of the strategy can correctly receive and process the data. For example, if operator D calculates the momentum indicator of a stock, and operator E calculates the price-to-earnings ratio and compares it to the industry average, the output of these operators will be used as the basis for the decision points in the template.

[0078] At the same time, the strategy agent needs to ensure that the output of the operator is consistent with the logic in the template, and adjust all parameters and conditions according to the specific needs of the user. Once the integration is completed, the strategy agent will generate an executable strategy that not only contains the user's original needs, but also integrates the calculation logic of the operator and the decision framework of the strategy template. Finally, the strategy agent will output this executable strategy, which can be a piece of code, a trading model or a clear trading plan. Users can apply this strategy directly on the trading platform, or further backtest and optimize it. This process ensures that the generation of the strategy not only meets the user's personalized needs, but also utilizes historical knowledge and market logic, improving the effectiveness and practicality of the strategy.

[0079] For example, the user communicates with the process management agent through the interface of the trading platform and expresses his needs as follows: "I need a trading strategy that can buy technology stocks when the market index rises above its 20-day moving average, and sell them when the index falls below the moving average." The process management agent identifies that the user's needs involve specific factors or data calculations, and the scheduling operator agent identifies and extracts keywords in the user's needs, such as "market index", "20-day moving average", "buy technology stocks" and "sell".

[0080] Based on the extracted keywords, the operator agent selects relevant factors from the factor library, such as the price data corresponding to the "market index" and the historical price data required for the "20-day moving average" calculation. The operator constructor is used to construct two operators: operator D calculates the 20-day moving average, and operator E compares the relationship between the current market index and the 20-day moving average to generate buy and sell signals.

[0081] Next, the strategy agent matches a template based on the moving average crossover strategy in the strategy library according to user needs and operator output. The template contains the logic of market entry and exit. Furthermore, the strategy agent integrates the logic of operators D and E into the matching strategy template to generate a complete trading strategy. This strategy will buy technology stocks when the market index crosses the 20-day moving average, and sell when the index crosses the moving average.

[0082] Further, in the embodiment of the present application, after step S30: constructing an executable strategy through a strategy agent in combination with a pre-built strategy library and the operator according to the initial user demand, step S40 is also included:

[0083] Step S40: iteratively optimize the executable strategy based on the demand feedback information input by the user.

[0084] In a feasible implementation, step S40 may include steps S41 to S43:

[0085] Step S41, obtaining demand feedback information input by the user through the process management agent;

[0086] Step S42: if the demand feedback information is identified as satisfactory information, the subsequent steps are not executed;

[0087] Step S43, if the demand feedback information is identified as unsatisfactory information, iterative execution: strategy optimization is performed by factor optimization and / or logic reconstruction of the executable strategy until the demand feedback information is identified as satisfactory information.

[0088] It should be noted that the process management agent can continuously interact with the user to obtain user demand information. In step S41, the process management agent obtains feedback information after the initial demand information input by the user, that is, demand feedback information. After the user uses the initially generated executable strategy, they may provide feedback on the performance, risk level or other aspects of the strategy. As the interface between the user and the system, the process management agent is responsible for collecting this feedback information. This may include the user's intuitive feelings about the strategy, specific improvement suggestions or detailed evaluation of the strategy performance. The process management agent uses natural language processing technology to parse the user's feedback and extract key information, such as the user's satisfaction with the strategy and the specific aspects that they hope to improve. This information will serve as the basis for subsequent strategy optimization. For example, the user may say: "I hope to increase my position when the market rises, but the current strategy also frequently buys when the market fluctuates slightly, which makes me feel uneasy." Such feedback information provides an important basis for subsequent strategy optimization.

[0089] Specifically, the process management agent analyzes user feedback through natural language processing technology to extract key information and specific needs. It identifies whether the user is satisfied with the executable strategy. If not, it analyzes the specific dissatisfaction, such as the frequency of buy signals, adjustments to the position, or reactions to market conditions. Through this process, it is not only possible to understand the user's intuitive feedback, but also to convert it into actionable adjustment suggestions. The acquisition of this information is the first step in strategy optimization, ensuring that subsequent adjustments can accurately reflect the user's expectations and needs.

[0090] If the user's feedback indicates that they are satisfied with the current strategy performance, the process management agent records the user's satisfaction and ends the iterative optimization process. This means that the strategy has met the user's needs and no further adjustments are needed. In this case, the process management agent can confirm their satisfaction to the user and may provide further monitoring or management options for the strategy to ensure the strategy's continued performance in real trading.

[0091] If the user's feedback indicates that they are dissatisfied with the strategy, the process management agent initiates the iterative optimization process. The process management agent decides whether to call the operator agent or the strategy agent to optimize the corresponding strategy. If the optimization process involves adjusting the operator, such as changing the time window for calculating momentum or adjusting the benchmark for the price-to-earnings ratio, the operator agent will be called first to adjust the operator through factor optimization. Factor optimization may involve adjusting the weights of market factors used in the strategy or introducing new factors. After the operator adjustment is completed, the strategy agent is called again to generate an updated strategy with the new operator. Or if the optimization process only involves modifying the strategy logic, then only the strategy agent needs to be called to optimize the strategy through logical reconstruction. Logic reconstruction may involve modifying the trading rules or decision logic of the strategy to better meet the user's investment goals and market conditions. After the optimization is completed, the strategy agent will generate a new executable strategy and feedback to the user so that they can evaluate whether the new strategy meets their needs. If the user is still dissatisfied, the process management agent collects feedback again and repeats the iterative optimization process until the user is satisfied with the strategy.

[0092] This series of operations ensures that the strategy can respond to user feedback in real time and optimize its performance, thereby improving user satisfaction and the effectiveness of the strategy. Through this dynamic adjustment mechanism, the work between various agents can be effectively coordinated to ensure the flexibility and intelligence of strategy generation and adjustment.

[0093] For further information, please refer to Figure 2 , Figure 2This is a flow chart of a second exemplary embodiment of the multi-agent-based strategy generation method of the present application. In this embodiment, step S30: according to the initial user demand, the step of constructing an executable strategy by combining the strategy agent with the pre-built strategy library and the operator also includes steps S51 to S52:

[0094] Step S51, based on the initial user demand, backtesting the executable strategy through a backtesting agent to generate evaluation indicators;

[0095] In a feasible implementation, step S51 may include steps S511 to S513:

[0096] S511, parsing the initial user requirements through a backtesting agent to obtain a backtesting configuration;

[0097] The backtesting agent parses the user's initial requirements to obtain the backtesting configuration. Specifically, after the executable strategy is generated by the strategy agent, the backtesting agent receives the initial user demand information related to the strategy. The backtesting agent first analyzes the user's needs and identifies key parameters related to the backtest, such as the time range of the backtest, initial funds, transaction costs, slippage, etc. These parameters are critical to the accuracy and effectiveness of the backtest. The user may specify the historical data range that they want to backtest, such as market performance in the past year, or specific market conditions that they want to test, such as a bull market or a bear market. The backtesting agent converts this information into a specific backtesting configuration to ensure that the subsequent backtesting process accurately reflects the user's expectations and market environment.

[0098] S512, deploying the executable strategy and the backtest configuration into a backtest framework;

[0099] It should be noted that the backtesting framework is specifically designed for simulated trading, can receive historical market data and strategy logic, and execute trading instructions under specified conditions.

[0100] Specifically, the backtesting agent combines the previously parsed backtest configuration with the executable strategy to form a complete backtesting instance. This process includes converting the strategy logic into code that can be executed in the backtesting framework, and applying the user-specified backtesting parameters to the framework. And it is necessary to ensure that all inputs are verified to avoid inaccurate backtesting results due to configuration errors. In this way, the backtesting agent is fully prepared for subsequent backtesting execution, ensuring that all necessary information has been integrated into the backtesting framework.

[0101] S513, calling the backtesting framework to execute the backtesting process under the backtesting configuration and generate evaluation indicators.

[0102] Specifically, the backtesting framework will gradually reproduce historical market scenarios and simulate the trading decisions of the strategy at each point in time. This process includes generating instant trading instructions based on historical price data and strategy logic, and recording the execution of each transaction, including information such as transaction price, transaction volume and time. After the backtest is completed, the backtesting framework will automatically calculate a series of evaluation indicators, such as total return, maximum drawdown, Sharpe ratio, etc. These indicators can fully reflect the performance and risk characteristics of the strategy.

[0103] Step S52, summarizing the backtest results according to the evaluation indicators, and adjusting the strategy based on the feedback backtest results by the strategy agent.

[0104] Specifically, first, the backtesting agent will summarize the evaluation indicators generated after the backtest to form a detailed backtesting report. This report will contain key statistical data, such as the strategy's cumulative return, maximum drawdown, Sharpe ratio, win rate, etc., which can fully reflect the strategy's performance on historical data. The report will also include charts such as the strategy's capital curve, the profit and loss distribution of transactions, and the position cycle analysis, which intuitively display the strategy's profit and loss situation and risk characteristics.

[0105] Next, the backtest report is fed back to the strategy agent. The strategy agent analyzes the performance of the strategy based on the evaluation indicators and backtest results, and identifies the advantages and disadvantages of the strategy. For example, if the backtest results show that the strategy performs poorly under certain market conditions, or the maximum drawdown exceeds the user's risk tolerance, the strategy agent will need to adjust the strategy. This process may involve changing the parameters of the operator, adjusting the trading logic, or introducing new market factors.

[0106] Based on the specific feedback from the backtest results, the strategy agent calls the operator agent to reconfigure the operator, or directly selects different strategy templates from the strategy library for combination. For example, if it is found that the strategy performs well in a market with clear trends but is prone to losses in a volatile market, the strategy agent may add a filter condition to avoid trading in a volatile market. Alternatively, the strategy agent may adjust the position management strategy to reduce losses in adverse market conditions.

[0107] Finally, the adjusted strategy is generated and passed to the backtesting agent for a new round of backtesting to verify the effect of the adjustment. This process may be repeated many times until the performance of the strategy meets the user's expectations and the actual needs of the market. Through this iterative optimization method, the strategy agent can continuously improve the strategy, improve its adaptability and effectiveness, and ultimately generate a more robust and reliable trading strategy.

[0108] For example, if a user makes a requirement to the process management agent: "I need to test a trading strategy based on the moving average crossover strategy, specifically buy when the 50-day moving average crosses the 200-day moving average, and sell when it crosses below. I hope to backtest this strategy on data from 2010 to 2020, with an initial capital of 1 million, and not considering transaction costs." The backtesting agent parses this requirement and extracts key information, including strategy logic, backtesting time range, initial capital and transaction costs, to form a backtesting configuration.

[0109] Then, the backtesting agent deploys the strategy logic and parameters into the backtesting framework based on the extracted backtesting configuration. This framework receives historical market data from 2010 to 2020, including prices and volumes, as well as preset strategy instances. The backtesting framework sets the initial capital to 1 million and turns off transaction cost calculation.

[0110] Next, the backtesting framework was executed to simulate the trading process from 2010 to 2020. At each trading point, the strategy generates trading signals based on the crossover of the 50-day moving average and the 200-day moving average. The backtesting framework records the results of each transaction and calculates a series of evaluation indicators at the end of the backtest, including total return, maximum drawdown, Sharpe ratio, etc.

[0111] Furthermore, the backtesting agent aggregates the evaluation indicators to form a backtesting report. The report shows that although the strategy performs well in some years, the overall Sharpe ratio is low and the maximum drawdown exceeds the user's expectations. The strategy agent analyzes these results and believes that the strategy needs to be adjusted to reduce risk and improve risk-adjusted returns.

[0112] Based on the above analysis, the strategy agent decides to introduce a new operator, such as the momentum indicator, to filter trading signals and only buy or sell when the momentum indicator shows a strong market trend. The strategy agent adjusts the strategy logic and passes the new strategy to the backtesting agent for re-backtesting.

[0113] The new round of backtesting results showed that the adjusted strategy reduced the maximum drawdown while improving the Sharpe ratio, which was more in line with the user's risk preference. The strategy agent fed back this result to the user, who was satisfied with the adjusted strategy and decided to apply it in actual trading.

[0114] This example embodies the complete process from analyzing user needs to generating, backtesting, evaluating, and adjusting strategies, and demonstrates how to achieve automated generation and optimization of strategies through the collaboration of intelligent agents.

[0115] In addition, the present application also proposes a multi-agent-based strategy generation device, the multi-agent-based strategy generation device comprising:

[0116] An acquisition module 10 is used to acquire initial user requirements through interaction between a process management agent and a user;

[0117] A first construction module 20 is used to construct an operator using a pre-built factor library through an operator agent according to the initial user demand;

[0118] The second construction module 30 is used to construct an executable strategy according to the initial user demand by combining the pre-built strategy library and the operator through a strategy agent.

[0119] The multi-agent-based strategy generation device provided by the present application adopts the multi-agent-based strategy generation method in the above-mentioned embodiment, aiming to solve the technical problem that the current intelligent model lacks flexibility and intelligence when generating strategies. Compared with the prior art, the beneficial effects of the multi-agent-based strategy generation device provided by the present application are the same as the beneficial effects of the multi-agent-based strategy generation method provided by the above-mentioned embodiment, and the other technical features in the multi-agent-based strategy generation device are the same as the features disclosed in the above-mentioned embodiment method, which will not be repeated here.

[0120] The present application provides a multi-agent based policy generation 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 multi-agent based policy generation method in the above-mentioned embodiment one.

[0121] The multi-agent based strategy generation device in the embodiments 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., as well as fixed terminals such as digital TVs, desktop computers, etc. Figure 4 The multi-agent-based strategy generation 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.

[0122] like Figure 4As shown, the multi-agent-based strategy generation device may include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, 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 multi-agent-based strategy generation device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems may be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1003 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1009. The communication device 1009 may allow the multi-agent-based policy generation device to communicate wirelessly or wired with other devices to exchange data. Although the figure shows a multi-agent-based policy generation device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or have instead.

[0123] 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.

[0124] The multi-agent-based strategy generation device provided by the present application adopts the multi-agent-based strategy generation method in the above-mentioned embodiment, aiming to solve the technical problem that the current intelligent model lacks flexibility and intelligence when generating strategies. Compared with the prior art, the beneficial effects of the multi-agent-based strategy generation device provided by the present application are the same as the beneficial effects of the multi-agent-based strategy generation method provided by the above-mentioned embodiment, and the other technical features in the multi-agent-based strategy generation device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0125] 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.

[0126] 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.

[0127] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, wherein the computer-readable program instructions are used to execute the multi-agent-based strategy generation method in the above-mentioned embodiment.

[0128] 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 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: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), 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 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: Radio Frequency), etc., or any suitable combination of the above.

[0129] The above-mentioned computer-readable storage medium may be included in the multi-agent-based policy generation device; or it may exist independently without being assembled into the multi-agent-based policy generation device.

[0130] 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).

[0131] 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 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 box can also occur in a sequence different from that marked in the accompanying drawings. For example, two 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 box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0132] The modules involved in the embodiments described in the present 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.

[0133] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned multi-agent-based strategy generation method, aiming to solve the technical problem that the current intelligent model is insufficient in flexibility and intelligence when generating strategies. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the multi-agent-based strategy generation method provided by the above-mentioned embodiment, and will not be repeated here.

[0134] The present application also provides a computer program product, including a computer program, which implements the steps of the multi-agent-based strategy generation method as described above when executed by a processor.

[0135] The computer program product provided by this application is intended to solve the technical problem that the current intelligent model lacks flexibility and intelligence when generating strategies. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the multi-agent-based strategy generation method provided by the above embodiment, which will not be repeated here.

[0136] Compared with the prior art, the multi-agent-based strategy generation method, device, equipment, medium and computer product proposed in the embodiment of the present application extracts the business feature information of the target business, performs data standardization processing on the business feature information, obtains standard feature data, performs hash processing on the standard feature data, obtains unique feature data, performs numerical processing and splicing processing on the unique feature data, obtains the first business feature value, accumulates the first business feature value of the target business, obtains the target business feature value, and finally compares the target business feature value with the feature value set to obtain the strategy generation result based on the multi-agent. Compared with the traditional method of identifying repeated business by generating a unique key value or a continuous serial number for each business, it is more efficient, flexible and reliable. Based on the solution of the present application, the business of complex scenes is finally converted into a comparison of two numbers through a series of simple transformations, so that the comparison process is very intuitive and efficient. The system only needs to simply compare whether the two values ​​are equal to quickly determine whether the two businesses are exactly the same.

[0137] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.

[0138] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0139] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as above, and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, a controlled terminal, or a network device, etc.) to execute the method of each embodiment of the present application.

[0140] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A multi-agent based strategy generation method, characterized in that: The multi-agent-based strategy generation method comprises: Acquire initial user requirements through interaction between process management agents and users; According to the initial user demand, constructing an operator by using a pre-built factor library through an operator agent; According to the initial user demand, an executable strategy is constructed by combining a pre-built strategy library and the operator through a strategy agent.

2. The multi-agent based strategy generation method according to claim 1, characterized in that: After the step of constructing an executable strategy by combining a pre-built strategy library and the operator through a strategy agent according to the initial user demand, the method further includes: According to the initial user needs, backtesting the executable strategy through a backtesting agent to generate evaluation indicators; The backtest results are summarized according to the evaluation indicators, and the strategy agent makes strategy adjustments based on the feedback backtest results.

3. The multi-agent based strategy generation method according to claim 2, characterized in that: The step of backtesting the executable strategy to generate evaluation indicators through a backtesting agent according to the initial user demand includes: Parsing the initial user requirements by a backtesting agent to obtain a backtesting configuration; deploying the executable strategy and the backtest configuration into a backtest framework; The backtesting framework is called to execute the backtesting process under the backtesting configuration and generate evaluation indicators.

4. The multi-agent based strategy generation method according to claim 1, characterized in that: The step of constructing an operator using a pre-built factor library by an operator agent according to the initial user demand comprises: Parsing the initial user demand through an operator agent to extract demand keywords; Screening out key factors matching the demand keywords from the factor library; An operator constructor is used to construct an operator based on the factor logic of the key factor.

5. The multi-agent based strategy generation method according to claim 1, characterized in that: The step of constructing an executable strategy by combining a pre-built strategy library and the operator through a strategy agent according to the initial user demand includes: Matching a policy template from a pre-built policy library according to the initial user demand; The operator is logically integrated with the policy template to generate an executable policy.

6. The multi-agent based strategy generation method according to claim 1, characterized in that: After constructing an executable strategy by combining a pre-built strategy library and the operator according to the initial user demand, the method further includes: The executable strategy is iteratively optimized based on the demand feedback information input by the user.

7. The multi-agent based strategy generation method according to claim 6, characterized in that: The step of iteratively optimizing the executable strategy based on the demand feedback information input by the user comprises: Obtain demand feedback information input by users through process management agents; If the demand feedback information is identified as satisfactory information, the subsequent steps will not be executed; If the demand feedback information is identified as unsatisfactory information, iterative execution is performed: strategy optimization is performed by factor optimization and / or logic reconstruction of the executable strategy until the demand feedback information is identified as satisfactory information.

8. A multi-agent-based strategy generation device, characterized in that: The device comprises: The acquisition module is used to acquire initial user requirements through the interaction between the process management agent and the user; A first construction module is used to construct an operator using a pre-built factor library through an operator agent according to the initial user demand; The second construction module is used to construct an executable strategy based on the initial user demand by combining a pre-built strategy library and the operator through a strategy agent.

9. A multi-agent-based strategy generation 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 multi-agent-based strategy generation method according to any one of claims 1 to 7.

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 multi-agent-based strategy generation method as described in any one of claims 1 to 7 are implemented.