Disclosure of Invention
The invention provides a quantitative transaction method integrating multisource information data, which is used for improving the accuracy of a quantitative transaction system in policy prediction and the income expression in actual transaction. The method comprises the steps of receiving multi-source information data in a quantized transaction strategy, wherein the multi-source information data at least comprise structured data (such as a drive price, transaction amount and the like) and unstructured data (such as economic indexes, news texts and the like), carrying out data preprocessing, feature extraction and feature fusion on the multi-source information data, generating a quantized transaction strategy model, obtaining historical multi-source information data, carrying out feedback evaluation by using the quantized transaction strategy model, generating a feedback result, judging whether strategy transaction is executed according to the feedback result, obtaining real-time multi-source information data, carrying out simulation actual transaction or actual transaction, and generating a transaction result.
In the multi-source information data receiving process of the quantitative transaction method, the invention provides a plurality of data interfaces which support the acquisition of structured and unstructured data from a plurality of data sources. Real-time data such as structured data (e.g., price of a disc, transaction amount, etc.) is obtained through the exchange interface, and unstructured data (e.g., news text, economic indicators, etc.) is obtained through the data packet interface. The history data may be downloaded via a data interface or uploaded directly by the user. All the collected or uploaded data are finally stored in a system database in a centralized way, so that the integrity and usability of the data are ensured.
When the multisource information data is processed, the quantitative transaction strategy model is constructed through data preprocessing, feature extraction and feature fusion. The structured data analyzes market trend through technical indexes, and the unstructured data analyzes emotion by calling a large model interface to extract market emotion characteristics. By means of a feature fusion method, such as splicing, adding and multiplying, the system can effectively fuse structured and unstructured data, and the prediction precision of a strategy model is improved, so that the decision process of quantitative transaction is optimized.
The invention also provides a quantitative transaction system fusing the multi-source information data, which aims to improve the prediction accuracy and the transaction income efficiency of the quantitative transaction system. The system comprises:
The core engine includes a main engine and an event engine. The event engine monitors the events in the system in real time and triggers corresponding operations through an event priority queue and a circulation processing mechanism, and combines data circulation and event driving logic to realize high-efficiency closed-loop management of strategy signal generation, data updating and transaction instruction execution and ensure the real-time performance and reliability of system response.
The service module comprises a service module, a core module and an interface module. The business module integrates data management, strategy generation, back detection, transaction execution and other modules to support the whole flow of a quantized transaction strategy, the core module is a core execution unit of the system and is responsible for executing specific operation according to the requirements of the functional module, the interface module comprises a plurality of sub-modules, the exchange interface is used for realizing interaction with an external exchange and supporting efficient market data receiving, transaction instruction transmission and state feedback, the data packet interface is connected with a plurality of data merchants through a standardized API and is used for downloading historical market data, financial reports and news data, and the large model interface is used for efficiently converting text data into structured data and realizing efficient fusion and management of diversified data.
And displaying a visual setting interface, wherein the interface provides an interactive bridge between a user and the system, the user can input configuration information through the interface, and the system intuitively feeds back a result on the interface. The main interface supports the connection of different exchange interfaces and data packet interfaces to realize buying and selling operation and real-time market data acquisition, and the data packet interfaces also support the reception of unstructured data such as market data, financial report data, news data and the like. The back measurement interface can set multi-source data and back measurement parameters, support historical verification of the strategy and visually present the back measurement result, and the strategy interface allows a user to configure the data source and the strategy running time, select actual transaction or simulated transaction and feed back the execution result in real time.
In the business module of the quantitative transaction system, the invention expands the functions which the quantitative transaction should have so as to improve the prediction accuracy and the transaction income efficiency of the quantitative transaction system. The function module comprises a data management module, a strategy module, a return detection module and a transaction module, wherein the data management module is used for receiving, storing and processing multi-source information from different data sources to ensure the effectiveness and timeliness of the data, the strategy module is used for constructing a prediction model according to defined data characteristics to generate transaction signals and conduct transaction risk management and control, the return detection module is used for carrying out return detection on a quantized transaction strategy by utilizing historical multi-source information data to evaluate the performance and effect of the strategy, and the transaction module is used for executing simulation transaction or actual transaction operation by utilizing real-time multi-source information data based on a return detection result and updating a transaction state in real time.
The invention successfully improves the construction and execution efficiency of the quantitative transaction strategy through the deep fusion of the multi-source information data and the application of the characteristic engineering. By introducing an event-driven mechanism and a high-efficiency back-testing algorithm, the technical threshold is reduced, and the prediction accuracy of the strategy and the benefit of actual transaction are obviously improved. Finally, the system realizes more accurate prediction while processing complex market information, has wide application potential, and can provide powerful support for investors in financial markets.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the embodiments of the present invention will be described in further detail with reference to the accompanying drawings. The exemplary embodiments of the present invention and their descriptions herein are for the purpose of explaining the present invention, but are not to be construed as limiting the invention.
The embodiment of the invention provides a quantitative transaction method for fusing multi-source information data, which is shown in fig. 1. The system receives and analyzes data through the data packet interface and the exchange interface, wherein the structured data comprises a driving price, a lowest price, a highest price, an exchange amount, a historical fluctuation rate and the like, and the unstructured data comprises a news text, social media emotion and the like. The system uses feature engineering to fuse the data, generates a high-dimensional feature vector for strategy prediction, and constructs transaction logic based on historical data and real-time data. And judging whether to execute the simulated transaction according to the return test result. If the simulated transaction is to be executed, setting the simulated operation time length, controlling the quantitative transaction strategy to execute the simulated transaction operation to obtain a simulated transaction result, and judging whether to execute the actual transaction according to the return test result. And if the actual transaction is to be executed, controlling the quantitative transaction strategy to execute the actual transaction operation to obtain an actual transaction result.
Based on the same inventive concept, the embodiment of the invention provides a quantitative transaction method combining multi-source information data processing. Fig. 2 shows a flow chart of the method, comprising the following steps:
S201, receiving multi-source information data in a quantized transaction strategy, wherein the multi-source information data at least comprises structured data (such as a drive price, a transaction amount and the like) and unstructured data (such as economic indexes, news texts and the like).
The data collection is performed by a user-friendly visualization tool, and the user can acquire historical data from a system data packet interface or upload the data to a data management module of the system. The real-time market data is used for simulating real-time transaction and real-disk transaction, wherein the structured data is acquired through a transaction exchange interface, and the unstructured data is acquired through a data packet interface.
As unstructured data includes, but is not limited to, economic indicators, industry analysis reports, macro-economic data, corporate financial reports, news texts, and the like. Therefore, in an alternative embodiment, the packet interface provided by the embodiment of the present invention may further include Tushare, aggregate width, IB penetration, wind, etc. All the data collected or uploaded by the user are finally stored in the SQLite database for unified management and quick call.
S202, carrying out data preprocessing, feature extraction and feature fusion on the multi-source information data, and generating a quantized transaction strategy model.
Specifically, the structured data analyzes future price trends via technical metrics. The data can be downloaded from the API of the data provider, or can be directly uploaded to the SQLite database of the system, and other structural data characteristics can be obtained through a technical index formula. The most widely used technical indicators in the market include MACD, KDJ, brin line (BOLL) and the like.
And the unstructured data is used for extracting text emotion by using the large model and the prompt words called in the system, and the text emotion is used for evaluating market signals.
The prompt word specifically means that all previous indications are forgotten. Suppose you are a financial expert with stock recommendation experience. The text answers good or bad for the stock price of the company name in a short period of time according to the text below.
In the emotion analysis process of unstructured data, the system inputs a text into a model API, calls a large model, and extracts emotion features influenced by stock price through the model. The method comprises the following steps of analyzing input text by a hypothesis model, generating a prediction result of the stock price of a target company, and judging the influence of the text on the short-term stock price. The system output "yes" indicates a positive effect, denoted as digital 2, "no" indicates a negative effect, denoted as digital 1, and "unknown" indicates an undeterminable, denoted as digital 0.
Based on feature sequences generated from structured and unstructured data, the embodiment of the invention provides several feature fusion methods, namely splicing different features directly to form new fusion features, adding, namely adding a plurality of feature graphs element by element to obtain a feature average value so as to reduce noise influence, multiplying, namely multiplying the plurality of feature graphs element by element, enhancing semantic information of the features and retaining details.
In order to further refine the process of constructing the policy model, the specific flow is shown in fig. 3:
The method comprises the steps of obtaining unstructured data, such as text data of economic indexes, news texts and the like, carrying out emotion polarity analysis by using a large model through calling a large model API interface which is well deployed in a system to obtain emotion feature sequences, simultaneously, calculating the corresponding feature sequences through calling corresponding technical index modules of the obtained structured data (such as a closing price, a opening price and transaction amount), splicing the emotion feature sequences and the technical index feature sequences to construct new feature data, and finally, analyzing the integrated feature sequences to construct a stock price prediction model.
In addition, because of the variety of unstructured data and structured data, a user needs to select required data in a designated policy interface so as to ensure the normal calling of the data and the smooth proceeding of subsequent model construction operation.
S203, historical multi-source information data are acquired, the quantitative transaction strategy model is used for carrying out feedback assessment, and a feedback result is generated. The specific steps include that corresponding market quotation data are obtained from the SQLite database according to the set return time period, and the corresponding market quotation data are input into the quantitative transaction strategy model in the S202 one by one through the message queue, and finally a return test result is obtained.
S204, judging whether to execute strategy transaction according to the back measurement result, acquiring real-time multi-source information data to simulate actual transaction or actual transaction, and generating transaction result.
Specifically, after the return test result meets the user requirement, the system starts a simulation transaction module, acquires market data from the exchange in real time and inputs the market data into a quantitative transaction strategy. Non-day data (e.g., the first two days of data) is used in the simulated transaction process to simulate the actual transaction process, but without involving actual funds manipulation. The system monitors the simulated transaction state according to the preset strategy running time, automatically stops the transaction when the set deadline is reached, and generates a simulated transaction result.
After both the return test result and the simulated transaction result meet the user requirements, the system starts the actual transaction function. Considering the randomness of market quotation data, even if the return and simulated transaction results are eligible, there may be a risk to the actual transaction. Therefore, the actual transaction result is transmitted to the visual interface in real time for the user to judge whether to continue or stop the transaction.
From the above, the quantitative transaction method for fusing the multi-source information data provided by the embodiment of the invention can realize the historical return, simulation transaction and actual transaction of the strategy. The method can rapidly verify whether the test result meets the condition and ensure that the strategy normally operates in the actual transaction, thereby improving the prediction precision and remarkably improving the yield of the actual transaction.
Based on the same inventive concept, an optional system architecture diagram of a quantitative transaction system based on multi-source information data is provided in an embodiment of the present invention, as shown in fig. 4. The quantized transaction system comprises three parts of a front end, a strategy construction layer and a strategy operation layer, wherein the data flow is referenced with the numbers in fig. 4:
The method comprises the steps of 1, configuring parameters such as data types, feature fusion methods and function selection and the like on a front-end interface by a user, 2, sending configuration information into a system, calling an API to obtain configured multi-source information data, 3, sending the obtained data into a strategy construction layer, and respectively carrying out feature processing on structured and unstructured data according to a configured processing method. The structured data are features of calculation technical indexes, unstructured data are sent into a large model to be subjected to emotion analysis, and finally a unified data set is generated through feature fusion, wherein the step 4 is that the system utilizes the generated data set to carry out model construction in a strategy generation module and designs transaction logic and risk control conditions based on model predicted values, the step 5 is that after the strategy construction is completed, a strategy operation layer calls a corresponding functional module in strategy starting configuration information to execute operations such as back detection, simulation transaction or actual transaction, the step 6 is that after the function operation is completed, the system transmits results to a strategy evaluation and visualization module to calculate final results, and the step 7 is that the final results are displayed on a front-end interface, and when the simulation transaction and the actual transaction are executed, the interface displays detailed information of transaction results, key indexes and strategy operation in real time.
Based on the same inventive concept, the embodiment of the invention provides a functional module of a quantitative transaction system based on multi-source information data. The principle of each module is similar to that of the quantized transaction strategy execution method, so that the implementation of the method can be referred to, and repeated parts are not repeated.
The embodiment of the invention provides a quantitative transaction system for fusing multisource information data, and fig. 5 is a schematic diagram of the system in the embodiment of the invention. The system includes an event engine, a host engine, and a service module.
The main engine is a core management module of the system and is responsible for managing and coordinating initialization and operation of different modules, and concretely comprises the steps of managing the modules in the system (such as functions, function engines, interfaces and the like), initializing and adding the different modules through methods such as add_app, add_engine, add_gateway and the like, and starting an event engine, namely, starting the event engine and ensuring that the event engine can process events in the system.
The event engine processes based on an event circulation architecture and supports timing tasks and asynchronous interaction so as to ensure real-time response and efficient processing of the system, and the core technology comprises the steps of timing task processing, namely generating timing events through a timer and asynchronously triggering the timing tasks through the event engine so as to ensure that the system can periodically execute related tasks, asynchronous event processing, namely adopting an event circulation mechanism and an asynchronous non-blocking architecture, enabling the processing of the events not to block other tasks of the system and supporting high-concurrency and low-delay event processing, and modular event processors, namely scheduling corresponding modules for different types of events (such as data subscription, transaction instructions and system alarms).
Meanwhile, the system function is perfected through the service module, and the method specifically comprises the following steps:
and the service module is used for completing main functions of the system by integrating the core modules such as data management, strategy generation, return test, transaction execution and the like. Comprising the following steps:
the data management module is in charge of receiving, storing and processing data from a plurality of data sources, ensuring the integrity, the effectiveness and the timeliness of the data, and providing historical data and real-time market data support required by policy execution and return test;
And the strategy module is used for constructing a prediction model according to the defined data characteristics, generating a transaction signal and controlling transaction risks. The module can automatically analyze market trend, output marketing signals and perform necessary risk early warning and loss stopping setting;
And the return testing module is used for returning the quantitative transaction strategy based on the historical data and evaluating the performance of the strategy under different market conditions. The return test result helps to optimize the strategy, and the success rate and the income performance in the actual transaction are improved;
and the transaction module is used for executing the simulation transaction and the actual transaction operation according to the transaction signal and the return result generated by the strategy module. The module can update the transaction state in real time, track the execution condition, communicate with the exchange and ensure the accurate and timely transmission of the transaction instruction;
And the core module is used for providing core services of the system, and the core module is used for providing specific functional support in the system according to the functions of the engine. Core services include, but are not limited to:
the order management system is responsible for processing the issuing and management of all transaction instructions and ensuring that the order can quickly respond to market dynamics;
The log system provides real-time running state tracking for developers and users, captures system errors and anomalies and provides powerful support for debugging and optimization;
the email notification module is used for reminding a user in time when offline or a major event occurs, and improving user experience and system transparency;
And the interface module is connected with an external API interface, and the part builds communication with the outside according to the function of the API. The multi-source information data required for the system may be obtained from the exchange API and the data provider. The exchange API also bears the communication of the exchange, realizes the ordering operation, acquires the authority of interacting with the large model from the model API, and performs text analysis on the unstructured data through the large model. Callable large models include GLM-4, prompt, claude2.1, and the like.
In order to reduce the technical threshold, the invention provides a visual setting interface through which a user can easily input quantitative transaction parameters. Thus, as an optional embodiment, before S201, the method for quantifying transaction policy execution provided in the embodiment of the present invention further includes displaying a visual setting interface, which specifically includes:
in the above-mentioned S201 and S202, the configuration information for executing the quantized transaction policies inputted by the user through the interface may be received, and in the above-mentioned S203 and S204, the output results of the transactions of different policies may be outputted at regular time or in real time.
Fig. 6, fig. 7, and fig. 8 are a main interface, a callback interface, and a policy interface according to an embodiment of the present invention. The main interface shown in fig. 6 includes a functional area for switching to other two interfaces and includes an account module (such as a data packet interface account, a simulated transaction account and a real disk transaction account) connected to an external interface for data acquisition, the callback interface shown in fig. 7 provides a button for quickly adjusting a policy code, after a user configures a callback parameter, the user can start the callback with one key, and the result is displayed in a result display area and a visual display area, and the policy interface shown in fig. 8 is focused on simulating actual transaction and actual transaction functions. Before executing a policy, a user needs to configure relevant parameters of the policy, such as data selection, runtime, and other policy parameters.
The three visual interfaces in the embodiment respectively bear different functions, namely a main interface is used for external connection, a return test interface supports policy return test by using historical data, and a policy interface is used for executing simulated actual transaction or actual transaction.
The method and the system can realize strategy return measurement, simulated transaction and real disc transaction through the preselected multi-source information data, quickly verify the feasibility of the strategy, improve the reliability of the strategy, reduce the risk of the transaction, and further effectively improve the yield of the real disc transaction.
In summary, the embodiment of the invention provides a quantitative transaction method and a quantitative transaction system for fusing multi-source information data. By pre-selecting the needed multi-source information data, strategy return, simulation transaction and actual transaction can be realized, the feasibility of the strategy is rapidly checked, the reliability of the strategy is improved, and the transaction risk is reduced. The above embodiments are merely illustrative of the preferred embodiments of the present invention, and the scope of the present invention is not limited thereto, but various modifications and improvements made by those skilled in the art to which the present invention pertains are made without departing from the spirit of the present invention, and all modifications and improvements fall within the scope of the present invention as defined in the appended claims.