Quantitative trading strategy creation method and apparatus, device, and medium

Automatically adjust and generate the code of quantitative trading strategies through graphical interface methods, solving the problems of high programming skills and difficult creation in traditional methods, and achieving a simplified strategy creation process and improved investment enthusiasm.

WO2025035638A1PCT designated stage expired Publication Date: 2025-02-20FUTU NETWORK TECH (SHENZHEN) CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/133349
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-08-11
Filing Date
2023-11-22
Publication Date
2025-02-20

AI Technical Summary

Technical Problem

The creation method of traditional quantitative trading strategies requires users to write a large amount of program code, resulting in high programming skills requirements, increasing the difficulty of creation, and affecting users' investment enthusiasm.

Method used

Provides a graphical interface method to automatically adjust and generate the code of the quantitative trading strategy by responding to the user's control selection and code editing operations in the graphical interface, and convert it into self-encoded controls, thereby creating a quantitative trading strategy.

Benefits of technology

It simplifies the creation process of quantitative trading strategies, reduces the difficulty of creation, improves users' investment enthusiasm, and reduces the requirements for programming skills.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023133349_20022025_PF_FP_ABST
    Figure CN2023133349_20022025_PF_FP_ABST
Patent Text Reader

Abstract

The present application provides a quantitative trading strategy creation method and apparatus, a device, and a medium. The method comprises: in response to a control selection operation triggered on a graphical interface, determining a target quantization strategy control selected by a user, wherein the graphical interface is used for creating a quantitative trading strategy; in a code area corresponding to the target quantization strategy control, displaying the original code information of the target quantization strategy control; in response to a code editing operation for the original code information, adjusting the original code information into target code information, and on the basis of the target code information, converting the target quantization strategy control into an auto-encoding control; and creating a quantitative trading strategy on the basis of the auto-encoding control. The present application can simplify the creation method of the quantitative trading strategy, and reduce the creation difficulty of the quantitative trading strategy, thereby improving the investment enthusiasm of the user, and meeting various investment requirements of the user.
Need to check novelty before this filing date? Find Prior Art

Description

Methods, devices, equipment, and media for creating quantitative trading strategies

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims priority to Chinese patent application number 202311017124.6, filed on August 11, 2023, entitled “Method, device, equipment and medium for creating quantitative trading strategies”, the entire contents of which are incorporated herein by reference. Technical Field

[0003] The embodiments of the present application relate to the field of software technology, and in particular to a method, apparatus, device, and medium for creating a quantitative trading strategy. Background Art

[0004] Quantitative trading strategies rely on mathematical and statistical methods and utilize computers to invest in financial products. Because they can reduce subjective influences such as investor sentiment that can lead to irrational investment decisions, a growing number of investors are adopting them for financial product trading.

[0005] Traditionally, quantitative trading strategies are created by writing code in programming languages ​​like Python. However, this approach can require writing hundreds or even thousands of lines of code, requiring a high level of programming skills. This makes it difficult to implement quantitative trading strategies through code, which can affect user investment enthusiasm.

[0006] Summary of the Invention

[0007] The embodiments of the present application provide a method, apparatus, device, and medium for creating a quantitative trading strategy, which can simplify the creation method of a quantitative trading strategy and reduce the difficulty of creating a quantitative trading strategy, thereby increasing the user's investment enthusiasm and meeting the user's various investment needs.

[0008] In a first aspect, an embodiment of the present application provides a method for creating a quantitative trading strategy, comprising:

[0009] In response to a control selection operation triggered on a graphical interface, determining a target quantitative strategy control selected by a user, wherein the graphical interface is used to create a quantitative trading strategy;

[0010] In the code area corresponding to the target quantization strategy control, the original code information of the target quantization strategy control is displayed;

[0011] In response to a code editing operation on the original code information, adjusting the original code information into target code information, and converting the target quantization strategy control into a self-encoding control based on the target code information;

[0012] Create a quantitative trading strategy based on the self-encoding control.

[0013] In a second aspect, an embodiment of the present application provides a device for creating a quantitative trading strategy, comprising:

[0014] a control determination module for determining a target quantitative strategy control selected by a user in response to a control selection operation triggered on a graphical interface for creating a quantitative trading strategy;

[0015] A code display module, configured to display original code information of the target quantization strategy control in a code area corresponding to the target quantization strategy control;

[0016] a code editing module, configured to adjust the original code information into target code information in response to a code editing operation on the original code information, and convert the target quantization strategy control into a self-encoding control based on the target code information;

[0017] A strategy creation module is used to create a quantitative trading strategy based on the self-encoding control.

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

[0019] A processor and a memory, the memory being used to store a computer program, and the processor being used to call and run the computer program stored in the memory to execute the method for creating a quantitative trading strategy as described in the embodiment of the first aspect.

[0020] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium for storing a computer program, wherein the computer program enables a computer to execute the method for creating a quantitative trading strategy as described in the embodiment of the first aspect.

[0021] The technical solutions disclosed in the embodiments of this application have at least the following beneficial effects:

[0022] By responding to a control selection operation triggered in a graphical interface, determining the target quantitative strategy control selected by the user, displaying the original code information of the target quantitative strategy control in the code area corresponding to the target quantitative strategy control, and responding to a code editing operation of the original code information, adjusting the original code information to the target code information, and converting the target quantitative strategy control into a self-encoding control based on the target code information, and then creating a quantitative trading strategy based on the self-encoding control. This application provides a graphical interface that supports users in creating graphical quantitative trading strategies, allowing users to simply and quickly create quantitative trading strategies in the graphical interface, and by setting up editable code quantitative strategy controls in the graphical interface, allowing users to edit the code information corresponding to at least one editable code quantitative strategy control during the process of creating a quantitative trading strategy, thereby modifying or expanding the executable operations of the editable code quantitative strategy control based on the corresponding operations to generate a self-encoding control, and then creating the quantitative trading strategy required by the user based on the self-encoding control. This application has low requirements for the user's programming skills and professionalism, can simplify the creation method of quantitative trading strategies, and reduce the difficulty of creating quantitative trading strategies. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0024] FIG1 is a flow chart of a method for creating a quantitative trading strategy provided in an embodiment of the present application;

[0025] FIG2 is a functional diagram of a target quantification strategy control association provided by an embodiment of the present application;

[0026] FIG3 is a schematic diagram of a code area display position provided in an embodiment of the present application;

[0027] FIG4 is a schematic diagram of a graphical interface provided in an embodiment of the present application;

[0028] FIG5 is a flow chart of another method for creating a quantitative trading strategy provided in an embodiment of the present application;

[0029] FIG6 is a schematic diagram of setting an editing control in a code area according to an embodiment of the present application;

[0030] FIG7 is a schematic diagram of a first pop-up window information provided in an embodiment of the present application;

[0031] FIG8A is a schematic diagram of a self-encoding control provided in an embodiment of the present application;

[0032] FIG8B is a schematic diagram of another self-encoding control provided in an embodiment of the present application;

[0033] FIG9 is a flow chart of another method for creating a quantitative trading strategy provided in an embodiment of the present application;

[0034] FIG10 is a schematic diagram of displaying an error in a detection area according to an embodiment of the present application;

[0035] FIG11 is a flow chart of another method for creating a quantitative trading strategy provided in an embodiment of the present application;

[0036] FIG12 is a schematic diagram of determining at least one execution path in a graphical quantitative trading strategy provided by an embodiment of the present application;

[0037] FIG13A is a schematic diagram of the packaging process of a self-encoding conditional control provided in an embodiment of the present application;

[0038] FIG13B is a schematic diagram of the packaging process of a self-encoding event control provided in an embodiment of the present application;

[0039] FIG13C is a schematic diagram of a process for encapsulating an execution path provided by an embodiment of the present application;

[0040] FIG14 is a schematic diagram of a second pop-up window information provided in an embodiment of the present application;

[0041] FIG15 is a schematic diagram of a quantitative trading strategy code provided in an embodiment of the present application;

[0042] FIG16 is a schematic block diagram of a device for creating a quantitative trading strategy provided in an embodiment of the present application;

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

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

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

[0046] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or solution described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or solutions. Specifically, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0047] When users use programming languages ​​to write code for quantitative trading strategies, creating a quantitative trading strategy requires writing hundreds or even thousands of lines of program code, which requires a high level of programming skills and professional expertise. This makes it difficult to create a quantitative trading strategy by writing code, which affects users' investment enthusiasm. To this end, this application provides a solution for creating a quantitative trading strategy, which can simplify the creation method of quantitative trading strategies and reduce the difficulty of creating quantitative trading strategies, thereby increasing users' investment enthusiasm and meeting their various investment needs.

[0048] The following is a detailed description of the method, device, equipment and medium for creating a quantitative trading strategy provided in an embodiment of the present application in conjunction with the accompanying drawings. Figure 1 is a flow chart of a method for creating a quantitative trading strategy provided in an embodiment of the present application. The method for creating a quantitative trading strategy provided in an embodiment of the present application can be executed by a device for creating a quantitative trading strategy. Among them, the device for creating a quantitative trading strategy can be composed of hardware and / or software and can be integrated into an electronic device. Optionally, the electronic device of the present application can be various terminal devices, such as smart phones (such as Android phones, IOS phones, Windows Phone phones, etc.), tablet computers, PDAs, laptops, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), etc. This application does not impose specific restrictions on the type of electronic device. Among them, the terminal device can also be called user equipment (UE), terminal or user device, etc., and no restrictions are imposed here.

[0049] As shown in FIG1 , the method may include the following steps:

[0050] S101 , in response to a control selection operation triggered on a graphical interface, determining a target quantitative strategy control selected by a user, wherein the graphical interface is used to create a quantitative trading strategy.

[0051] In this application, the graphical interface can be understood as an interface presented to the user by any application (Application, referred to as App) on an electronic device that supports the creation of graphical quantitative trading strategies. The user can trigger the application App to cause the application App to present the graphical interface to the user, so that the user can create a graphical quantitative trading strategy based on the graphical interface.

[0052] The graphical interface may include multiple controls, wherein the controls may include at least one of the following: a start control, a condition control, and an event control. It should be understood that the start control, condition control, and event control are all quantitative strategy controls.

[0053] The above-mentioned target quantization strategy control can be understood as a control that can support the user to perform code editing operations. The target quantization strategy control in this application includes: a target condition control, a target event control and / or a start control. Considering that the graphical interface includes a control bar and a strategy canvas, the target condition control in this application can be selected as any condition control in the control bar or the strategy canvas; correspondingly, the target event control can be selected as any event control in the control bar or the strategy canvas; correspondingly, the start control can be selected as the start control in the strategy canvas.

[0054] In this application, conditional controls are typically used to determine market information and account information. Event controls are typically used to execute operations such as placing orders, canceling orders, and liquidating positions. Start controls are used to indicate the starting point of a quantitative strategy.

[0055] It should be understood that the start control, condition control, and event control are all graphical controls and can support code viewing and code editing functions.

[0056] In some possible implementations, when it is necessary to create a quantitative trading strategy, the user can trigger an application APP that supports the quantitative trading strategy creation function to open the application APP, so that the application APP presents a graphical interface to the user, so that the user can create the personalized quantitative trading strategy required for investment based on the start control, condition control and event control in the graphical interface.

[0057] When creating a personalized quantitative trading strategy in the graphical interface, a user can first select a target quantitative strategy control (i.e., a target condition control and / or a target event control) from the control bar of the graphical interface based on the events and / or conditions required for creating the quantitative trading strategy. When the electronic device detects the user selecting a control in the control bar, it can identify the control corresponding to the control selection as the target quantitative strategy control. The target quantitative strategy control is then added to the strategy canvas in the graphical interface, allowing the user to create a personalized quantitative trading strategy based on the target quantitative strategy control in the strategy canvas.

[0058] The strategy canvas typically includes two display elements: connecting lines and boxes. Boxes represent user-selected controls. For example, if the control is a conditional control, the box is a conditional box; if the control is an event control, the box is an event box; and if the control is a start control, the box is a start box. In this application, the boxes corresponding to the various controls in the strategy canvas can be connected in series or in parallel using connecting lines to generate a graphical quantitative trading strategy.

[0059] In this application, adding a target quantitative strategy control to the strategy canvas in the graphical interface may include the following two situations:

[0060] Case 1

[0061] When the user clicks the target quantitative strategy control, the target quantitative strategy control is automatically added to the strategy canvas.

[0062] Case 2

[0063] The user selects the target quantitative strategy control and drags the target quantitative strategy control to the strategy canvas to add the target quantitative strategy control to the strategy canvas.

[0064] Among them, when the user needs to add two or more target quantification strategy controls to the strategy canvas, the specific implementation process is: only add one target quantification strategy control at a time. For example, when the user needs to add three quantification strategy controls to the strategy canvas, the user can first select the first condition control or the first event control in the control bar as the first target quantification strategy control, and add the first target quantification strategy control to the strategy canvas. Afterwards, the user can select the second condition control or the second event control in the control bar as the second target quantification strategy control, and add the second target quantification strategy control to the strategy canvas. Finally, the user can select the third condition control or the third event control in the control bar as the third target quantification strategy control, and add the third target quantification strategy control to the strategy canvas. The advantage of this setting is that it can avoid the phenomenon of incorrect or confused judgment in the selection and addition operations of multiple quantification strategy controls, thereby ensuring the orderliness of adding target quantification strategy controls in the strategy canvas.

[0065] It should be noted that the start control in this application is pre-set by default on the strategy canvas in the graphical interface. In other words, there is no start control in the control bar in the graphical interface. This can further simplify the creation of quantitative trading strategies.

[0066] Furthermore, in some possible implementations, after adding quantitative strategy controls such as conditional controls or event controls to a strategy canvas in a graphical interface, a user can select one of the quantitative strategy controls through the graphical interface, and the electronic device can also determine the target quantitative strategy control selected by the user in response to a control selection operation triggered on the strategy canvas.

[0067] In some optional implementations, a self-encoding control may also be provided in the control bar of the graphical interface of the present application. That is, in addition to the conditional control and event control, the control bar also includes a self-encoding control. The self-encoding control includes: a self-encoding conditional control and / or a self-encoding event control. It is understood that, unlike the conditional control, event control, and start control, the code information for the self-encoding control in the control bar is empty.

[0068] Furthermore, the present application determines the target quantitative strategy control selected by the user in response to the control selection operation triggered in the graphical interface, and specifically also includes: determining the target self-encoding control selected by the user in response to the self-encoding control selection operation triggered in the control bar.

[0069] That is to say, the present application can add two types of quantitative strategy controls in the control bar of the graphical interface, one type is a self-encoding condition control, and the other type is a self-encoding event control. The user can select any self-encoding condition control and / or self-encoding event control from the control bar as the target quantitative strategy control, and create a quantitative trading strategy based on the selected target quantitative strategy, thereby eliminating the need to generate a self-encoding condition control based on a condition control, and / or generate a self-encoding event control based on an event control, which can simplify the steps of creating a quantitative trading strategy.

[0070] S102: Displaying original code information of the target quantization strategy control in the code area corresponding to the target quantization strategy control.

[0071] Optionally, methods for displaying the original code information of the target quantitative strategy control may include but are not limited to the following methods:

[0072] In method 1, the user can hover the cursor over the target quantitative strategy control and right-click to open the code area corresponding to the target quantitative strategy control. Then, the original code information of the target quantitative strategy control is displayed in the code area.

[0073] In the second method, the user can also long press the target quantitative strategy control to open the code area corresponding to the target quantitative strategy control, so that the original code information of the target quantitative strategy control can be displayed in the code area.

[0074] In method three, the user can also select the target quantitative strategy control to display multiple associated functions in the form of pop-up windows or floating windows near the target quantitative strategy control, so that the user can select the view code function from the multiple functions to open the code area corresponding to the target quantitative strategy control and display the original code information of the target quantitative strategy control in the code area.

[0075] Among them, the multiple functions associated with the target quantitative strategy control may include but are not limited to: delete, copy, cut and view code, etc., as shown in Figure 2.

[0076] In this application, the code area corresponding to the target quantitative strategy control can be located below the strategy canvas, or in other blank areas in the graphical interface, etc., and there is no restriction on this. Among them, when the code area is located below the strategy canvas, the code area can be located in any blank area below the strategy canvas, for example, as shown in Figure 3.

[0077] In addition, in addition to supporting the expansion and collapse functions, the above-mentioned code area also supports dragging the height upward. Therefore, when there is too much code content in the code area and it cannot be displayed in full, the user can drag the code area height to expand the code area so that all code content can be displayed as much as possible, which is convenient for users to view or edit.

[0078] To prevent the code area from becoming too large after dragging, which would cause the policy canvas to be too small to display all the added controls, this application can pre-set the maximum drag range of the code area to ensure that the controls added to the policy canvas can be clearly and completely displayed while expanding the code area.

[0079] In some optional implementations, when a user views the code of a control in the policy canvas, they may select multiple controls simultaneously, or no controls may be selected, or the connection line between controls may be selected. To address these situations, this application optionally enters an empty state and displays an empty state prompt in the code area by default to remind the user to select any control in the policy canvas so that the corresponding code content of the control can be displayed in the code area.

[0080] For example, the above-mentioned prompt message of the empty state is displayed by default in the code area, which can be selected as "Select 1 control and its code will be displayed here".

[0081] It should be noted that the graphical interface in this application also includes a property bar, which is used to edit the properties of the controls added to the strategy canvas. Optionally, when a user selects any control in the strategy canvas, the property bar will display the editable parameter information corresponding to the control. For example, if a user selects the start control in the strategy canvas, the property bar will display the editable parameter information corresponding to the start control, including the following: strategy type, operation target, and global variables.

[0082] Therefore, the above-mentioned display of the original code information of the target quantization strategy control in the code area corresponding to the target quantization strategy control specifically includes: reading at least one attribute information of the target quantization strategy control; obtaining the interface function corresponding to each attribute information; generating the original code information of the target quantization strategy control according to the interface function and attribute value corresponding to each attribute information, and displaying the original code information of the target quantization strategy control in the code area corresponding to the target quantization strategy control.

[0083] The above-mentioned reading of at least one property information of the target quantization strategy control is specifically reading from a property column corresponding to the target quantization strategy control.

[0084] In some optional implementations, the original code information of the target quantization strategy control is displayed in the code area corresponding to the target quantization strategy control, which may include the following situations based on the control type:

[0085] The first case

[0086] When the control is a conditional control that supports code editing, the original code information of the conditional control includes but is not limited to: a definition function of the conditional box, etc.

[0087] The definition function of the conditional box is specifically the definition function of the conditional box corresponding to the conditional control, and the definition function of the conditional box can be called a conditional box function.

[0088] The conditional function includes a conditional function declaration and its implementation. The conditional function declaration defines the name of the conditional function. For example, when the box_id of the conditional function is 1, the name of the conditional function is condition_1. The conditional function implementation includes at least one of the following: a structure and a return value type. The structure is preferably an if-else structure, and the return value type is preferably a bool type.

[0089] Second case

[0090] When the control is an event control that supports code editing, the original code information of the event control includes but is not limited to: a definition function of the event box, etc.

[0091] The definition function of the event box is specifically the definition function of the event box corresponding to the event control, and the definition function of the event box can be called an event box function.

[0092] An event box function includes an event box function declaration and its implementation. The event box function declaration defines the name of the event box function. For example, when the event box's box_id is 1, the event box function is named action_1. The event box function implementation includes at least one of the following: interface call information.

[0093] The third case

[0094] When the control is a start control that supports code editing, the original code information of the start control includes but is not limited to: definition functions of global variables, definition functions of running targets, definition functions of custom indicator information, and functions used for initialization calls, etc.

[0095] Among them, for global variables, the definition function of the global variable includes: the agreed function declaration of the global variable and the initialization content of the global variable, and the initialization content includes at least one of the following: a numerical variable, a scalar variable and the return value of the interface call related to the auto-encoding.

[0096] For a running target, the definition function of the running target includes: a declaration of a contract function of the running target and initialization content of the running target.

[0097] For custom indicator information, the definition function of the custom indicator information includes: a custom indicator information convention function declaration and custom indicator initialization content. The initialization content includes at least one of the following: a custom indicator initialization convention function. The custom indicator initialization convention function includes at least: the name of the custom indicator, the corresponding Mai language script content of the custom indicator, and a list of parameters required for Mai language script execution.

[0098] The function used for initialization call includes: a declaration of a contracted initialization function and the specific initialization content executed by the contracted initialization function. The contracted initialization function can be understood as a contracted function that is fixedly generated when the code creation process creates the complete executable code, without user intervention.

[0099] As an optional exemplary description, assuming that the control selected by the user is the start control, the original code information displayed in the code area corresponding to the start control is as follows: the initialization convention function declaration, the declaration content of the first convention function in the initialization convention function declaration and the initialization content executed by the first convention function, as well as the declaration content of the second convention function in the initialization convention function declaration and the initialization content executed by the second convention function. Among them, the first convention function can be selected as trigger_symbols, the second convention function can be selected as custom_indicator, and the third convention function can be selected as global_variables.

[0100] Taking into account that the target quantitative strategy control may be a newly added self-encoding conditional control and / or self-encoding event control in the control bar, the original code information displayed in the code area corresponding to the above-mentioned self-encoding conditional control or self-encoding event control in this application is usually empty, and only the preset code prompt information is displayed, so that the user can perform code editing operations on the self-encoding conditional control or self-encoding event control based on the preset code prompt information, so as to generate self-encoding conditional controls and / or self-encoding event controls that meet personalized operation requirements.

[0101] S103 , in response to the code editing operation on the original code information, adjusting the original code information into target code information, and converting the target quantization strategy control into a self-encoding control based on the target code information.

[0102] S104, create a quantitative trading strategy based on the self-encoding control.

[0103] After the original code information is displayed in the code area corresponding to the target quantitative strategy control, the user can perform code editing operations based on the original code information of the target quantitative strategy control. For example, the user can modify the code parameters in the code area, delete all the original code information and rewrite the new code, or add code to implement new functions based on the original code information. In this way, the code editing operation in the code area is realized, and the original code information is adjusted to the target code information based on the user's editing operation. Then, based on the target code information, the target quantitative strategy control in the strategy canvas is converted into a self-encoding control.

[0104] Furthermore, in some implementable embodiments, in response to a code editing operation on the original code information, the original code information is adjusted to the target code information, which may specifically include: obtaining the first code information entered by the user at the target position in the code area; obtaining a recommended function statement from a general function library based on the first code information and the original code information; displaying the recommended function statement in the code area, and in response to a triggering operation on the recommended function statement, inputting the recommended function statement as new code information into the target position.

[0105] Among them, the general function library includes commonly used function statements for constructing quantitative strategies. The electronic device can obtain the first code information input by the user at the target location in real time, and then, the electronic device can perform code matching in the general function library based on the first code information input by the user and the original code information already in the code area to achieve the recommendation of function statements; specifically, the function fields constituting the function statements can be extracted from the original code information, and the associated candidate function statements can be matched from the general function library through the association rule model according to each function field in the original code information. Among them, the association rule model can be pre-collected from the code information of the historical self-encoding control, and the co-occurrence probability between each function statement in the corresponding code information of each historical self-encoding control can be mined, and then obtained based on the co-occurrence probability between different function statements; after obtaining each function field in the original code information, the function field can be input into the association rule model, and the function statement with a co-occurrence probability greater than a preset probability threshold between the function field can be obtained from the general function library through the association rule model as a candidate function statement. Furthermore, the candidate function statements can be sorted according to the first code information input by the user, and the sorted candidate function statements can be pushed as recommended function bodies and displayed in the code area; specifically, the first code information can be matched with each candidate function statement in a field, and each candidate function statement can be sorted according to the matching value of the field matching. For example, the matching value between the first code information and each candidate function statement can be obtained by the following formula:

[0106] Among them, codeA represents the first code information, codeB represents the candidate function statement; |codeA∩codeB| represents the intersection size of each letter between the first code information and the candidate function statement, |codeA∪codeB| represents the union size of each letter between the first code information and the candidate function statement; J(codeA, codeB) represents the matching value between the first code information and the candidate function statement.

[0107] After completing code editing, you can connect the generated self-encoding control to the start control using a connection line to create a graphical quantitative trading strategy. Then, compile the graphical quantitative trading strategy and obtain the quantitative trading strategy code to complete the creation of the quantitative trading strategy.

[0108] In some possible implementations, during the above-mentioned code editing operation on the original code of the target quantitative strategy control, the property bar in the graphical interface will be simultaneously reversed based on the above-mentioned code modification operation, so that the code editing operation for the target quantitative strategy control can be intuitively displayed through the property bar, thereby facilitating users to view the specific parameter information of the target quantitative strategy control after the code is edited.

[0109] At the same time, during the code editing process of the target quantization strategy control, this application will also add identification information representing the editing operation to the target quantization strategy control, so that users can intuitively and clearly distinguish which target quantization strategy control in the strategy canvas is currently editing the code. Exemplary information representing the editing operation added to the target quantization strategy control can be selected as text information such as "Editing..." and / or "**" symbol information, etc., and no limitation is imposed herein.

[0110] To facilitate understanding of this application, the following describes in detail the process of creating a graphical quantitative trading strategy in an embodiment of this application, in conjunction with Figure 4. For example, as shown in Figure 4, the graphical interface of this application may include: a navigation bar 210, a control bar 220, a strategy canvas 230, and a property bar 240.

[0111] The navigation bar 210 is used to display strategy management information, including established quantitative trading strategies, such as New Strategy 1 and New Strategy 2, as well as currently running quantitative trading strategies. Furthermore, the navigation bar 210 may also display an indicator icon for creating a new quantitative trading strategy, such as a "+" icon, so that users can trigger this icon to create a new quantitative trading strategy.

[0112] The control bar 220 is used to display multiple quantitative strategy controls, such as conditional controls with editable code and event controls with editable code. It should be understood that the above-mentioned conditional controls can be a set of logical judgments, such as if / else logical judgments. Users can select different judgment conditions based on quantitative trading strategies. For example, the conditional control can determine whether the selected account holds a position, or the conditional control can determine whether the exponential moving average indicator (Moving Average Convergence and Divergence, MACD) of the running target 1 meets the golden cross, etc. The above-mentioned event control can be an execution function (operation function). For example, place a market order to buy 600 lots, or perform a case withdrawal operation, etc.

[0113] Optionally, the aforementioned conditional controls include at least one of a signal conditional control, an account conditional control, and other conditional controls. Signal conditional controls are objective market-related data. Account conditional controls are personalized controls related to personal trading accounts. Other conditional controls may include at least one of the following: a combination condition and a global variable condition. A combination condition can be a single condition formed by combining multiple conditions using logical relationships such as "and," "or," and (), and each combination condition corresponds to a combination condition control. Global variable conditions can be used to set global variables based on the user's personalized needs and used in judgment conditions.

[0114] The aforementioned signal condition controls can be categorized into the following categories based on commonly used trading criteria: volume and price, fundamentals, capital, finance, and technology. The volume and price category includes, but is not limited to, the latest price, order price, K-line high, K-line low, K-line closing price, and K-line opening price. The fundamentals category includes, but is not limited to, conditions such as all trading sessions, current time, number of shares per lot, contract multiplier, and whether trading is suspended. The capital category includes, but is not limited to, conditions such as whether margin trading is allowed and whether short selling is allowed. The finance category includes, but is not limited to, conditions such as total market capitalization, total share capital, earnings per share, and net assets per share. The technical category is mainly used to store various indicator controls, including but not limited to: Moving average (MA), Moving Average Convergence and Divergence (MACD), Relative Strength Index (RSI), Bollinger Bands (BOLL), Stochastic indicator (KDJ indicator), Average true range (ATR), and other indicators.

[0115] The aforementioned account condition controls can be divided into the following categories based on the user's frequently used accounts: assets, purchasing power, maximum buy / sell, positions, and risk level. Assets can include conditions such as net asset value, cash, and unrealized profit / loss. Purchasing power can include conditions such as maximum buying power, short selling buying power, and cash buying power. Maximum buy / sell can include conditions such as cash buy, maximum buy, and position sell. Positions can include conditions such as holding quantity, position market value, profit / loss ratio, profit / loss amount, and sell quantity. Risk level can include conditions such as risk status and initial margin.

[0116] In some optional implementations, the control bar 220 may further display a self-encoding condition control and a self-encoding event control. For example, the self-encoding condition control may be placed under other condition controls under the condition control. For example, the self-encoding event control may be placed under other event controls under the event control.

[0117] It is worth noting that when the graphical interface with the self-encoding conditional control and the self-encoding event control is used for the first time, prompt information will be added to the control bar 220. For example, in the initial state, a red dot will be displayed on the self-encoding conditional control and the self-encoding event control, and other upper-level buttons will also display red dots, that is, red dots will be displayed in three places: "Conditional Control", "Event Control" and "Others". Furthermore, when the user operates the self-encoding conditional control, such as clicking or dragging, the red dot will be displayed together with the red dot of the upper level. When the user operates the self-encoding event control, such as clicking or dragging, the red dot will be displayed together with the red dot of the upper level.

[0118] Considering that there are a large number of controls of each type in the control bar 220, this application may optionally list some commonly used controls in the control bar 220, while other controls can be expanded through a drop-down menu or by clicking the More button, etc. This application does not impose any restrictions on the specific display method of the controls.

[0119] In addition, a search control can be set in the control bar 220 of the present application, so that the user can trigger the control search operation by clicking the search control, so that the electronic device can directly locate the corresponding control according to the detected control search operation, avoiding the time-consuming problem of manually searching for controls, thereby improving the speed of creating quantitative trading strategies.

[0120] The control boxes in the strategy canvas 230 can be connected in series or in parallel through connecting lines to generate a graphical quantitative trading strategy.

[0121] It should be noted that since conditional controls or self-encoded conditional controls correspond to a set of logical judgments, the connecting lines from the conditional boxes of these controls or self-encoded conditional controls include directions and parameters. The parameters are "yes" or "no." However, start controls, event controls, and self-encoded event controls specify specific actions to be performed. Therefore, the connecting lines from the start boxes of start controls and from the event boxes of event controls and self-encoded event controls only include directions, not parameters.

[0122] The property bar 240 is used to edit properties of controls added to the policy canvas 230. Optionally, when a user selects any control in the policy canvas 230, the property bar 240 will display editable parameter information corresponding to the control.

[0123] Then, when creating a graphical quantitative trading strategy based on the graphical interface shown in Figure 4, the user can select a target condition control, a target event control, a target self-encoding condition control and / or a target self-encoding event control from the control bar 220, and add the selected target quantitative strategy control to the strategy canvas 230, and then click on the box corresponding to any of the above target quantitative strategy controls to display the code area corresponding to the target quantitative strategy control in the graphical interface, and display the original code information of the target quantitative strategy control in the code area. Thus, the user can perform code editing operations on the original code information in the code area to adjust the original code information to the target code information, and convert the target quantitative strategy control into a self-encoding control based on the target code information. Furthermore, the start control and the self-encoding control in the strategy canvas 230, or the start control, self-encoding control, event control and / or condition control are connected by connecting lines to create a graphical quantitative trading strategy. Among them, the self-encoding control in the above strategy canvas 230 can be a self-encoding condition control, or a self-encoding event control, or of course, a self-encoding condition control and a self-encoding event control, and this application does not impose any restrictions on this.

[0124] The present application provides a method for creating a quantitative trading strategy. The method determines a target quantitative strategy control selected by a user in response to a control selection operation triggered in a graphical interface, displays the original code information of the target quantitative strategy control in a code area corresponding to the target quantitative strategy control, adjusts the original code information to target code information in response to a code editing operation on the original code information, and converts the target quantitative strategy control into a self-encoding control based on the target code information, thereby creating a quantitative trading strategy based on the self-encoding control. The present application provides users with a graphical interface that supports users in creating graphical quantitative trading strategies, so that users can create quantitative trading strategies simply and quickly in the graphical interface. By setting up editable code quantitative strategy controls in the graphical interface, users can edit the code information corresponding to at least one editable code quantitative strategy control during the process of creating a quantitative trading strategy, thereby modifying or expanding the executable operations based on the corresponding operations of the editable code quantitative strategy control to generate a self-coding control, and then creating the quantitative trading strategy required by the user based on the self-coding control. The application has low requirements on the user's ability to write program code and professionalism, can simplify the creation method of quantitative trading strategies, reduce the difficulty of creating quantitative trading strategies, thereby improving the user's investment enthusiasm and meeting the user's various investment needs.

[0125] Based on the above embodiments, the present application further explains how to adjust the original code information to the target code information in response to the code editing operation on the original code information, specifically referring to Figure 5. As shown in Figure 5, the method may include the following steps:

[0126] S201, in response to a control selection operation triggered on a graphical interface, determining a target quantitative strategy control selected by a user, where the graphical interface is used to create a quantitative trading strategy.

[0127] S202: Displaying original code information of the target quantization strategy control in the code area corresponding to the target quantization strategy control.

[0128] S203 : In response to a selection operation of an editing control in the code area, the original code information in the code area is controlled to be converted from a preview state to an editing state.

[0129] S204 , in response to the code editing operation on the original code information in the editing state, adjusting the original code information to target code information.

[0130] S205, create a quantitative trading strategy based on the self-encoding control.

[0131] Considering that some quantitative strategy controls only support code viewing but not code editing, when the user views the code of any target quantitative strategy control, the original code information corresponding to the target quantitative strategy control is displayed in the code area corresponding to the target quantitative strategy control. Based on the control type of the target quantitative strategy control being viewed by the user, an editing control, such as an edit button, can be selectively displayed in the code area. Furthermore, the user can edit the code content in the code area where the editing control is displayed, thereby avoiding errors in the created quantitative trading strategy caused by the user editing the code of a non-editable control.

[0132] For example, the control type viewed by the user may include: editable code controls and non-editable code controls. Accordingly, based on the control type viewed by the user, an edit control is selectively displayed in the code area. Specifically, if the control type viewed by the user is an editable code control, the edit control is displayed in the code area. If the control type viewed by the user is a non-editable code control, the edit control is not displayed in the code area. Exemplarily, the edit control displayed in the code area may be as shown in Figure 6. It should be understood that an edit control is a code editing control.

[0133] In some optional implementations, when the displayed code area includes an editing control, it means that the target quantization strategy control currently triggered by the user is a quantization strategy control for editable code. At this time, the user can select the editing control in the code area to switch the code area corresponding to the target quantization strategy control from a preview state to an editing state. Among them, the preview state can be understood as a state when the code information is viewed in advance, and the editing state can be understood as a state corresponding to when the user modifies or expands the code information in the code area. Furthermore, the user can modify the original code information in the code area in the editing state, or delete all the original code information and rewrite the new code, or add code for implementing new functions based on the original code information, etc., to implement code editing operations in the code area. Furthermore, based on the latest code edited by the user, the target quantization strategy control is converted into the personalized self-coding control required by the user.

[0134] It should be noted that the original code information displayed in the preview state of this application is exactly the same as the code content displayed in the edit state. For example, if the target quantization strategy control is a conditional control, the code content of the corresponding code area in the preview state and the code content in the edit state of the conditional control will both include the following: the conditional box function declaration and the implementation content of the conditional box function.

[0135] As an optional implementation, when the code area is in preview mode, the user can modify the parameters in the property bar. Correspondingly, the same parameters in the code area in preview mode are also modified synchronously to achieve a synchronized modification effect.

[0136] In some implementations, converting at least one quantitative strategy control in the strategy canvas to a personalized self-encoding control is irreversible. That is, after converting a code-editable quantitative strategy control to a self-encoding control, it is impossible to convert the self-encoding control back to the original target quantitative strategy control.

[0137] Therefore, before editing the original code information in the code area of ​​the target quantitative strategy control, the present application optionally displays a first pop-up window, wherein the first pop-up window includes at least a first control. Furthermore, in response to the selection of the first control, the original code information displayed in the code area is controlled to switch from a preview state to an edit state.

[0138] In other words, the present application can output the first pop-up window information to the user, so that the user can determine whether it is necessary to continue editing the original code information in the code area based on the first pop-up window information to convert the target quantization strategy control into an irreversible self-encoding control.

[0139] The first pop-up window information may include: a first control, a second control, a prompt message, and a checkbox. The first control may be a confirmation control, such as OK or Yes. The second control may be a cancel control, such as Cancel or Think Again. The checkbox may be Done Again, etc. This application does not impose any restrictions on this.

[0140] For example, the first pop-up window information may be as shown in FIG7 , wherein the first control is a confirmation control, the second control is a cancel control, and the prompt information may be selected as “After editing, the [Event X] control will be converted to a self-encoding control, and you will not be able to modify the parameters in the property bar. Please confirm whether to continue editing.”

[0141] Furthermore, if it is detected that the user has triggered the first control in the first pop-up window, i.e., the control is confirmed, it indicates that the user has determined that the original code information in the code region needs to be edited and a self-encoding control generated. Based on the user's code editing operation in the code region, the original code information in the code region is adjusted to the target code information, and the target quantization strategy control is converted into a self-encoding control based on the target code information. For example, the generated self-encoding control may be shown in Figures 8A and 8B.

[0142] If it is detected that the user triggers the second control in the first pop-up window information, that is, the cancel control, it means that the user does not want to continue editing the code in the code area, and the operation of generating the editing control is canceled.

[0143] In addition, if it is detected that the user triggers the first control or the second control in the first pop-up window information and also checks the check option, then the next time the first pop-up window information needs to be output to the user, it will be processed accordingly by default according to the first control or the second control triggered by the user last time, so as to avoid outputting the first pop-up window information multiple times and causing interference to the user.

[0144] The present application provides a method for creating a quantitative trading strategy. By providing a user with a graphical interface that supports the user in creating a graphical quantitative trading strategy, the user can simply and quickly create a quantitative trading strategy in the graphical interface. Furthermore, by setting up an editable quantitative strategy control in the graphical interface, the user can edit the code information corresponding to at least one editable quantitative strategy control during the creation of the quantitative trading strategy, thereby modifying or expanding the executable operations of the editable quantitative strategy control based on the corresponding operations of the editable quantitative strategy control to generate a self-encoding control, and then create the quantitative trading strategy required by the user based on the self-encoding control. This method has low requirements for the user's programming skills and professionalism, can simplify the creation of quantitative trading strategies, reduce the difficulty of creating quantitative trading strategies, thereby increasing the user's investment enthusiasm and meeting the user's various investment needs. In addition, by setting up an editing control in the code area of ​​the target quantitative strategy control, the user can trigger the editing control to edit the original code corresponding to at least one quantitative strategy control in the strategy canvas to generate a self-encoding control, thereby avoiding the problem of users accidentally editing the code corresponding to the quantitative strategy control. Furthermore, by outputting a first pop-up message to the user to remind the user whether to convert at least one editable quantitative strategy control in the strategy canvas into a self-coding control, it can help the user reduce the generation of useless self-coding controls and cause unnecessary waste of resources.

[0145] In some optional implementation scenarios of the present application, it is considered that when a user edits the original code information in the code area corresponding to the quantitative strategy control of any editable code in the strategy canvas, there may be a problem of code editing errors. To this end, when the user edits the original code information in the code area, the present application optionally detects the edited code in the code area to determine whether the user has made an error in editing the code in the code area. The code process for detecting the code area provided by the present application is specifically described below in conjunction with Figure 9. As shown in Figure 9, the method may include the following steps:

[0146] S301, in response to a control selection operation triggered on a graphical interface, determining a target quantitative strategy control selected by a user, where the graphical interface is used to create a quantitative trading strategy.

[0147] S302: Displaying original code information of the target quantization strategy control in the code area corresponding to the target quantization strategy control.

[0148] S303 : In response to the code editing operation on the original code information, the original code information is adjusted to target code information.

[0149] S304, detect the target code information in the code area, if there is an error in the target code information, execute S305, otherwise execute S308.

[0150] It should be understood that after the code editing operation is performed, the conditional controls, event controls, self-encoded conditional controls and / or self-encoded event controls in the strategy canvas are collectively referred to as self-encoded controls to facilitate the subsequent description of the detection part.

[0151] In some optional implementations, the present application detects target code information in a code area and may perform corresponding detection operations based on the type of control corresponding to the code area.

[0152] Specifically, if the target quantization strategy control is a self-encoding conditional control, the code detection process detects the return value types and self-encoding language of all executable paths in the code area. If the target quantization strategy control is a self-encoding event control, the code detection process detects the self-encoding syntax in the code area.

[0153] The code detection process can be selected as a sub-process of the policy execution process, and is mainly used to detect whether there are errors in the target code information in the code area. The policy execution process can be understood as the system that executes the content of the policy canvas.

[0154] In this application, the controls in the strategy canvas include three categories: condition controls, event controls, and start controls. Each control box corresponds to a function, which can be used as a small execution unit.

[0155] The function corresponding to each of the above boxes can call the interface in the corresponding platform of the graphical interface to obtain relevant information. For example, the last_price() interface can obtain the latest price of the stock, and the bar_open() interface can obtain the K-line opening price of the stock.

[0156] Furthermore, the functions corresponding to each of these boxes can use global variables and local variables defined within the current box. Functions corresponding to different boxes cannot call each other's corresponding local variables. Furthermore, functions corresponding to different boxes cannot call each other. The policy execution process establishes the execution relationship of the box function logic based on the connections between the various controls in the policy canvas.

[0157] In some implementations, the return value variable type of the self-encoded conditional control needs to be a Boolean variable, i.e., BOOL type. Therefore, this application needs to detect the return value types of all executable paths in the code area corresponding to the self-encoded conditional control. The detection process can be to parse all possible execution paths of the box function corresponding to the conditional control through a code detection process to determine whether all possible execution paths are of BOOL type, so as to ensure the accuracy of the connection execution of the logic judgment box.

[0158] It should be understood that Boolean variables have only true and false values ​​and can be used in logical expressions, that is, logical operations such as "or", "and", and "not", and relational operations such as greater than and less than. The result of the logical expression operation is true or false.

[0159] Among them, all possible execution paths of the box function corresponding to the self-encoded conditional control are parsed to determine whether all possible execution paths are of BOOL type, which may include the following situations:

[0160] Scenario 1

[0161] If the parsed self-encoded conditional control corresponding box function lacks a bool return value in the else path, it is determined that at least one executable path of the self-encoded conditional control corresponding box function is not a bool type. In this case, an error will be reported.

[0162] For example, when outputting if condition_code: return True, an error is reported on the line if condition_code→, indicating that only the return value of the if execution path is included; when the if path is not entered, no bool return value is returned.

[0163] Scenario 2

[0164] If the return path of the box function corresponding to the self-encoded conditional control contains a non-bool return value, it is determined that at least one executable path of the box function corresponding to the self-encoded conditional control is not a bool type. In this case, an error will be reported.

[0165] For example, output else: return "Hello" → This line reports an error because the return value of the path is not of type bool.

[0166] In some optional implementations, considering that code editing operations may occur when the self-encoding control is a self-encoding conditional control and / or a self-encoding event control, it is necessary to detect the self-encoding language. Optionally, in this application, detecting the self-encoding syntax in the code area through a code detection process may include: detecting whether the self-encoding in the code area complies with the code writing specifications of the programming language, and whether the member variables used in the self-encoding are defined in the agreed function of the start control, where the start control is pre-set in the strategy canvas, and the strategy canvas is located in the graphical interface.

[0167] The agreed function of starting the control at least includes: a definition function trigger_symbols for running the target and a definition function global_variables for global variables.

[0168] Optionally, the present application can also perform self-encoding syntax detection on the code information in the code area corresponding to the start control. The specific detection process is the same or similar to the aforementioned self-encoding syntax detection method in the code area of ​​the self-encoding event control and the self-encoding conditional control, and will not be described in detail here.

[0169] In addition, this application can also detect the agreed functions displayed in the code area of ​​the start control. Specifically, it includes the following situations:

[0170] In the first case, the target declaration in the target definition function trigger_symbols is checked for duplication. If so, an error is reported; otherwise, no error is reported.

[0171] In the second case, the number of running targets in the definition function trigger_symbols of the running targets is detected. If the number of running targets exceeds the allowable number, an error is reported; otherwise, no error is reported.

[0172] In the third case, check whether the definition function trigger_symbols of the running target and the definition function global_variables of the global variables are missing; if they are missing, an error is reported; if they are not missing, further check the number of running targets defined in the definition function of the running target. If it exceeds the preset number value, an error is reported, otherwise no error is reported.

[0173] S305, when there is an error in the target code information, the identification information of the self-encoding control corresponding to the error, the identification information of the code line corresponding to the error, and detailed error information are displayed in the detection area.

[0174] The identification information of the self-encoding control is used to uniquely identify the corresponding self-encoding control, and the identification information of the code line is used to uniquely identify the corresponding code line. The identification information of the self-encoding control can be selected as the serial number or name of the self-encoding control. The identification information of the code line can be selected as the number of the code line, etc.

[0175] In this application, the graphical interface also includes a detection area, and the detection area can be optionally located below the code area, or located next to the code area, such as on the right side or left side of the code area, etc. This application does not impose any restrictions on this.

[0176] Optionally, when it is determined that there is an error in the target code information in the code area, the present application displays specific error information in the detection area so that the user can perform modification operations based on the error information to eliminate the above error.

[0177] For example, if there is an error in the target code information in the code area corresponding to any self-encoding control, the details of the error can be displayed in the detection area, as shown in Figure 10. In Figure 10, the identification information of the self-encoding condition control is self-encoding condition 1, the identification information of the code lines corresponding to the error is line 1, line 9, and line 24, and the error details are: Expression expected.

[0178] S306 , in response to the modification operation on the error code, detecting the modified code, if the modified code has an error, executing S305 , otherwise executing S307 .

[0179] S307 , when there is no error in the edited code in the code area, converting the target quantitative strategy control into a self-encoding control based on the latest code in the code area.

[0180] S308, creating a quantitative trading strategy based on the self-encoding control.

[0181] Optionally, the user can modify the error message displayed in the detection area. Moreover, when the user's modification operation is detected, the present application can also detect the modified code. The detection process is the same or similar to the implementation method in the aforementioned S304. For details, please refer to the aforementioned S304 section, which will not be described in detail here.

[0182] If errors are detected in the modified auto-encoding syntax or in the return value type of any executable path, further errors will be reported, prompting the user to adjust the code based on the error and continue testing the adjusted code until the errors are eliminated. Furthermore, an auto-encoding control is generated based on the error-free code information. A quantitative trading strategy is then created based on the auto-encoding control.

[0183] The present application provides a method for creating a quantitative trading strategy. This method provides a user with a graphical interface that supports the creation of graphical quantitative trading strategies, allowing the user to quickly and easily create a quantitative trading strategy within the graphical interface. Furthermore, by providing an editable quantitative strategy control within the graphical interface, the user can edit the code information corresponding to at least one editable quantitative strategy control during the creation of the quantitative trading strategy. This allows the user to modify or expand the executable operations of the editable quantitative strategy control based on the corresponding operations of the editable quantitative strategy control to generate a self-encoding control, and then create the quantitative trading strategy required by the user based on the self-encoding control. This method requires less coding expertise and simplifies the creation of quantitative trading strategies, reducing the difficulty of creating quantitative trading strategies. Furthermore, the method detects target code information in the code area to eliminate possible errors, and reports an error to the user when an error is detected, allowing the user to modify the erroneous code in the code area based on the error information, so that the modified code is error-free, thereby facilitating the normal operation of subsequent quantitative trading strategies.

[0184] The following is a detailed description of creating a quantitative trading strategy based on the self-encoding control in this application with reference to FIG11. As shown in FIG11, the method may include the following steps:

[0185] S401, in response to a control selection operation triggered on a graphical interface, determining a target quantitative strategy control selected by a user, where the graphical interface is used to create a quantitative trading strategy.

[0186] S402: Displaying original code information of the target quantization strategy control in the code area corresponding to the target quantization strategy control.

[0187] S403 , in response to the code editing operation on the original code information, adjusting the original code information to target code information, and converting the target quantization strategy control to a self-encoding control based on the target code information.

[0188] S404, create a graphical quantitative trading strategy based on the self-encoding control.

[0189] It should be understood that the graphical interface further includes a start control, and the start control is set by default in the policy canvas of the graphical interface.

[0190] Therefore, the present application creates a graphical quantitative trading strategy. Optionally, the user can connect the self-encoding control and the start control in the strategy canvas with a connecting line to create a graphical quantitative trading strategy. In other words, the present application can create a graphical quantitative trading strategy by connecting the self-encoding control and the start control with a connecting line in response to the connection operation of the self-encoding control and the start control.

[0191] S405: Based on the graphical quantitative trading strategy, obtain the quantitative trading strategy code of the quantitative trading strategy.

[0192] In some optional implementations, at least one execution path can be first determined based on a graphical quantitative trading strategy, where the execution path includes at least one self-encoding control and a connecting line connecting the self-encoding control to adjacent controls. The self-encoding control is then encapsulated to obtain a self-encoding control function, and the execution path is encapsulated based on the connecting lines connecting the self-encoding control to adjacent controls to obtain an execution path function. The execution path function calls the self-encoding control function corresponding to the self-encoding control within the execution path. Then, based on the execution path function, the quantitative trading strategy code for the quantitative trading strategy is obtained.

[0193] The aforementioned controls adjacent to the self-encoding control may be a start control, a self-encoding control, a condition control, or an event control, wherein the self-encoding control includes: a self-encoding condition control and / or a self-encoding event control.

[0194] For example, as shown in Figure 12, in a graphical quantitative trading strategy, a circle represents a control, and each control can be represented as a node. The leftmost node is the start control, and the remaining nodes can be at least one of a self-encoded condition control, a self-encoded event control, a condition control, and an event control. Furthermore, each execution path in the graphical quantitative trading strategy can include at least one self-encoded control, as well as connecting lines between controls adjacent to the self-encoded control.

[0195] In this application, if the self-encoding control is a self-encoding conditional control, the process of encapsulating the self-encoding conditional control can be to call and encapsulate the corresponding box execution encapsulation function condition_invoke during the policy execution process. In addition, the condition_invoke function will handle exceptions during the box function execution according to the exception handling policy. At the same time, the above encapsulation also handles the execution of the connecting line call. For example, the encapsulation process of the self-encoding conditional control can be shown in Figure 13A.

[0196] If the self-encoding control is a self-encoding event control, encapsulation can be achieved by encapsulating the corresponding frame execution encapsulation function, event_invoke, within the policy execution process. Furthermore, the event_invoke function handles exceptions during frame function execution according to the exception handling policy. Furthermore, the encapsulation also handles the execution of connection line calls. For example, the encapsulation process for a self-encoding event control can be shown in Figure 13B.

[0197] Furthermore, this application encapsulates execution paths. Specifically, the execution path triggered from the start control's corresponding box is registered in the path registration convention function _init_invoke_chain. This allows the policy execution process to execute the connecting line execution path starting from the start box in the order of the coordinates of each control in the policy canvas from front to back. Each execution path is registered using the path content registration convention function _register_func.

[0198] It should be noted that the registration order of the above execution paths specifically refers to the execution order of the paths when the policy is triggered for execution.

[0199] Furthermore, the strategy execution process of this application will handle exceptions during the execution of the quantitative trading strategy according to the exception handling strategy. For example, the process of encapsulating the execution path of this application can be shown in Figure 13C.

[0200] After encapsulating the self-encoded control and execution path to obtain the corresponding function, users can click on the strategy canvas to add a new code copy option. This allows graphical quantitative trading strategies to be saved as quantitative trading strategy code. When creating a new code copy, if the maximum number of strategies is exceeded, no copy will be created, and a second pop-up message will be displayed, prompting the user to delete some existing strategies and create a new code copy.

[0201] The second pop-up window may include a title, a body, and an operation control. For example, as shown in FIG14 , the title of the second pop-up window may be a prompt; the body may read: "You can create up to 50 policies, but the current limit has been reached. Please delete some policies and try again." The operation control may be a confirmation control.

[0202] In this application, when saving a graphical quantitative trading strategy as a pure code copy, the pure code copy contains a large strategy class, which includes four agreed functions: initialize() for initialization, trigger_symbols for defining the target, global_vatiables for defining global variables, handle_data, and various control functions. Among them, comments are added to the control functions, such as the control name and remarks. Among them, handle_data can be triggered by events such as K-line push, Tick push, fixed time interval, and specified time.

[0203] Exemplarily, the pure code quantitative trading strategy copy of the present application may include the following: the function for initializing the call corresponding to the start control: the definition function trigger_symbols() of the running target and the definition function global_variables() of the global variables, and the definition function of the custom indicator; the agreed function declaration of the running target, the agreed function declaration of the global variables, the agreed function declaration of the custom indicator, the execution path registration agreed function, the implementation of each strategy box and the invoke encapsulation, etc.

[0204] It should be noted that the overall implementation logic of the above-mentioned pure code quantitative trading strategy can be that the strategy execution process adds basic fragments to the strategy executor, and then obtains the complete quantitative trading strategy code based on the basic fragments and the encapsulated functions. The complete quantitative trading strategy code can be shown in Figure 15.

[0205] The above basic fragment includes the following parts: import part, class part and main part.

[0206] Specifically, in the import section, before executing the policy, you need to import some fixed dependencies, such as some functional libraries. Moreover, these contents will be automatically processed when the policy is created and the code is generated.

[0207] Class: The entire strategy canvas is converted into a strategy class. All box functions and contract functions inherited from the StrategyBase base type are member functions of the strategy class. In other words, the created quantitative trading strategy must inherit from this base type to identify itself as a strategy.

[0208] Main part: It is the entry point where the policy class is recognized by the policy executor and the policy is instantiated and triggered.

[0209] S406: Run the quantitative trading strategy code and obtain the running results.

[0210] After obtaining the quantitative trading strategy code, the user can run the quantitative trading strategy code to obtain the running results of the quantitative trading strategy.

[0211] Optionally, when running a quantitative trading strategy code, different running modes are available, such as a historical backtesting run mode or a live trading run mode. Therefore, the user can select any target run mode from the different run modes, causing the electronic device to respond to the selection of any target run mode in the strategy canvas and run the quantitative trading strategy code based on the target run mode to obtain the run results. The target run mode can be either a historical backtesting run mode or a live trading run mode.

[0212] Considering that during the running of the quantitative trading strategy code, conditional controls, event controls, self-encoded conditional controls and / or self-encoded event controls may have exceptions, resulting in request failures or abnormal data acquisition. Therefore, before running the quantitative trading strategy code, this application first sets a corresponding exception handling strategy for the quantitative trading strategy, so that if an exception occurs during the running of the quantitative trading strategy, the exception can be handled according to the pre-set exception handling strategy, thereby ensuring that the quantitative trading strategy code can run normally.

[0213] In some optional implementations, the pre-set exception handling strategy can be a customized setting for the entire quantitative trading strategy code, or it can be based on the controls included in the quantitative trading strategy code, with an exception handling strategy set for each control. This application does not impose specific restrictions on this.

[0214] That is to say, the exception handling strategy in this application is set based on the quantitative trading strategy code, or based on the type of controls in the quantitative trading strategy code, where the controls include: start controls, condition controls, event controls, self-encoded condition controls and / or self-encoded event controls.

[0215] Assuming the exception handling strategy is customized for the entire quantitative trading strategy code, it can include the following information: market access exceptions and message alerts. Market access exceptions can be set to continue the process and attempt to reconnect to the market. Message alerts can be set to not receive system message alerts when the real market is running abnormally.

[0216] Assuming that the exception handling strategy is set for each control in the quantitative trading strategy code, then when the quantitative trading strategy code includes a start control, a self-encoding condition control, and a self-encoding event control, then the corresponding exception handling strategy 1 can be set for the start control, exception handling strategy 2 can be set for the self-encoding condition control, and exception handling strategy 3 can be set for the self-encoding event control.

[0217] After setting up the exception handling strategy for the quantitative trading strategy code, the user can obtain the operating parameter information and exception handling strategy of the target operating mode, and run the quantitative trading strategy code based on the operating parameters and exception handling strategy of the target operating mode to obtain the operating results.

[0218] During the execution of the quantitative trading strategy code, if an exception is detected in the start box function corresponding to the start control after the strategy is initialized, the corresponding exception handling strategy is invoked, and the exception handler is instructed to handle the exception based on the exception handling strategy, while also generating a daily log. The strategy execution process then records the initialization exception information to provide a basis for handling subsequent similar exceptions, and the strategy execution process exits the current execution operation. If an exception is detected in the self-encoded event control or the event box function corresponding to the event control during execution, the event box's execution wrapper function, event_invoke, is used to capture the exception and retrieve the event box's pre-configured exception handling strategy. A determination is made as to whether the exception should be handled within the event box execution unit. If so, the relevant exception log is generated, and execution continues. If not, the exception is handled by the exception handler within the strategy execution process, which also generates the relevant exception log, and execution continues. If an exception is detected during the execution of a self-coded conditional control or the conditional box function corresponding to the conditional control, the exception is captured by the condition_invoke execution encapsulation function of the conditional box. This exception is then executed by the exception handler in the policy execution process, and the relevant exception log is output, and execution continues.

[0219] In some implementations, considering that there may be errors in the obtained quantitative trading strategy code, the present application may optionally perform error detection on the quantitative trading strategy code before running the quantitative trading strategy code and obtaining the running results to determine whether the strategy configuration is correct. If there is error information in the quantitative trading strategy code, the error information is output in the detection area. The error information includes the identification information of the code line corresponding to the error and the error details, where the identification information of the code line is used to uniquely identify the corresponding code line. If there is no error information in the quantitative trading strategy code, the quantitative trading strategy code continues to be run to obtain the running results of the quantitative trading strategy.

[0220] If an error message is found in the quantitative trading strategy code, the user can modify the error based on the error message displayed in the detection area. After the modification, the user can perform error detection on the quantitative trading strategy code again until the latest modified quantitative trading strategy code is error-free.

[0221] The present application provides a method for creating a quantitative trading strategy. By providing a user with a graphical interface that supports the user in creating a graphical quantitative trading strategy, the user can simply and quickly create a quantitative trading strategy in the graphical interface. In addition, by setting a quantitative strategy control with editable code in the graphical interface, the user can edit the code information corresponding to at least one quantitative strategy control with editable code during the process of creating a quantitative trading strategy, thereby modifying or expanding the executable operations based on the corresponding operations of the quantitative strategy control with editable code to generate a self-coding control, and then creating the quantitative trading strategy required by the user based on the self-coding control. The method has low requirements on the user's programming skills and professionalism, can simplify the creation method of quantitative trading strategies, and reduce the difficulty of creating quantitative trading strategies.

[0222] The following describes a device for creating a quantitative trading strategy, as proposed in an embodiment of the present application, with reference to FIG16 . FIG16 is a schematic block diagram of a device for creating a quantitative trading strategy, as provided in an embodiment of the present application. As shown in FIG16 , the device 500 for creating a quantitative trading strategy includes a control determination module 510 , a code display module 520 , a code editing module 530 , and a strategy creation module 540 .

[0223] The control determination module 510 is configured to determine the target quantitative strategy control selected by the user in response to a control selection operation triggered on a graphical interface for creating a quantitative trading strategy;

[0224] A code display module 520 is configured to display original code information of the target quantization strategy control in a code area corresponding to the target quantization strategy control;

[0225] a code editing module 530 for adjusting the original code information into target code information in response to a code editing operation on the original code information, and converting the target quantization strategy control into a self-encoding control based on the target code information;

[0226] The strategy creation module 540 is used to create a quantitative trading strategy based on the self-encoding control.

[0227] In an optional implementation of the embodiment of the present application, the code display module 520 is specifically configured to:

[0228] Reading at least one attribute information of the target quantization strategy control;

[0229] Obtaining the interface function corresponding to each of the attribute information;

[0230] According to the interface function and the attribute value corresponding to each of the attribute information, the original code information of the target quantization strategy control is generated, and the original code information of the target quantization strategy control is displayed in the code area corresponding to the target quantization strategy control.

[0231] In an optional implementation of the embodiment of the present application, the code editing module 530 includes:

[0232] a control unit, configured to control the original code information in the code area to be converted from a preview state to an edit state in response to a selection operation of an edit control in the code area;

[0233] The adjusting unit is configured to adjust the original code information into target code information in response to a code editing operation on the original code information in the editing state.

[0234] In an optional implementation of the embodiment of the present application, the control unit is specifically configured to:

[0235] In response to a selection operation of an editing control in the code area, displaying first pop-up window information, wherein the first pop-up window information at least includes: a first control;

[0236] In response to a selection operation of the first control, the original code information displayed in the code area is controlled to be converted from a preview state to an edit state.

[0237] In an optional implementation of the embodiment of the present application, the graphical interface includes: a control bar, and the control bar includes: a self-encoding control;

[0238] Accordingly, the control determination module 510 is specifically configured to:

[0239] In response to the self-encoding control selection operation triggered in the control bar, a target self-encoding control selected by the user is determined.

[0240] In an optional implementation of the embodiment of the present application, the graphical interface includes: a detection area; a quantitative trading strategy creation device 500, further comprising:

[0241] A detection module, configured to detect the target code information in the code area;

[0242] An error display module is used to display the identification information of the self-encoding control corresponding to the error, the identification information of the code line corresponding to the error, and the error details in the detection area when there is an error in the target code information; wherein the identification information of the self-encoding control is used to uniquely identify the corresponding self-encoding control, and the identification information of the code line is used to uniquely identify the corresponding code line.

[0243] In an optional implementation of the embodiment of the present application, the self-encoding control includes: a self-encoding condition control and / or a self-encoding event control;

[0244] Accordingly, the detection module is specifically used to:

[0245] If the self-encoding control is a self-encoding conditional control, detecting all executable path return value types and self-encoding syntax in the code area through a code detection process;

[0246] If the self-encoding control is a self-encoding event control, the self-encoding syntax in the code area is detected through a code detection process.

[0247] In an optional implementation of the embodiment of the present application, the detection module is further configured to:

[0248] Detect whether the self-encoding in the code area complies with the code writing specification of the programming language, and whether the member variables used in the self-encoding are defined in the agreed function of the start control, the start control is pre-set in the strategy canvas, and the strategy canvas is located in the graphical interface.

[0249] In an optional implementation of the embodiment of the present application, the policy creation module 540 includes:

[0250] A creation unit, used for creating a graphical quantitative trading strategy based on the auto-encoding control;

[0251] An acquisition unit is used to acquire a quantitative trading strategy code of the quantitative trading strategy based on the graphical quantitative trading strategy.

[0252] In an optional implementation of the embodiment of the present application, the graphical interface further includes a start control; and a creation unit, specifically configured to:

[0253] In response to the connection operation of the self-encoding control and the start control, the self-encoding control and the start control are connected by a connecting line to create the graphical quantitative trading strategy.

[0254] In an optional implementation of the embodiment of the present application, the acquiring unit is specifically configured to:

[0255] Determining at least one execution path based on the graphical quantitative trading strategy, wherein the execution path includes at least one self-encoding control and a connecting line connecting the self-encoding control with an adjacent control;

[0256] Encapsulating the self-encoding control to obtain a self-encoding control function;

[0257] Based on the connection line connecting the self-encoding control and the adjacent control, the execution path is encapsulated to obtain an execution path function, wherein the execution path function calls the self-encoding control function corresponding to the self-encoding control in the execution path;

[0258] Based on the execution path function, a quantitative trading strategy code of the quantitative trading strategy is obtained.

[0259] The present application provides a device for creating a quantitative trading strategy. By providing a user with a graphical interface that supports the user in creating a graphical quantitative trading strategy, the user can simply and quickly create a quantitative trading strategy in the graphical interface. In addition, by setting a quantitative strategy control with editable code in the graphical interface, the user can edit the code information corresponding to at least one quantitative strategy control with editable code during the process of creating a quantitative trading strategy, thereby modifying or expanding the executable operations based on the corresponding operations of the quantitative strategy control with editable code to generate a self-encoding control, and then creating the quantitative trading strategy required by the user based on the self-encoding control. The device has low requirements for the user's programming skills and professionalism, can simplify the creation method of the quantitative trading strategy, reduce the difficulty of creating the quantitative trading strategy, thereby improving the user's investment enthusiasm and meeting the user's various investment needs.

[0260] It should be understood that the device embodiments and method embodiments may correspond to each other, and similar descriptions may refer to the method embodiments. To avoid repetition, they will not be described in detail here. Specifically, the device 500 shown in FIG16 can execute the method embodiment corresponding to FIG1, and the aforementioned and other operations and / or functions of each module in the device 500 are respectively for implementing the corresponding processes in each method in FIG1. ​​For the sake of brevity, they will not be described in detail here.

[0261] The above description of the device 500 of the embodiment of the present application is based on the functional module in conjunction with the accompanying drawings. It should be understood that the functional module can be implemented in hardware, can be implemented by instructions in software, or can be implemented by a combination of hardware and software modules. Specifically, the steps of the method embodiment in the embodiment of the present application can be completed by the hardware integrated logic circuit and / or software instructions in the processor, and the steps of the method disclosed in the embodiment of the present application can be directly embodied as being executed by a hardware decoding processor, or can be executed by a combination of hardware and software modules in the decoding processor. Optionally, the software module can be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps in the above method embodiment in conjunction with its hardware.

[0262] FIG17 is a schematic block diagram of an electronic device provided in an embodiment of the present application. As shown in FIG17 , the electronic device 600 may include:

[0263] The memory 610 and the processor 620 are configured to store computer programs and transmit the program code to the processor 620. In other words, the processor 620 can call and run the computer program from the memory 610 to implement the method in the embodiment of the present application.

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

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

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

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

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

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

[0270] As shown in Figure 17, the electronic device may further include a transceiver 630, which may be connected to the processor 620 or the memory 610. The processor 620 may control the transceiver 630 to communicate with other devices. Specifically, the transceiver 630 may send information or data to other devices or receive information or data sent by other devices. The transceiver 630 may include a transmitter and a receiver. The transceiver 630 may further include one or more antennas.

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

[0272] The present application also provides a computer storage medium having a computer program stored thereon, which enables the computer to perform the method of the above method embodiment when the computer program is executed by the computer.

[0273] An embodiment of the present application further provides a computer program product comprising instructions, which, when executed on an electronic device, enables the electronic device to execute the method of the above method embodiment.

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

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

[0276] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules is merely a logical function division. In actual implementation, there may be other division methods, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

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

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

[0279] It is understandable that in the specific implementation of this application, when it comes to the relevant data used in the creation of quantitative trading strategies, when the above embodiments of this application are applied to specific products or technologies, user permission, consent or authorization must be obtained, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions.

Claims

1. A method for creating a quantitative trading strategy, characterized in that: include: In response to a control selection operation triggered on a graphical interface, determining a target quantitative strategy control selected by a user, wherein the graphical interface is used to create a quantitative trading strategy; In the code area corresponding to the target quantization strategy control, display the original code information of the target quantization strategy control; In response to a code editing operation on the original code information, adjusting the original code information into target code information, and converting the target quantization strategy control into a self-encoding control based on the target code information; Create a quantitative trading strategy based on the self-encoding control.

2. The method according to claim 1, characterized in that The original code information of the target quantization strategy control is displayed in the code area corresponding to the target quantization strategy control, including: Reading at least one attribute information of the target quantization strategy control; Obtaining the interface function corresponding to each of the attribute information; According to the interface function and the attribute value corresponding to each of the attribute information, the original code information of the target quantization strategy control is generated, and the original code information of the target quantization strategy control is displayed in the code area corresponding to the target quantization strategy control.

3. The method according to claim 1, characterized in that The step of adjusting the original code information to target code information in response to the code editing operation on the original code information includes: In response to a selection operation of an editing control in the code area, controlling the original code information in the code area to be converted from a preview state to an editing state; In response to a code editing operation on the original code information in the editing state, the original code information is adjusted to target code information.

4. The method according to claim 3, characterized in that In response to the selection operation of the edit control in the code area, controlling the original code information in the code area to be converted from a preview state to an edit state includes: In response to a selection operation of an editing control in the code area, displaying first pop-up window information, wherein the first pop-up window information at least includes: a first control; In response to the selection operation of the first control, the original code information displayed in the code area is controlled to be converted from a preview state to an edit state.

5. The method according to claim 1, characterized in that: The graphical interface includes: a control bar, and the control bar includes: a self-encoding control; Accordingly, in response to the control selection operation triggered on the graphical interface, determining the target quantization strategy control selected by the user includes: In response to the self-encoding control selection operation triggered in the control bar, a target self-encoding control selected by the user is determined.

6. The method according to any one of claims 1 to 5, characterized in that: The graphical interface includes: a detection area; the method also includes: detecting the target code information in the code area; When there is an error in the target code information, the identification information of the self-encoding control corresponding to the error, the identification information of the code line corresponding to the error and the error details are displayed in the detection area; Among them, the identification information of the self-encoding control is used to uniquely identify the corresponding self-encoding control, and the identification information of the code line is used to uniquely identify the corresponding code line.

7. The method according to claim 6, characterized in that The self-encoding control includes: a self-encoding condition control and / or a self-encoding event control; Correspondingly, the detecting the target code information in the code area includes: If the self-encoding control is a self-encoding conditional control, all executable path return value types and self-encoding syntax in the code area are detected through a code detection process; If the self-encoding control is a self-encoding event control, the self-encoding syntax in the code area is detected through a code detection process.

8. The method according to claim 7, characterized in that The detecting the auto-encoding grammar in the code region through a code detection process includes: It is detected whether the self-coding in the code area complies with the code writing specification of the programming language, and whether the member variables used in the self-coding are defined in the agreed function of the start control, the start control is pre-set in the strategy canvas, and the strategy canvas is located in the graphical interface.

9. The method according to claim 1, characterized in that: The step of creating a quantitative trading strategy based on the self-encoding control includes: Based on the self-encoding control, create a graphical quantitative trading strategy; Based on the graphical quantitative trading strategy, a quantitative trading strategy code of the quantitative trading strategy is obtained.

10. The method according to claim 9, characterized in that The graphical interface also includes a start control; the creation of a graphical quantitative trading strategy based on the self-encoding control includes: In response to the connection operation between the self-encoding control and the start control, the self-encoding control and the start control are connected through a connecting line to create the graphical quantitative trading strategy.

11. The method according to claim 9, characterized in that The step of obtaining the quantitative trading strategy code of the quantitative trading strategy based on the graphical quantitative trading strategy includes: Based on the graphical quantitative trading strategy, determining at least one execution path, the execution path comprising at least one self-encoding control, and a connecting line connecting the self-encoding control with an adjacent control; Encapsulating the self-encoding control to obtain a self-encoding control function; Based on the connection line connecting the self-encoding control and the adjacent control, the execution path is encapsulated to obtain an execution path function, wherein the execution path function calls the self-encoding control function corresponding to the self-encoding control in the execution path; Based on the execution path function, a quantitative trading strategy code of the quantitative trading strategy is obtained.

12. A device for creating a quantitative trading strategy, characterized in that: include: A control determination module, for determining a target quantitative strategy control selected by a user in response to a control selection operation triggered on a graphical interface, wherein the graphical interface is used to create a quantitative trading strategy; A code display module, used for displaying original code information of the target quantization strategy control in a code area corresponding to the target quantization strategy control; A code editing module, configured to adjust the original code information into target code information in response to a code editing operation on the original code information, and convert the target quantization strategy control into a self-encoding control based on the target code information; A strategy creation module is used to create a quantitative trading strategy based on the self-encoding control.

13. An electronic device, characterized in that: include: A processor and a memory, the memory being used to store a computer program, and the processor being used to call and run the computer program stored in the memory to execute the method according to any one of claims 1 to 11.

14. A computer-readable storage medium, characterized in that: Used to store a computer program, wherein the computer program causes a computer to execute the method according to any one of claims 1 to 11.

Citation Information

Patent Citations

  • Quantitative transaction strategy writing method and device based on visual configuration

    CN110688106A

  • Method and device for efficiently creating quantitative transaction strategy based on flow chart

    CN111930373A

  • Method and device for running quantitative transaction strategy

    CN114793456A

  • Method and device for creating quantitative transaction strategy

    CN115053245A

  • Contract failure behavior with escalation policy

    US20100218169A1