Self-transaction judgment method for futures counter

By calculating the contract limit price difference and the minimum order price preallocated memory blocks and recording the highest bid and sale price, the problems of low efficiency, uncontrollable memory and high maintenance costs in the traditional self-transaction judgment method are solved, and efficient and stable self-transaction judgment is achieved.

CN120471708APending Publication Date: 2025-08-12ACCELECOM INFORMATION & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510362786.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-26
Publication Date
2025-08-12

AI Technical Summary

Technical Problem

The traditional self-transaction judgment method has low efficiency, uncontrollable memory usage and high maintenance costs, which affects the stability of the system.

Method used

By calculating the contract limit spread and minimum order price, pre-allocate fixed memory blocks, record the highest bid price and lowest selling price, and use the price quick index to make self-transaction judgments.

Benefits of technology

It improves the efficiency of self-transaction judgment, reduces memory usage and maintenance costs, and ensures system stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120471708A_ABST
    Figure CN120471708A_ABST
Patent Text Reader

Abstract

The invention provides a self-transaction judgment method for a futures counter, and the method comprises the steps: S01, enabling the counter to obtain contract information, and dividing the difference value of rise and fall prices of a contract by the minimum report price of the contract, thereby obtaining the number of price units which can be reported by the contract; and step S02: pre-allocating a memory, calculating the quantity of quotable prices according to the rise and fall price range and the minimum price change unit of the contract, and pre-allocating a memory block with a fixed size for each investor of each contract. And step S03, applying for a required memory space for the contract, and recording the highest buying price and the lowest selling price of the contract at the same time for judgment of self-transaction risk control. Step S04, self-transaction judgment: for the selling order, checking whether the current order reporting price is lower than the highest buying price or not during order reporting; and for whether the payment bill and the report bill are higher than the lowest selling price, if conditions are met, self-transaction is judged, and a self-transaction risk alarm or order interception is triggered. The self-transaction judgment method provided by the invention is high in efficiency and low in maintenance cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of financial futures counters, and in particular to a method for judging self-trading of futures counters. Background Art

[0002] In financial trading systems, self-trading refers to the simultaneous execution of opposite buy and sell orders by the same investor on the same contract. Self-trading can disrupt market order, so regulators typically require trading systems to monitor and intercept such behavior in real time. Traditional methods for determining self-trading suffer from the following issues: 1. Low efficiency: They require real-time traversal of the order book's buy and sell queues to calculate the probability of price crossovers, resulting in high latency in high-frequency scenarios. 2. Uncontrollable memory usage: Dynamic memory allocation can lead to fragmentation, impacting system stability. 3. High maintenance costs: Frequent updates of the highest bid and lowest ask prices are required during price fluctuations, resulting in high computational complexity. Summary of the Invention

[0003] 1. Technical problems to be solved: Traditional self-trading judgment methods have problems such as unpredictable memory usage, low price matching retrieval efficiency, and complex calculations for dynamically maintaining the highest / lowest prices.

[0004] 2. Technical solution: In order to solve the above problems, the present invention provides a method for determining self-trading of a futures counter, comprising the following steps: Step S01: The OTC obtains contract information and divides the difference between the contract's upper and lower limit prices by the contract's minimum order price to obtain the number of price units that can be quoted for the contract.

[0005] Step S02: Memory pre-allocation: Calculate the available quotation quantity based on the contract's price limit range and minimum price change unit, and pre-allocate a fixed-size memory block for each investor of each contract.

[0006] Step S03: Apply for the required memory space for the contract and record the highest buy price and lowest sell price of the contract for self-trading risk control judgment.

[0007] Step S04: Self-filled order determination: For sell orders, the system checks whether the current order price is lower than the highest buy price when placing an order; for buy orders, the system checks whether the order price is higher than the lowest sell price. If the conditions are met, the order is determined to be a self-filled order, triggering a self-filled order risk alert or order blocking.

[0008] In step S02, the memory block size is 4 bytes × Ticks × Contract Quantity × Investor Quantity, where 4 bytes are the unfulfilled buy quantity and unfulfilled sell quantity of the price in the contract information obtained by the OTC, and each field is 2 bytes.

[0009] Between step S04 and step S03, there is a step of maintaining the highest bid price / lowest ask price. Specifically, when the order is first submitted, the price is recorded as the highest bid price or the lowest ask price. When subsequent orders are submitted, the highest bid price or the lowest ask price is updated by comparison. When the order is executed or cancelled, if the transaction quantity at a certain price returns to zero, a local scan of the new highest bid price or the lowest ask price is triggered. The local scan is the range from the highest bid price to the lowest ask price of the current contract.

[0010] Before the highest bid / lowest ask price maintenance step, a quick price indexing step is provided. Specifically, the price is converted into an array subscript using the formula: subscript = (current price - limit price) / minimum order price. The memory location is directly located through the subscript, and read and write operations do not require traversal.

[0011] In step S04, if it is determined that it is not a self-trade, the array index is found by dividing the price by the minimum order price, the corresponding quantity is updated according to the array index and the transaction direction, and then it is determined whether the highest bid price or the lowest ask price needs to be updated.

[0012] 3.Beneficial effects: The self-trading judgment method for futures counters provided by the present invention is highly efficient: there is no need to traverse the buy and sell queues in the order book in real time to calculate the probability of price crossing, and the latency is low in high-frequency scenarios; the memory usage is controllable: it does not cause fragmentation and affect system stability; the maintenance cost is low: there is no need to frequently update the highest bid and lowest ask prices when prices fluctuate, and the calculation complexity is low.

[0013] Calculating the probability of price crossovers results in high latency in high-frequency scenarios. 2. Uncontrollable memory usage: Dynamic memory allocation can lead to fragmentation, impacting system stability. 3. High maintenance costs: Frequent updates of the highest bid and lowest ask prices are required when prices fluctuate, which increases computational complexity. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 It is a flow chart of the present invention. DETAILED DESCRIPTION

[0015] The present invention is described in detail below with reference to the accompanying drawings and embodiments.

[0016] like Figure 1 As shown, a method for determining self-trading of a futures counter is characterized by comprising the following steps: Step S01: The OTC obtains contract information and divides the difference between the contract's upper and lower limit prices by the contract's minimum order price to obtain the number of price units that can be quoted for the contract.

[0017] Step S01 cleverly utilizes the properties of the contract itself and obtains the array size based on the price limit and the minimum quotation unit. It can allocate memory space in advance and provide an operational basis for subsequent operations.

[0018] Step S02: Memory pre-allocation: Calculate the available quotation quantity based on the contract's price limit range and minimum price change unit, and pre-allocate a fixed-size memory block for each investor of each contract.

[0019] Step S03: Apply for the required memory space for the contract and record the highest buy price and lowest sell price of the contract for self-trading risk control judgment.

[0020] Step S04: Self-filled order determination: For sell orders, the system checks whether the current order price is lower than the highest buy price when placing an order; for buy orders, the system checks whether the order price is higher than the lowest sell price. If the conditions are met, the order is determined to be a self-filled order, triggering a self-filled order risk alert or order blocking.

[0021] In one embodiment, in step S02, using a price limit range of 100-200 yuan as an example, the quoteable quantity digit 101 is calculated based on the price limit range and the minimum price increment for the contract. A fixed-size memory block is pre-allocated for each investor for each contract. The size is 4 bytes × ticks × number of contracts × number of investors. The 4 bytes represent the unfulfilled buy quantity and unfulfilled sell quantity at that price, with each field containing 2 bytes.

[0022] In one embodiment, a step for maintaining the highest bid price / lowest ask price is provided between step S04 and step S03. Specifically, the price recorded as the highest bid price or lowest ask price is used for the initial order submission. For subsequent orders, the highest bid price or lowest ask price is updated through comparison. When an order is executed or cancelled, if the quantity at a certain price reaches zero, a local scan is triggered to update the highest bid price or lowest ask price.

[0023] In one embodiment, the local portion is the range from the highest buying price to the lowest selling price of the current contract.

[0024] In one embodiment, a quick price index is implemented before the highest bid / lowest ask price maintenance step. Specifically, the price is converted into an array index using the formula: index = (current price - limit price) / minimum order price. This index directly locates the memory location, eliminating the need for traversal for read and write operations.

[0025] Although the present invention has been disclosed above in terms of preferred embodiments, they are not intended to limit the present invention. Anyone skilled in the art can make various changes or modifications without departing from the spirit and scope of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection defined by the claims of this application.

Claims

1. A method for determining futures counter self-trading, characterized by: The following steps are involved: Step S01: The OTC obtains contract information and divides the difference between the contract's upper and lower limit prices by the contract's minimum order price to determine the number of price units that can be quoted for the contract. Step S02: Memory pre-allocation: Calculate the available quotation quantity based on the contract's price limit range and minimum price fluctuation unit, and pre-allocate a fixed-size memory block for each investor of each contract; Step S03: Apply for the required memory space for the contract and record the highest buy price and lowest sell price of the contract for quick judgment of self-trading risk control; Step S04: Self-filled order determination: For sell orders, the system checks whether the current order price is lower than the highest buy price when placing an order; for buy orders, the system checks whether the order price is higher than the lowest sell price. If the conditions are met, the order is determined to be a self-filled order, triggering a self-filled order risk alert or order blocking.

2. The method for determining futures counter self-trading according to claim 1, characterized in that: In step S02, the memory block size is 4 bytes × Ticks × Contract Quantity × Investor Quantity, where 4 bytes are the unfulfilled buy quantity and unfulfilled sell quantity of the price in the contract information obtained by the OTC, and each field is 2 bytes.

3. The method for determining futures counter self-trading according to claim 1, characterized in that: Between step S04 and step S03, there is a step of maintaining the highest bid price / lowest ask price. Specifically, when the order is first submitted, the price is recorded as the highest bid price or the lowest ask price. When subsequent orders are submitted, the highest bid price or the lowest ask price is updated by comparison. When the order is executed or cancelled, if the transaction quantity at a certain price returns to zero, a local scan of the new highest bid price or the lowest ask price is triggered. The local scan is the range from the highest bid price to the lowest ask price of the current contract.

4. The method for determining futures counter self-trading according to claim 3, characterized in that: Before the highest bid / lowest ask price maintenance step, a quick price indexing step is provided. Specifically, the price is converted into an array subscript using the formula: subscript = (current price - limit price) / minimum order price. The memory location is directly located through the subscript, and read and write operations do not require traversal.

5. The method for determining futures counter self-trading according to claim 3 or 4, characterized in that: In step S04, if it is determined that it is not a self-trade, the array index is found by dividing the price by the minimum order price, the corresponding quantity is updated according to the array index and the transaction direction, and then it is determined whether the highest bid price or the lowest ask price needs to be updated.