Bulk commodity transaction method and system based on future commodity exchange position ranking data
By using the position ranking data of futures exchanges to determine long-term long and short position members, calculate their position factors and filter signals, it solves the problem of difficulty in judging the market direction in the existing technology, achieving more accurate trading signals and reducing transaction costs. effect.
Patent Information
- Application Number
- CN202410796900.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-20
- Publication Date
- 2024-10-18
AI Technical Summary
It is difficult to effectively judge commodity futures trading trends with existing technology, and factors based on position data cannot clarify the direction of market changes.
By using the position ranking data of futures exchanges, long-term long and short position members are determined, their position factors are calculated, and they are input into the long and short signal filtering model to filter out long and short signals to guide transactions.
Through two filterings, more refined signals are obtained, which improves the accuracy of transactions, reduces noise signals, and reduces transaction costs.
Smart Images

Figure CN118799073A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet technology, and in particular to a commodity trading method and system based on futures exchange position ranking data. Background Art
[0002] Without considering the handling fee, futures trading is actually a zero-sum game, that is, the gains of the winners in the market come from the losers, so real-time understanding of the trading status of other participants in the market will increase the probability of winning. The position information in the futures market can help people understand the status of major market participants and help portray the predictions of major investors on market trends.
[0003] In my country, futures exchanges will rank the trading conditions of the day after the market closes every day, and publish the top 20 positions in terms of trading volume, long positions (positions held after buying futures contracts), and short positions (positions held after selling futures contracts). After processing these position data, signals reflecting market trends can be obtained to facilitate subsequent futures trading.
[0004] There are already some factors based on position data. These factors are generated using the position information of the top 20 members. Although they include most of the market information, the direction of market changes they reflect is not clear. Figure 1 As shown, it shows the total long and short positions of the top 20 members of the SHFE Copper 2311 contract. It can be seen that there is not much difference between the long and short positions. Based on this, it will be difficult to clearly judge the direction of the market. Summary of the invention
[0005] In view of the problem in the prior art that it is difficult to judge the trend of commodity futures trading, the purpose of the present invention is to provide a commodity trading method and system based on futures exchange position ranking data, so as to at least partially solve the above problem.
[0006] To achieve the above object, the technical solution of the present invention is:
[0007] In a first aspect, the present invention provides a commodity trading method based on futures exchange position ranking data, the method comprising the following steps:
[0008] S1. Determine the long-term long position members and long-term short position members based on the position ranking data released by the futures exchange;
[0009] S2. Calculate the long-term long position factor LC of long-term long position members t , and calculate the long-term short position factor SC of members holding long-term short positions t ;
[0010] S3. The long-term long position factor LC t and the long short position factor SC t Input the preset long and short signal filtering model to filter out long and short signals;
[0011] S4. Conduct commodity trading according to the guidance of the long and short signals.
[0012] In some preferred embodiments, in step S1, the position ranking data published by the futures exchange includes the long positions of the top 20 members with long positions, the short positions of the top 20 members with short positions, and the trading volumes of the top 20 members with trading volumes, and the steps of determining the long-term long position members and the long-term short position members according to the position ranking data published by the futures exchange include:
[0013] S11. For a certain product i, the sum of all long positions of futures members on the product within the window period R is counted, and then sorted from large to small as the full contract ranking list, and the cumulative long position T of K futures members on the full contract ranking list is calculated. i ;
[0014] in, h i (t) is the long position of futures members in the full contract ranking list on day t. If the long position of futures members in the full contract ranking list on day t is not on the full contract ranking list, then h i (t) = 0;
[0015] S12.According to the cumulative long position T i Determine the top N long-term long position members in order from high to low, N<K;
[0016] S13. According to the contents of step S11 and step S12, the long position data is replaced with the short position data, and N members with long-term short positions are determined.
[0017] In some preferred embodiments, in step S12, the total transaction amount V i The order from high to low is the cumulative long position T i Identical futures members are sorted;
[0018] in, v i (t) is the futures member’s trading volume of product i on day t. If the futures member’s position of product i on day t is not on the list of all contracts, then v i (t)=0.
[0019] In some preferred embodiments, in step S2, the long-term long position factor LC of the long-term long position member is calculated in the following manner: t and the long-term short position factor SC of members with long-term short positions t ;
[0020]
[0021] Wherein, long(j, t) is the long position of futures member j in the full contract ranking list on the tth day of variety i. If the position of futures member j in the tth day of variety i is not on the list, long(j, t) = 0; short(j, t) is the short position of futures member j in the full contract ranking list on the tth day of variety i. If the position of futures member j in the tth day of variety i is not on the list, short(j, t) = 0.
[0022] In some preferred embodiments, in step S3, the preset long-short signal filtering model is:
[0023]
[0024] Among them, K 1 is the standard deviation of long positions, K 2 is the standard deviation of short positions, σ 1 is the long position threshold, σ 2 is the short position threshold, Indicates LC within M days t The mean of Indicates SC within M days t , and p is a variable parameter that needs to be adjusted.
[0025] In a second aspect, the present invention provides a commodity trading system based on futures exchange position ranking data, comprising:
[0026] A screening module, which is used to determine long-term long position members and long-term short position members according to the position ranking data released by the futures exchange;
[0027] Factor calculation module, which is used to calculate the long-term long position factor LC of long-term long position members t , and calculate the long-term short position factor SC of members holding long-term short positions t ;
[0028] A signal filtering module is used to filter the long-term long position factor LC t and the long short position factor SC t Input the preset long and short signal filtering model to filter out long and short signals;
[0029] and a trading module, wherein the trading module is used to conduct commodity trading according to the guidance of the long and short signals.
[0030] In a third aspect, the present invention provides an electronic device, comprising a memory storing executable program code and a processor coupled to the memory; wherein the processor calls the executable program code stored in the memory to execute the method as described above.
[0031] In a fourth aspect, the present invention provides a computer-readable storage medium storing a computer program, wherein the computer program executes the method described above when executed by a processor.
[0032] By adopting the above technical scheme, the beneficial effects of the present invention are as follows: the present invention firstly utilizes the member position ranking data, and filters the member position ranking information on the full contract ranking list to obtain long-term long or short futures members; secondly, the present invention introduces a variable threshold to filter the long and short strength signals of the position information of long-term long or short futures members, and goes long or short on the main contract according to the strong signals screened out. The method provided by the present invention obtains a more refined signal by filtering the long-term position members and the long and short strength signals twice, thereby guiding futures trading. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 This is a schematic diagram of the total long and short positions of the SHFE Copper 2311 contract;
[0034] Figure 2 A schematic diagram of a flow chart of a bulk commodity trading method based on futures exchange position ranking data of the present invention;
[0035] Figure 3 This is a structural schematic diagram of a bulk commodity trading system based on futures exchange position ranking data of the present invention;
[0036] Figure 4 This is a schematic diagram of the structure of an electronic device in Embodiment 3 of the present invention. DETAILED DESCRIPTION
[0037] The specific embodiments of the present invention are further described below in conjunction with the accompanying drawings. It should be noted that the description of these embodiments is used to help understand the present invention, but does not constitute a limitation of the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0038] Embodiment 1
[0039] The embodiment of the present invention provides a commodity trading method based on futures exchange position ranking data, such as Figure 2 As shown, the method comprises the following steps:
[0040] S1. Determine long-term long position members and long-term short position members based on the position ranking data released by the futures exchange.
[0041] S2. Calculate the long-term long position factor LC of long-term long position members t , and calculate the long-term short position factor SC of members holding long-term short positions t .
[0042] S3. Set the long-term long position factor LC t and the long short position factor SC t Input the preset long and short signal filtering model to filter out long and short signals.
[0043] S4. Trade commodities based on the guidance of long and short signals.
[0044] It is easy to understand that since futures members who hold long-term positions in a certain product in the market generally have relevant industry backgrounds, they have accumulated certain experience in trading this product, have a deeper understanding of the spot market, and are more confident about price trends. Therefore, it is necessary to analyze members who hold long-term positions.
[0045] In step S1, the position ranking data published by the futures exchange includes the long positions of the top 20 members with long positions, the short positions of the top 20 members with short positions, and the trading volumes of the top 20 members with trading volumes. Accordingly, the steps of determining the long-term long position members and the long-term short position members according to the position ranking data published by the futures exchange include:
[0046] S11. For a certain product i, the sum of all long positions of futures members on the product within the window period R is counted, and then sorted from large to small as the full contract ranking list, and the cumulative long position T of K futures members on the full contract ranking list is calculated. i ;
[0047] in, h i (t) is the long position of futures members in the full contract ranking list on day t. If the long position of futures members in the full contract ranking list on day t is not on the full contract ranking list, then h i (t) = 0;
[0048] S12.According to the cumulative long position T i Determine the top N long-term long position members in order from high to low, N<K;
[0049] S13. According to the contents of step S11 and step S12, the long position data is replaced with the short position data, and N members with long-term short positions are determined.
[0050] Taking Cu as an example, its contract codes are Cu2404, Cu2405, Cu2406, etc. Each contract will publish long positions, short positions and trading volume rankings, and the full contract ranking refers to the aggregation of data of all contracts to generate full contract rankings for long positions, short positions and trading volume. The total number of futures members in the full contract ranking of each data (i.e. long positions, short positions, trading volume) is called K.
[0051] It is easy to understand that in step 12, there may be a cumulative long position T i For example, when N = 10 and the cumulative long positions of the 10th and 11th futures members are T i If they are the same, further sorting is required.
[0052] In this embodiment, in step S12, the total transaction amount V i The order from high to low is the cumulative long position T i The same futures members are sorted. Among them, v i (t) is the futures member’s trading volume of product i on day t. If the futures member’s position of product i on day t is not on the list of all contracts, then v i (t) = 0. In this way, all K futures members can be accurately ranked, so that the top N long-term long position members can be determined. Similarly, the top N long-term short position members can also be accurately determined.
[0053] In step S2, the long-term long position factor LC of the long-term long position member is calculated by the following method: t and the long-term short position factor SC of members with long-term short positions t ;
[0054]
[0055] Wherein, long(j, t) is the long position of futures member j in the full contract ranking list on the tth day of variety i. If the position of futures member j in the tth day of variety i is not on the list, long(j, t) = 0; short(j, t) is the short position of futures member j in the full contract ranking list on the tth day of variety i. If the position of futures member j in the tth day of variety i is not on the list, short(j, t) = 0.
[0056] From the above formula, we can see that LC t In fact, it reflects the total change in long-term long positions held by futures members on day t. tIn fact, it reflects the change in the total amount of long-term short positions held by futures members on the tth day.
[0057] In traditional trading methods, LC is directly t and SC t Substitute the following formula to generate a trading strategy:
[0058]
[0059] However, the signals obtained in this way will make the entry signals for long and short relatively fixed. Even if the changes are very small at this time, they will be greater than 0 or less than 0. According to the traditional strategy, buying or selling will definitely be executed. In other words, the long and short operations of the strategy will still be triggered when the entry and exit information is not significant. If the price trend is too stable, the trading signals formed by the above method are actually "noise", and using it to guide transactions will increase transaction costs, so these noises need to be filtered out.
[0060] The embodiment of the present invention proposes to filter the narrow-range oscillating position signals by setting a threshold value, that is, in step S3, the preset long and short signal filtering model is:
[0061]
[0062] Among them, K 1 is the standard deviation of long positions, K 2 is the standard deviation of short positions, σ 1 is the long position threshold, σ 2 is the short position threshold, Indicates LC within M days t The mean of Indicates SC within M days t , and p is a variable parameter that needs to be adjusted.
[0063] Once the p value is set, the signal used to guide the transaction can be determined. Based on the signal obtained, the user can perform corresponding long or short operations.
[0064] Embodiment 2
[0065] The embodiment of the present invention provides a commodity trading system based on futures exchange position ranking data, such as Figure 3 As shown, the system includes a screening module, a factor calculation module, a signal filtering module and a trading module.
[0066] Among them, the screening module is used to determine the long-term long position members and long-term short position members according to the position ranking data released by the futures exchange. The factor calculation module is used to calculate the long-term long position factor LC of the long-term long position members. t, and calculate the long-term short position factor SC of members holding long-term short positions t The signal filtering module is used to filter the long-term long position factor LC t and the long short position factor SC t Input the preset long and short signal filtering model to filter out long and short signals. The trading module is used to trade commodities according to the guidance of long and short signals.
[0067] Embodiment 3
[0068] An electronic device, such as Figure 4 As shown, it includes a memory storing executable program code and a processor coupled to the memory; wherein the processor calls the executable program code stored in the memory to execute the method steps disclosed in the above embodiment.
[0069] Embodiment 4
[0070] A computer storage medium stores a computer program, and when the computer program is executed by a processor, the method steps disclosed in the above embodiment are executed.
[0071] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0072] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0073] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0074] It should be noted that, in the description of the present invention, the directions or positional relationships indicated by the terms "up", "down", "left", "right", "front", "back", etc. are descriptions of the structure of the present invention based on the accompanying drawings, and are only for the convenience of describing the present invention, and do not indicate or imply that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore cannot be understood as a limitation on the present invention.
[0075] The "first" and "second" in this technical solution are only used to distinguish the names of the same or similar structures, or corresponding structures with similar functions, and are not an arrangement of the importance of these structures, nor do they have a ranking, comparison of size, or other meanings.
[0076] In addition, unless otherwise clearly specified and limited, the terms "installation" and "connection" should be understood in a broad sense. For example, the connection can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, or it can be a connection between the two structures. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood based on the overall idea of the present invention and the specific context of the present solution.
[0077] The embodiments of the present invention are described in detail above with reference to the accompanying drawings, but the present invention is not limited to the described embodiments. For those skilled in the art, various changes, modifications, substitutions and variations of these embodiments are made without departing from the principles and spirit of the present invention, and still fall within the scope of protection of the present invention.
Claims
1. A commodity trading method based on futures exchange position ranking data, Features: The method comprises the following steps: S1. Determine the long-term long position members and long-term short position members based on the position ranking data released by the futures exchange; S2. Calculate the long-term long position factor LC of long-term long position members t , and calculate the long-term short position factor SC of members holding long-term short positions t ; S3. The long-term long position factor LC t and the long short position factor SC t Input the preset long and short signal filtering model to filter out long and short signals; S4. Conduct commodity trading according to the guidance of the long and short signals.
2. The method according to claim 1, Features: In step S1, the position ranking data published by the futures exchange includes the long positions of the top 20 members with long positions, the short positions of the top 20 members with short positions, and the trading volumes of the top 20 members with trading volumes. The steps of determining the long-term long position members and the long-term short position members according to the position ranking data published by the futures exchange include: S11. For a certain product i, the sum of all long positions of futures members on the product within the window period R is counted, and then sorted from large to small as the full contract ranking list, and the cumulative long position T of K futures members on the full contract ranking list is calculated. i ; in, h i (t) is the long position of futures members in the full contract ranking list on day t. If the long position of futures members in the full contract ranking list on day t is not on the full contract ranking list, then h i (t) = 0; S12.According to the cumulative long position T i Determine the top N long-term long position members in order from high to low, N<K; S13. According to the contents of step S11 and step S12, the long position data is replaced with the short position data, and N members with long-term short positions are determined.
3. The method according to claim 2, Features: In step S12, according to the total transaction volume V i The order from high to low is the cumulative long position T i Identical futures members are sorted; in, v i (t) is the futures member’s trading volume of product i on day t. If the futures member’s position of product i on day t is not on the list of all contracts, then v i (t)=0.
4. The method according to claim 1, Features: In step S2, the long-term long position factor LC of the long-term long position member is calculated by the following method: t and the long-term short position factor SC of members with long-term short positions t ; Wherein, long(j, t) is the long position of futures member j in the full contract ranking list on the tth day of variety i. If the position of futures member j in the tth day of variety i is not on the list, long(j, t) = 0; short(j, t) is the short position of futures member j in the full contract ranking list on the tth day of variety i. If the position of futures member j in the tth day of variety i is not on the list, short(j, t) = 0.
5. The method according to claim 4, Features: In step S3, the preset long and short signal filtering model is: Among them, K 1 is the standard deviation of long positions, K 2 is the standard deviation of short positions, σ 1 is the long position threshold, σ 2 is the short position threshold, Indicates LC within M days t The mean of Indicates SC within M days t , and p is a variable parameter that needs to be adjusted.
6. A commodity trading system based on futures exchange position ranking data, It is characterized in that include: A screening module, which is used to determine long-term long position members and long-term short position members according to the position ranking data released by the futures exchange; Factor calculation module, which is used to calculate the long-term long position factor LC of long-term long position members t , and calculate the long-term short position factor SC of members holding long-term short positions t ; A signal filtering module is used to filter the long-term long position factor LC t and the long short position factor SC t Input the preset long and short signal filtering model to filter out long and short signals; and a trading module, wherein the trading module is used to conduct commodity trading according to the guidance of the long and short signals.
7. An electronic device, Features: It comprises a memory storing executable program code and a processor coupled to the memory; wherein the processor calls the executable program code stored in the memory to execute the method according to any one of claims 1-5.
8. A computer-readable storage medium storing a computer program, Features: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is performed.
