Power transaction method and device, storage medium and computer equipment

By receiving the transaction signals predicted by historical data in the high-frequency power market trading system and combining real-time data, dynamic decision-making rules are used to generate the optimal order quantity, which solves the problem of insufficient response speed and decision-making accuracy of the existing system, and achieves more efficient and accurate transaction execution and maximizes returns.

CN120031603APending Publication Date: 2025-05-23FOSHAN POWER SUPPLY BUREAU GUANGDONG POWER GRID +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510176840.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-18
Publication Date
2025-05-23

AI Technical Summary

Technical Problem

When facing a complex market environment, the existing high-frequency power market trading system has insufficient response speed and decision-making accuracy, making it difficult to meet the demand for millisecond response, resulting in the inability to trade at the best price at the best time, reducing transaction returns and increasing risks.

Method used

By receiving power trading signals based on historical data predictions, and combining real-time trading data and trading parameters, dynamic decision rules are used to generate the optimal order quantity for each power exchange at each time, optimizing transaction costs, slippage and liquidity unused costs, while taking into account constraints such as total order quantity, slippage limit, liquidity utilization rate and time execution.

Benefits of technology

It improves the accuracy and efficiency of transaction execution, reduces transaction delays caused by market fluctuations, ensures transactions at the optimal price under favorable market conditions, improves the stability of transaction prices, ultimately maximizes returns, and effectively reduces delays and market risks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120031603A_ABST
    Figure CN120031603A_ABST
Patent Text Reader

Abstract

According to the electricity transaction method provided by the invention, a transaction signal is received, and the transaction signal is generated according to predicted electricity transaction data of historical electricity transaction data; according to the transaction signal, the real-time power transaction data and the transaction parameters are utilized, based on a preset objective function and a preset constraint condition, the optimal order quantity of each power exchange at each time is generated by adopting a preset dynamic decision rule, the preset objective function is used for minimizing the transaction cost, the slip point and the mobility unused cost, and the slip point and the mobility unused cost are used for minimizing the slip point and the mobility unused cost; the preset constraint conditions comprise a total order quantity constraint, a sliding point limitation constraint, a mobility utilization rate constraint and a time execution constraint; and distributing each power transaction order according to the optimal order quantity of each power transaction exchange at each time, and adjusting each power transaction order according to the risk of each power transaction order and a preset loss and profit stopping rule. Therefore, the transaction income is increased, and the risk can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of power market transactions, and in particular to a power transaction method, device, storage medium and computer equipment. Background Art

[0002] With the rapid development of the power market and the increase in trading frequency, high-frequency trading plays an increasingly important role in the power market. High-frequency trading requires the system to complete massive data processing, trading decisions and execution in a very short time, which places extremely high demands on the real-time, accuracy and stability of the system.

[0003] Existing high-frequency power market trading systems mostly use traditional trading decision models and centralized data processing architectures. However, in the face of complex market environments, the system's response speed and decision accuracy are insufficient, making it difficult to meet the needs of millisecond-level responses. On the one hand, the system lacks efficient parallel computing and distributed processing capabilities, resulting in computing bottlenecks when processing real-time large-scale data, delaying the generation of trading signals. On the other hand, multiple synchronizations and conversions during data transmission bring about significant transmission delays, further affecting the overall performance of the system.

[0004] Therefore, it is difficult for existing systems to achieve efficient and accurate transaction execution, resulting in the inability to execute trading signals at the best time and at the best price. This not only reduces trading returns but may also increase risks. Summary of the invention

[0005] The purpose of this application is to solve at least one of the above-mentioned technical defects, especially the technical defects in the prior art that not only reduce transaction returns but also may increase risks.

[0006] In a first aspect, the present application provides an electricity trading method, the method comprising:

[0007] receiving a trading signal, where the trading signal is generated based on predicted power trading data of historical power trading data;

[0008] According to the trading signals, using real-time power trading data and trading parameters, based on the preset objective function and preset constraints, the preset dynamic decision rules are adopted to generate the optimal order volume of each power exchange at each time, wherein the preset objective function is used to minimize the transaction cost, slippage and liquidity unutilized cost, and the preset constraints include the total order volume constraint, slippage limit constraint, liquidity utilization constraint and time execution constraint;

[0009] Allocate each power trading order according to the optimal order volume of each power exchange at each time, and adjust each power trading order according to the risk of each power trading order and the preset stop loss and take profit rules.

[0010] In one embodiment, the process of generating a trading signal includes:

[0011] Obtaining predicted power trading data of historical power trading data, and determining a trading strategy corresponding to the predicted power trading data;

[0012] Analyze and predict electricity trading data to identify changing trends in electricity trading, and generate trading signals based on changing trends in electricity trading and trading strategies.

[0013] In one embodiment, the step of obtaining predicted power transaction data of historical power transaction data includes:

[0014] Obtain historical power transaction data and perform time series preprocessing on the historical power transaction data;

[0015] The preprocessed historical power transaction data is input into the LSTM model to obtain the predicted power transaction data.

[0016] In one embodiment, the preset objective function is:

[0017]

[0018] in, represents the volume of orders executed on exchange i at time t, represents the slippage on exchange i at time t, represents the fee rate of exchange i, represents the liquidity utilization rate at time t, represents the liquidity weight coefficient, represents the volume of orders executed on exchange i, Represents exchange i.

[0019] In one embodiment, the preset constraints include:

[0020] Total order quantity constraints:

[0021]

[0022] Slippage Limit Constraints:

[0023]

[0024] Liquidity utilization constraints:

[0025]

[0026] Time execution constraints:

[0027]

[0028] in, Indicates the total amount of orders to be executed. Indicates the tolerable slippage range, Indicates the slippage in the tth time period.

[0029] In one embodiment, the preset dynamic decision rules include:

[0030] Time allocation rules:

[0031]

[0032] Exchange selection rules:

[0033]

[0034] Order adjustment rules:

[0035]

[0036] in, represents the order volume executed at time t, T represents the total length of time, represents the volatility weight coefficient, represents the market price volatility in the t-th time period, represents the optimal exchange selected at time t, represents the liquidity of the ith exchange, Indicates the liquidity utilization ratio.

[0037] In one embodiment, the preset stop loss and stop profit rules are:

[0038]

[0039] in, represents the current market price, Indicates the stop loss price, , Indicates the transaction entry price, Indicates the stop loss ratio. Indicates the take-profit price, , Indicates the take-profit ratio.

[0040] In a second aspect, the present application provides an electricity trading device, the device comprising:

[0041] A transaction signal receiving module, used to receive a transaction signal, where the transaction signal is generated based on predicted power transaction data of historical power transaction data;

[0042] A dynamic decision module, for generating the optimal order quantity of each power exchange at each time by using real-time power trading data and trading parameters according to trading signals, based on preset objective functions and preset constraints, and adopting preset dynamic decision rules, wherein the preset objective function is used to minimize transaction costs, slippage and liquidity unutilized costs, and the preset constraints include total order quantity constraints, slippage limit constraints, liquidity utilization constraints and time execution constraints;

[0043] The risk control module is used to allocate each power trading order according to the optimal order volume of each power exchange at each time, and adjust each power trading order according to the risk of each power trading order and the preset stop loss and take profit rules.

[0044] In a third aspect, the present application provides a storage medium: the storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of any one of the electricity trading methods in the above embodiments.

[0045] In a fourth aspect, the present application provides a computer device, comprising: one or more processors, and a memory;

[0046] The memory stores computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the steps of any of the electricity trading methods in the above embodiments are performed.

[0047] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:

[0048] In the power trading method provided by the present application, by receiving the power trading signal predicted based on historical data, and combining the real-time trading data and trading parameters, the optimal order volume is generated by adopting dynamic decision rules. The process minimizes the transaction cost, slippage and unused liquidity cost through the preset objective function, and considers the constraints such as the total order volume, slippage limit, liquidity utilization rate and time execution. Through multi-dimensional optimization, it ensures that the transaction does not exceed the market capacity and liquidity limit, and avoids the excessive impact of large orders on the market price, thereby reducing the additional costs caused by slippage and insufficient liquidity, and improving the accuracy and efficiency of transaction execution. At the same time, it also reduces the transaction delay caused by market fluctuations, ensures that the transaction is completed at the best price under favorable market conditions, thereby improving the stability of the transaction price and ultimately maximizing the profit. In addition, the transaction orders are accurately allocated according to the optimal order volume, and the orders are adjusted according to the stop-profit and stop-loss rules to ensure that the transaction is completed at the best time and the best price. The stop-profit and stop-loss mechanism can flexibly respond to market fluctuations, lock in profits in time and limit potential losses, avoid missing trading opportunities or losses due to delayed execution, and further improve the execution efficiency and risk management capabilities of the transaction. In this way, not only the efficiency of transaction execution is improved, but also delays and market risks are effectively reduced, ultimately increasing profits and reducing potential losses due to market fluctuations, thereby ensuring the security of transactions and the stability of profits. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. 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 paying creative labor.

[0050] Figure 1 A schematic diagram of a flow chart of a power trading method provided in an embodiment of the present application;

[0051] Figure 2 A schematic diagram of the structure of a power trading device provided in an embodiment of the present application;

[0052] Figure 3 A schematic diagram of the internal structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

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

[0054] The present application provides a method for power trading. The following embodiments are described by taking the method applied to a computer device as an example. It can be understood that the computer device can be any device with data processing functions, including but not limited to a single server, a server cluster, a personal laptop, a desktop computer, etc. Figure 1 As shown, the present application provides a chat corpus annotation method, the method comprising:

[0055] S101: Receive a transaction signal, where the transaction signal is generated based on predicted power transaction data of historical power transaction data.

[0056] Among them, trading signals are indicative signals that predict possible future power trading activities after analyzing and modeling historical power trading data. It contains decision instructions for buying, selling or holding, which are used to guide trading behavior. Historical power trading data refers to the transaction records in the power market over the past period of time, including information such as the time, price, and quantity of transactions, which are used to analyze market behavior patterns and trends. Predicted power trading data is to model and calculate historical power trading data, use algorithms to predict future power market trading trends and price trends, and provide a basis for subsequent trading decisions.

[0057] In this step, first, the historical transaction data of the power market is obtained, and through data processing and analysis algorithms, the historical data is converted into data that can be used to predict future power transactions, and possible future trading signals can be generated based on the data. For example, in certain periods of large market fluctuations, based on historical data analysis, it may be predicted that the market will have a price increase trend, and then a buy trading signal will be generated. On the contrary, in the case of unstable market prices, a sell or hold signal may be generated to avoid risks. In this way, not only can trading signals be automatically received and processed, but market changes can also be quickly responded to and support trading decisions.

[0058] It can be understood that by receiving power trading signals predicted based on historical data, the efficiency and accuracy of trading decisions can be effectively improved. First, the prediction of historical power trading data can identify potential market trends and fluctuations, which makes trading signals more accurate; second, automated signal reception and processing can respond to market changes in real time; based on this, the stability and profitability of transactions can be improved, while reducing risks caused by misjudgment or information lag, thereby providing more efficient and accurate trading support.

[0059] S102: According to the trading signal, using real-time power trading data and trading parameters, based on the preset objective function and preset constraints, the preset dynamic decision rules are adopted to generate the optimal order volume for each power exchange at each time, wherein the preset objective function is used to minimize transaction costs, slippage and liquidity unutilized costs, and the preset constraints include total order volume constraints, slippage limit constraints, liquidity utilization constraints and time execution constraints.

[0060] Among them, real-time power trading data refers to the instant trading information obtained from the power market during the current time, including the trading volume, price, supply and demand of power, etc., reflecting the real-time situation of the market. Trading parameters are specific parameters used to determine trading decisions, including but not limited to price, order size, trading time window, etc. The preset objective function is a mathematical function used to evaluate the pros and cons of different strategies in the trading decision-making process, aiming to minimize or maximize certain goals, such as transaction costs, slippage, liquidity, etc. The preset constraints are the restrictions defined in the trading decision, including the total order volume, slippage, liquidity utilization, etc., which ensure that the execution of transactions does not violate market rules or lead to excessive risks. The preset dynamic decision rules refer to the trading decision rules dynamically generated based on the objective function and constraints under certain conditions. The optimal order volume refers to the number of orders that can achieve the goals of minimizing transaction costs, reducing slippage, optimizing liquidity, etc. under given constraints.

[0061] In this step, first, real-time power trading data is received, including market price fluctuations, trading volume changes, and supply and demand balance information. Then, the dynamic decision algorithm is started in combination with preset trading parameters, such as the total order volume cap, risk preference, and trading frequency. The algorithm is guided by the preset objective function and optimizes the trading strategy by minimizing transaction costs, slippage, and unused liquidity costs. At the same time, it strictly follows the preset constraints, including total order volume constraints, slippage limit constraints, liquidity utilization constraints, and time execution constraints, to ensure the compliance of trading behavior and risk controllability.

[0062] It should be noted that minimizing transaction costs means optimizing trading strategies, choosing appropriate trading times and trading volumes, reducing unnecessary expenses, and thus improving the overall benefits of trading. Minimizing slippage means optimizing trading execution strategies, reducing the impact of market shocks and price fluctuations on trading, and ensuring that trading instructions can be traded at prices close to expectations. Minimizing the cost of unused liquidity means optimizing trading strategies to ensure that trading opportunities are fully utilized within the scope allowed by market liquidity, and avoiding trading delays or opportunity losses caused by insufficient liquidity. The total order volume constraint is used to control the size of transactions to avoid market shocks or failure to achieve expected returns due to orders that are too large or too small. The slippage limit constraint is used to control the risk of transaction execution. By setting slippage limits, traders can avoid excessive losses caused by excessive market fluctuations. The liquidity utilization rate constraint is used to ensure that trading behavior does not put excessive pressure on market liquidity. The time execution constraint is used to ensure the timeliness of trading behavior.

[0063] In one example, in a specific electricity trading scenario, suppose there is a short-term imbalance between supply and demand in the market, resulting in large price fluctuations. Then the order volume can be adjusted according to real-time data, and the optimal order volume can be quickly calculated through dynamic decision rules, while ensuring that the total order volume does not exceed the preset upper limit, the slippage is controlled within a reasonable range, and the transaction is completed within the specified time. This dynamic adjustment capability enables trading strategies to adapt to market changes and improve trading efficiency and profits.

[0064] It can be understood that the execution of dynamic decision-making rules according to preset objective functions and constraints is to achieve the best trading effect in the complex and ever-changing power trading market. By minimizing transaction costs, slippage and unused liquidity costs, the financial risks in the transaction process can be significantly reduced and the efficiency of capital use can be improved. At the same time, meeting the total order volume constraints, slippage limit constraints, liquidity utilization constraints and time execution constraints can ensure that trading behaviors comply with market rules and risk control requirements, and avoid potential losses caused by illegal operations. This dynamic decision-making method based on data-driven and rule-constrained can not only adapt to market fluctuations, but also maximize trading benefits while ensuring compliance, and improve the overall efficiency and stability of power trading.

[0065] S103: Allocate each power trading order according to the optimal order volume of each power exchange at each time, and adjust each power trading order according to the risk of each power trading order and the preset stop loss and take profit rules.

[0066] The preset stop loss and stop profit rules refer to the pre-set rules for controlling transaction risks and returns. The stop loss rule is used to limit the maximum loss, and the stop profit rule is used to lock in the profit.

[0067] In this step, the calculated optimal order volume is allocated to each power exchange. For example, if the optimal order volume is 1,000 MWh, the order volume is allocated to different exchanges according to the market situation and the liquidity of the exchange, such as 300 MWh to Exchange A, 400 MWh to Exchange B, and 300 MWh to Exchange C. Afterwards, a risk assessment is conducted on each allocated order, which may include analyzing market price fluctuations, market liquidity, and the difficulty of executing the order. For example, if the market price of an exchange fluctuates greatly, the risk level of the order will be increased. Then, according to the preset stop loss and take profit rules, the execution strategy of each order is dynamically adjusted. For example, if the risk of the order exceeds the preset threshold, the stop loss mechanism is triggered to reduce the order volume or suspend trading; if the order reaches the expected return, the take profit mechanism is triggered to lock in profits and adjust the order.

[0068] In one example, the optimal order volume for a power exchange is calculated to be 500 MWh in a specific time period. After allocating the order, it is found that the market price fluctuates greatly, and the risk assessment shows that the order risk is high. At this time, the order volume is reduced to 300 MWh according to the stop loss rule to reduce potential losses. If the price trend is good during the execution of the order and reaches the preset stop profit point, the profit is locked in and the order is adjusted, such as reducing the remaining order volume or completing the transaction in advance.

[0069] It can be understood that allocating power trading orders according to the optimal order volume and adjusting them according to risks and preset stop-loss and take-profit rules is to achieve efficient and robust trading operations in the complex and ever-changing power trading market. By accurately allocating order volumes, it is possible to ensure that trading behaviors meet market conditions and trading goals, avoid waste of resources and market shocks. At the same time, dynamically adjusting orders based on risk assessment can effectively control trading risks and prevent excessive losses caused by market fluctuations. In addition, the execution of preset stop-loss and take-profit rules can lock in profits and ensure the robustness of trading strategies. This dynamic adjustment and risk management method not only improves the flexibility and adaptability of transactions, but also reduces risks while ensuring profits, and improves the overall efficiency and stability of power trading.

[0070] In the above embodiments, by receiving the power trading signals predicted based on historical data, combining with real-time trading data and trading parameters, and adopting dynamic decision rules to generate the optimal order quantity, this process minimizes the trading cost, slippage, and unutilized liquidity cost through a preset objective function, while considering constraints such as the total order quantity, slippage limit, liquidity utilization rate, and time execution. Through multi-dimensional optimization, it ensures that the trading does not exceed the market capacity and liquidity limit, avoids large orders causing excessive impact on market prices, thereby reducing the additional costs brought by slippage and insufficient liquidity, improving the accuracy and efficiency of trade execution. At the same time, it also reduces the trading delay caused by market fluctuations, ensures execution at the optimal price under favorable market conditions, thereby improving the stability of the execution price, and ultimately maximizing the profit. In addition, the trading orders are accurately allocated according to the optimal order quantity, and the orders are adjusted in accordance with the stop-profit and stop-loss rules to ensure execution at the best timing and optimal price. The stop-profit and stop-loss mechanism can flexibly respond to market fluctuations, lock in profits in a timely manner and limit potential losses, avoid missing trading opportunities or incurring losses due to delayed execution, thereby further improving the execution efficiency and risk management ability of trading. In this way, not only the trading execution efficiency is improved, but also the delay and market risks are effectively reduced. Finally, the profit is increased and the potential losses brought by market fluctuations are reduced, thereby ensuring the security of trading and the stability of profit.

[0071] In one embodiment, the process of generating trading signals includes:

[0072] Obtain the predicted power trading data of historical power trading data and determine the trading strategy corresponding to the predicted power trading data;

[0073] Analyze the predicted power trading data to identify the changing trend of power trading, and generate trading signals based on the changing trend of power trading and the trading strategy.

[0074] Among them, the trading strategy refers to the trading plan formulated according to market analysis and objectives, including the timing of buying or selling, order quantity, stop-loss and stop-profit rules, etc. The changing trend of power trading refers to the development direction of the power trading market identified by analyzing the predicted data, such as price increase, decrease or fluctuation, etc.

[0075] Specifically, first, historical transaction data can be obtained from the power transaction database, which includes information such as transaction prices, transaction volumes, and supply and demand balances in the past period of time. Then, the historical data is processed using a data analysis model to generate predicted power transaction data for a period of time in the future. For example, the fluctuation range of electricity prices and changes in transaction volume in the next 24 hours may be predicted. Based on the predicted data, the corresponding trading strategy can be determined, including choosing the right trading time, such as buying at a low price and selling at a high price; setting stop-loss and take-profit rules, such as stop-loss when the price drops by more than a certain percentage, and stop-profit when the price rises to a certain percentage; allocating order volume, such as adjusting the order size according to market liquidity.

[0076] Further analysis is performed on the forecast data to identify the changing trends in the power trading market. For example, technical analysis tools are used to determine whether the price is in an upward trend, downward trend, or sideways trend. At the same time, macroeconomic data such as market supply and demand, seasonal factors, etc. can be combined to comprehensively determine the market trend. Finally, trading signals are generated based on the identified market trends and preset trading strategies. For example, if the forecast data shows that the price of electricity will rise in the next few hours and the market trend is an upward trend, a buy signal is generated; if the price is expected to fall, a sell signal is generated.

[0077] In one example, a trend-following strategy is selected as a trading strategy based on market conditions. In high-frequency power trading, when prices fluctuate greatly, the trend-following strategy can capture changes in price trends. The formula for the trend-following strategy is:

[0078]

[0079] in, is the change in electricity price at time t, and δ is the threshold for price change. If the price change exceeds the threshold, a buy signal (1) or a sell signal (-1) is generated.

[0080] In this embodiment, by acquiring historical data and generating forecast data, determining trading strategies, analyzing market trends and generating trading signals, the purpose is to achieve efficient and accurate trading decisions in the power trading market. Acquiring historical data and generating forecast data can provide a scientific basis for trading decisions and respond to market changes. Determining trading strategies can clarify trading directions and risk control measures to ensure that trading behaviors are in line with market expectations and risk preferences. Analyzing market trends and generating trading signals can further refine trading decisions and make trading operations more targeted and timely. Through this series of dynamic execution processes, opportunities can be seized in a complex and changing market environment, risks can be reduced, and trading efficiency and benefits can be improved.

[0081] In one embodiment, the step of obtaining predicted power transaction data of historical power transaction data includes:

[0082] Obtain historical power transaction data and perform time series preprocessing on the historical power transaction data;

[0083] The preprocessed historical electricity trading data is input into the LSTM model to obtain the predicted electricity trading data.

[0084] Among them, time series preprocessing refers to the process of cleaning, normalizing, and differentiating historical power trading data to make it suitable for time series analysis and modeling. The LSTM model (Long Short-Term Memory) is a special recurrent neural network (RNN) used to process time series data and can capture long-term dependencies.

[0085] Specifically, historical data can be obtained from the power trading database, which may include information such as hourly power trading prices, trading volumes, supply and demand balance, etc. For example, the data may record hourly power price fluctuations and trading volume changes over the past year. After obtaining the data, the historical power trading data is preprocessed in time series, including data cleaning, normalization, and difference processing. The preprocessed data is input into the LSTM model. The LSTM model generates predictions for future power transactions by learning patterns and trends in historical data. For example, the model may predict hourly power prices and demand in the next 24 hours.

[0086] In one example, the time series data of electricity prices has autocorrelation, so it is necessary to process the data to remove noise and fill in missing values. Time series preprocessing methods include Kalman filtering.

[0087] The formula of Kalman Filter is:

[0088]

[0089] in, is the predicted state, is the observation value, H is the observation matrix, is the Kalman gain. Kalman filtering can effectively remove noise and smooth data to obtain more accurate electricity price and demand forecasts.

[0090] In another example, the LSTM model includes a forget gate, an input gate, an output gate, a cell state update, and a hidden state. Specifically, the formula corresponding to the forget gate is: , the formula corresponding to the input gate is , the formula corresponding to the output gate is , the formula corresponding to the cell state update is , the formula corresponding to the hidden state is The prediction formula of LSTM is:

[0091]

[0092] in, represents the input data, namely the historical electricity demand, Represents the hidden state, storing the short-term and long-term dependencies of the time series, represents the output forecast value, that is, the future electricity demand, , , , , Represents the weights and biases of the network.

[0093] In this embodiment, historical power transaction data is obtained and time series preprocessing is performed to ensure that the data input to the LSTM model is of high quality and suitable for modeling. Data preprocessing can improve the training effect and prediction accuracy of the model. Inputting the preprocessed data into the LSTM model can fully utilize the model's processing ability for time series data, capture long-term dependencies and patterns in historical data, and generate accurate prediction results.

[0094] In one embodiment, the preset objective function is:

[0095]

[0096] in, represents the volume of orders executed on exchange i at time t, represents the slippage on exchange i at time t, represents the fee rate of exchange i, represents the liquidity utilization rate at time t, represents the liquidity weight coefficient, represents the volume of orders executed on exchange i, Represents exchange i.

[0097] in, , represents the total liquidity at time t. represents the slippage cost, represents the transaction fee, Represents the cost of unutilized liquidity.

[0098] Specifically, slippage cost refers to the difference between the actual transaction price and the expected price, multiplied by the order volume. Slippage is an inevitable phenomenon in market transactions, especially when liquidity is insufficient or the market is volatile. By minimizing slippage costs, price risks in the transaction execution process can be reduced. Transaction fees are fixed fee rates charged by exchanges, which are proportional to the order volume. By minimizing transaction fees, transaction costs can be reduced and transaction efficiency can be improved. Liquidity unutilization costs penalize behaviors that do not fully utilize liquidity, prompting trading strategies to make full use of market liquidity as much as possible and avoid transaction delays or opportunity losses caused by insufficient liquidity.

[0099] In this embodiment, the objective function optimizes the execution strategy of power trading by comprehensively considering slippage costs, transaction fees and unused liquidity costs. This multi-objective optimization method can effectively reduce transaction costs, improve transaction efficiency, reduce market risks, and increase overall returns. By dynamically adjusting order volume and trading strategies, the method can adapt to market changes and ensure the flexibility and robustness of trading behavior.

[0100] In one embodiment, the preset constraints include:

[0101] Total order quantity constraints:

[0102]

[0103] Slippage Limit Constraints:

[0104]

[0105] Liquidity utilization constraints:

[0106]

[0107] Time execution constraints:

[0108]

[0109] in, Indicates the total amount of orders to be executed. Indicates the tolerable slippage range, Indicates the slippage in the tth time period.

[0110] Specifically, the total order volume constraint ensures that the sum of the orders executed at all time points and on all exchanges is equal to the total number of orders to be executed, which means that the trading strategy must fully execute the predetermined trading tasks, no more and no less. The slippage limit constraint requires that at each time point and on each exchange, the actual slippage must not exceed the preset tolerable slippage range. The liquidity utilization constraint requires that at each time point, the liquidity utilization rate must not exceed 1, ensuring that the trading volume does not exceed the liquidity ceiling of the market at that time point, avoiding excessive impact on market prices. The time execution constraint requires that at each time point and on each exchange, the order volume must be non-negative, which means that the trading strategy cannot execute negative order volumes, that is, it cannot conduct transactions beyond the predetermined range.

[0111] In this embodiment, the constraints work together through different mechanisms to ensure that the power trading strategy can be executed efficiently and robustly in a complex and changing market environment. The total order quantity constraint ensures the integrity and consistency of the trading task; the slippage limit constraint controls the transaction cost and market risk and improves the predictability of the transaction; the liquidity utilization constraint avoids market shocks, reduces transaction costs, and enhances the sustainability of the transaction; the time execution constraint ensures the feasibility of the transaction behavior, avoids logical errors, and enhances the robustness of the strategy. The comprehensive application of these constraints can effectively reduce trading risks, improve trading efficiency, and ensure the long-term feasibility and adaptability of the trading strategy.

[0112] In one embodiment, the preset dynamic decision rules include:

[0113] Time allocation rules:

[0114]

[0115] Exchange selection rules:

[0116]

[0117] Order adjustment rules:

[0118]

[0119] in, represents the order volume executed at time t, T represents the total length of time, represents the volatility weight coefficient, represents the market price volatility in the t-th time period, represents the optimal exchange selected at time t, represents the liquidity of the ith exchange, Indicates the liquidity utilization ratio.

[0120] Specifically, the time allocation rule is used to allocate the total order volume to each time window, the exchange selection rule is used to dynamically select the optimal exchange at each time point, and the order adjustment rule is used to adjust the order volume on each exchange according to real-time liquidity. Furthermore, the iceberg order strategy can be used in the prediction dynamic decision rule to split large orders into multiple sub-orders and gradually release them to the market. This can not only avoid liquidity risks caused by excessive order volume.

[0121] In this embodiment, through dynamic optimization of time allocation, exchange selection and order adjustment, it is ensured that the power trading strategy can be executed efficiently and robustly in a complex and changing market environment. The time allocation rule can dynamically adjust the order volume by considering market volatility to adapt to changes in market activity; the exchange selection rule can reduce transaction costs and improve transaction efficiency by minimizing the sum of slippage and fees; the order adjustment rule can avoid liquidity risks and improve transaction efficiency by adjusting the order volume according to real-time liquidity.

[0122] In one embodiment, the preset stop loss and stop profit rules are:

[0123]

[0124] in, represents the current market price, Indicates the stop loss price, , Indicates the transaction entry price, Indicates the stop loss ratio. Indicates the take-profit price, , Indicates the take-profit ratio.

[0125] Specifically, if the current price is less than or equal to the stop loss price, the stop loss is triggered; if the current price is greater than or equal to the take profit price, the take profit is triggered; if the current price does not meet either the stop loss or take profit conditions, no action is taken. Furthermore, in order to optimize fund management and maximize long-term growth, the Kelly Criterion can be introduced as part of the risk control strategy. The Kelly Criterion formula is ,in, is the capital allocation ratio for each transaction, p is the probability of winning the transaction, and q is the probability of losing the transaction.

[0126] In this embodiment, the stop loss and stop profit rules provide an effective risk control and capital protection mechanism. By setting reasonable stop loss and stop profit levels, you can adjust or exit transactions in time when the market fluctuates, avoid excessive losses, lock in profits, improve transaction efficiency, and adapt to market changes.

[0127] The following describes the power trading device provided in the embodiment of the present application. The power trading device described below and the power trading method described above can be referred to in correspondence with each other. Figure 2 As shown, the present application provides an electric power trading device, the device comprising:

[0128] A transaction signal receiving module 201 is used to receive a transaction signal, where the transaction signal is generated based on predicted power transaction data of historical power transaction data;

[0129] A dynamic decision module 202, for generating the optimal order quantity of each power exchange at each time by using real-time power trading data and trading parameters according to the trading signal, based on a preset objective function and preset constraints, and adopting a preset dynamic decision rule, wherein the preset objective function is used to minimize transaction costs, slippage and liquidity unutilized costs, and the preset constraints include order quantity constraints, slippage limit constraints, liquidity utilization constraints and time execution constraints;

[0130] The risk control module 203 is used to allocate each power trading order according to the optimal order volume of each power exchange at each time, and adjust each power trading order according to the risk of each power trading order and the preset stop loss and take profit rules.

[0131] In one embodiment, the transaction signal receiving module 201 includes:

[0132] A predicted power transaction data acquisition unit, used to acquire predicted power transaction data of historical power transaction data and determine a transaction strategy corresponding to the predicted power transaction data;

[0133] The trading signal generating unit is used to analyze and predict the power trading data to identify the changing trend of power trading, and generate trading signals according to the changing trend of power trading and trading strategies.

[0134] In one embodiment, the predicted power transaction data acquisition unit includes:

[0135] A historical power transaction data acquisition subunit is used to acquire historical power transaction data and perform time series preprocessing on the historical power transaction data;

[0136] The predicted power transaction data acquisition subunit is used to input the preprocessed historical power transaction data into the LSTM model to obtain the predicted power transaction data.

[0137] In one embodiment, the preset objective function is:

[0138]

[0139] in, represents the volume of orders executed on exchange i at time t, represents the slippage on exchange i at time t, represents the fee rate of exchange i, represents the liquidity utilization rate at time t, represents the liquidity weight coefficient, represents the volume of orders executed on exchange i, Represents exchange i.

[0140] In one embodiment, the preset constraints include:

[0141] Total order quantity constraints:

[0142]

[0143] Slippage Limit Constraints:

[0144]

[0145] Liquidity utilization constraints:

[0146]

[0147] Time execution constraints:

[0148]

[0149] in, Indicates the total amount of orders to be executed. Indicates the tolerable slippage range, Indicates the slippage in the tth time period.

[0150] In one embodiment, the preset dynamic decision rules include:

[0151] Time allocation rules:

[0152]

[0153] Exchange selection rules:

[0154]

[0155] Order adjustment rules:

[0156]

[0157] in, represents the order volume executed at time t, T represents the total length of time, represents the volatility weight coefficient, represents the market price volatility in the t-th time period, represents the optimal exchange selected at time t, represents the liquidity of the ith exchange, Indicates the liquidity utilization ratio.

[0158] In one embodiment, the preset stop loss and stop profit rules are:

[0159]

[0160] in, represents the current market price, Indicates the stop loss price, , Indicates the transaction entry price, Indicates the stop loss ratio. Indicates the take-profit price, , Indicates the take-profit ratio.

[0161] In one embodiment, the present application also provides a storage medium, in which computer-readable instructions are stored. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the electricity trading method as described in any of the above embodiments.

[0162] In one embodiment, the present application also provides a computer device having computer-readable instructions stored therein. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the electricity trading method as described in any one of the above embodiments.

[0163] Indicatively, if Figure 3 As shown, Figure 3 This is a schematic diagram of the internal structure of a computer device provided in an embodiment of the present application. The computer device 300 may be provided as a server. Figure 3 The computer device 300 includes a processing component 302, which further includes one or more processors, and a memory resource represented by a memory 301 for storing instructions executable by the processing component 302, such as an application. The application stored in the memory 301 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 302 is configured to execute instructions to perform the power trading method of any of the above embodiments.

[0164] The computer device 300 may further include a power supply component 303 configured to perform power management of the computer device 300, a wired or wireless network interface 304 configured to connect the computer device 300 to a network, and an input / output (I / O) interface 305. The computer device 300 may operate based on an operating system stored in the memory 301, such as Windows Server TM, Mac OS X TM, Unix TM, Linux TM, Free BSD TM, or the like.

[0165] Those skilled in the art will understand that Figure 3 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0166] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the term "include", "comprise" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements not only includes those elements, but also includes other elements not clearly listed, or also includes elements inherent to such process, method, article or equipment. In the absence of more restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or equipment including the elements. Herein, "one", "one", "said", "the" and "it" may also include plural forms, unless the context clearly indicates another way. A plurality refers to at least two cases, such as 2, 3, 5 or 8, etc. "And / or" includes any and all combinations of the relevant listed items.

[0167] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can refer to each other.

[0168] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for power trading, characterized in that: The method comprises: receiving a transaction signal, wherein the transaction signal is generated based on predicted power transaction data of historical power transaction data; According to the transaction signal, using real-time power transaction data and transaction parameters, based on a preset objective function and preset constraints, a preset dynamic decision rule is adopted to generate the optimal order volume of each power exchange at each time, wherein the preset objective function is used to minimize transaction costs, slippage and liquidity unutilized costs, and the preset constraints include total order volume constraints, slippage limit constraints, liquidity utilization rate constraints and time execution constraints; Allocate each power trading order according to the optimal order volume of each power exchange at each time, and adjust each power trading order according to the risk of each power trading order and the preset stop loss and take profit rules.

2. The power trading method according to claim 1, characterized in that: The process of generating the trading signal includes: Acquire predicted power transaction data of the historical power transaction data, and determine a transaction strategy corresponding to the predicted power transaction data; The predicted power trading data is analyzed to identify the power trading change trend, and the trading signal is generated according to the power trading change trend and the trading strategy.

3. The power trading method according to claim 2, characterized in that: The step of obtaining the predicted power transaction data of the historical power transaction data comprises: Acquiring the historical power transaction data, and performing time series preprocessing on the historical power transaction data; The preprocessed historical electricity transaction data is input into the LSTM model to obtain the predicted electricity transaction data.

4. The power trading method according to claim 1, characterized in that: The preset objective function is: in, represents the volume of orders executed on exchange i at time t, represents the slippage on exchange i at time t, represents the fee rate of exchange i, represents the liquidity utilization rate at time t, represents the liquidity weight coefficient, represents the volume of orders executed on exchange i, Represents exchange i.

5. The power trading method according to claim 4, characterized in that: The preset constraints include: The order quantity constraint is: The slippage limit constraints are: The liquidity utilization constraint is: The time execution constraints are: in, Indicates the total amount of orders to be executed. Indicates the tolerable slippage range, Indicates the slippage in the tth time period.

6. The power trading method according to claim 5, characterized in that: The preset dynamic decision rules include: Time allocation rules: Exchange selection rules: Order adjustment rules: in, represents the order volume executed at time t, T represents the total length of time, represents the volatility weight coefficient, represents the market price volatility in the t-th time period, represents the optimal exchange selected at time t, represents the liquidity of the ith exchange, Indicates the liquidity utilization ratio.

7. The power trading method according to claim 1, characterized in that: The preset stop loss and take profit rules are: in, represents the current market price, Indicates the stop loss price, , Indicates the transaction entry price, Indicates the stop loss ratio. Indicates the take-profit price, , Indicates the take-profit ratio.

8. An electric power trading device, characterized in that: The device comprises: A transaction signal receiving module, used to receive a transaction signal, wherein the transaction signal is generated based on predicted power transaction data of historical power transaction data; A dynamic decision module, for generating the optimal order quantity of each power exchange at each time by using the real-time power trading data and trading parameters according to the trading signal, based on a preset objective function and preset constraints, and adopting a preset dynamic decision rule, wherein the preset objective function is used to minimize transaction costs, slippage and liquidity unutilized costs, and the preset constraints include order quantity constraints, slippage limit constraints, liquidity utilization constraints and time execution constraints; The risk control module is used to allocate each power trading order according to the optimal order volume of each power exchange at each time, and adjust each power trading order according to the risk of each power trading order and the preset stop loss and take profit rules.

9. A storage medium, characterized in that: The storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the power trading method according to any one of claims 1 to 7.

10. A computer device, characterized in that: include: one or more processors, and memory; The memory stores computer-readable instructions, and when the computer-readable instructions are executed by the one or more processors, the steps of the power trading method according to any one of claims 1 to 7 are performed.