Market porous emotion composite index design method
By designing a composite indicator of market long-short sentiment, combining the changing direction and comprehensive indicators of long-short positions, the problem that existing technology cannot effectively judge market sentiment, and achieve more accurate market sentiment judgment and investment decision support.
Patent Information
- Application Number
- CN202311401221.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-26
- Publication Date
- 2025-04-29
AI Technical Summary
When judging the direction of market sentiment, the existing technology cannot effectively deal with situations where long changes are the same as short changes, resulting in the inability to accurately judge market sentiment.
Design a composite indicator of market long-short sentiment. By calculating the position change direction factors, position change direction indicators and comprehensive indicators of long-short and short positions, analyze the market sentiment direction represented by different indicators, and calculate the long-short strength indicators and comprehensive long-short strength indicators to judge market sentiment when the long-short changes the same as the short-short changes.
It effectively makes up for the difficulty of judging traditional methods when long changes are the same as short changes, can judge investor sentiment more accurately, and verify the effectiveness of indicators through strategic backtesting, providing more useful information for investment decisions.
Smart Images

Figure CN119904125A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of market sentiment, and in particular to a method for designing a composite index of market long-short sentiment. Background Art
[0002] my country's futures market has developed rapidly in recent years, and futures trading varieties have also become diversified. However, due to the large differences in position structures between China and foreign countries, overseas scholars have paid less attention to domestic position factors, and domestic scholars' research on factors and factors affecting commodity futures is mainly momentum factors, term structure factors, etc., and there is less research on position factors. In the prior art, the research on position factors is mostly based on a single position factor or a multi-factor model constructed with other factors. The logic of the strategy is to go long when long positions increase and short positions decrease; go short when short positions increase and long positions decrease. One defect of this method is that it cannot judge the direction of market sentiment when the direction of long changes is the same as that of short changes. In view of the above problems, the present invention proposes a method for designing a composite indicator of market long-short sentiment to solve the above problems. Summary of the invention
[0003] The purpose of the present invention is to solve the defects mentioned in the above background technology by proposing a method for designing a composite index of market long-short sentiment.
[0004] The technical solution adopted by the present invention is as follows:
[0005] A method for designing a composite index of market long and short sentiment is provided, including the following steps:
[0006] S1: Calculate the position change direction factors of long and short positions respectively;
[0007] S2: Calculate the long and short position change direction indicators separately;
[0008] S3: Calculates the comprehensive index of long and short position changes;
[0009] S4: Analyze the market sentiment direction represented by different indicators;
[0010] S5: Backtest strategies based on historical data and indicators.
[0011] As a preferred technical solution of the present invention: the calculation formula of S1 is as follows:
[0012]
[0013]
[0014] Among them, OIR long is the long position change factor, OIR shortis the short position change factor, long t is the total long positions of the top N members at time t, short t is the total short positions of the top N members at time t, and R is the time window.
[0015] As a preferred technical solution of the present invention: the calculation formula of S2 is as follows:
[0016]
[0017]
[0018] Among them, sign(OIR long ) is the long position change direction indicator, sign(OIR short ) is the indicator of the direction of change of short positions, sign is the sign function, if x>0, then sign(x)=1; if x<0, then sign(x)=-1; if x=0, then sign(x)=0.
[0019] As a preferred technical solution of the present invention: the calculation formula of S3 is as follows:
[0020] S=sign(OIR long )+sign(OIR short )
[0021] Among them, S represents the investor's sentiment index for the market, and the values of the S indicator include 2, 1, 0, -1, and -2.
[0022] As a preferred technical solution of the present invention: S4 includes the following situations:
[0023] When S=2
[0024] OIR long >0 and OIR short >0
[0025] When S=1
[0026]
[0027] When S=0
[0028]
[0029] When S=-1
[0030]
[0031] When S = -2
[0032] OIR long<0 and OIR short <0.
[0033] As a preferred technical solution of the present invention: S4 includes two situations: the indicator can judge the market situation and the indicator cannot judge the market situation. If the indicator can judge the market situation, S5 is executed. If the indicator cannot judge the market situation, it is necessary to calculate the long-short strength index and the comprehensive long-short strength index for R days.
[0034] As a preferred technical solution of the present invention: the criterion that the indicator cannot judge the market situation is that the direction of long position change is the same as that of short position change.
[0035] As a preferred technical solution of the present invention: the formula for calculating the long and short strength index is as follows:
[0036]
[0037] Among them, Δ(long i ) represents the total change in long positions of members on day i, Δ(short i ) represents the total change in the short position of the member on the i-th day, ΔOI i Indicates the number of newly created warehouse orders, then LSR i That is, the change rate of the proportion of net long positions, i = t-R+1, ..., t. Since the goal is to know the direction of the long and short changes of this indicator, LSR can be i Simplified to LS i :
[0038] LS i =Δ(long i )-Δ(short i )
[0039] Wherein, i=t-R+1, ..., t.
[0040] As a preferred technical solution of the present invention: the formula for calculating the comprehensive long-short strength index for R days is as follows:
[0041]
[0042]
[0043] Among them, R is the window period and k is the set threshold.
[0044] As a preferred technical solution of the present invention: the basis for the strategy backtest in S5 includes the original position direction index and the comprehensive long-short strength index.
[0045] The method for designing a composite index of market long-short sentiment provided by the present invention has the following beneficial effects compared with the prior art:
[0046] The present invention combines the long and short position direction and the comprehensive long-short relative strength index into a composite position factor, which makes up for the defect that the traditional position factor only uses the long and short position direction, which easily causes the difficulty in identifying the direction of market sentiment; it also proposes a comprehensive long-short strength index S0 to make up for the problem that the direction of market sentiment cannot be judged when the long change is the same as the short change direction, further judges the investor's emotions, and is more helpful to fully understand the direction of market changes. The effect of the indicator is verified by strategy backtesting, which provides more useful information for investment decisions, can help investors better grasp market trends, and make more wise investment decisions; the indicator comprehensively utilizes the long and short position direction and the long-short relative strength index. Compared with a single position factor, the indicator is more reliable and comprehensive in analyzing the long-short sentiment of investors. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 The figure is a flow chart of the method of the present invention. DETAILED DESCRIPTION
[0048] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of this embodiment can be combined with each other. The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0049] Reference Figure 1 The present invention provides a method for designing a composite index of market long-short sentiment, comprising the following steps:
[0050] S1: Calculate the position change direction factors of long and short positions respectively;
[0051] S2: Calculate the long and short position change direction indicators separately;
[0052] S3: Calculates the comprehensive index of long and short position changes;
[0053] S4: Analyze the market sentiment direction represented by different indicators;
[0054] S5: Backtest strategies based on historical data and indicators.
[0055] The calculation formula of S1 is as follows:
[0056]
[0057]
[0058]
[0059] Among them, OIR long is the long position change factor, OIR short is the short position change factor, long t is the total long positions of the top N members at time t, short t is the total short positions of the top N members at time t, and R is the time window.
[0060] The calculation formula of S2 is as follows:
[0061]
[0062]
[0063] Among them, sign(OIR long ) is the long position change direction indicator, sign(OIR short ) is the indicator of the direction of change of short positions, sign is the sign function, if x>0, then sign(x)=1; if x<0, then sign(x)=-1; if x=0, then sign(x)=0.
[0064] The calculation formula of S3 is as follows:
[0065] S=sign(OIR long )+sign(OIR short )
[0066] Among them, S represents the investor's sentiment index for the market, and the values of the S indicator include 2, 1, 0, -1, and -2.
[0067] The S4 includes the following situations:
[0068] When S=2
[0069] OIR long >0 and OIR short >0
[0070] When S=1
[0071]
[0072] When S=0
[0073]
[0074] When S=-1
[0075]
[0076] When S = -2
[0077] OIR long <0 and OIR short <0.
[0078] The S4 includes two situations: the indicator can judge the market situation and the indicator cannot judge the market situation. If the indicator can judge the market situation, execute S5. If the indicator cannot judge the market situation, it is necessary to calculate the long-short strength index and the comprehensive long-short strength index for R days.
[0079] The criterion for the indicator not being able to judge the market situation is that the long and short changes are in the same direction.
[0080] The formula for calculating the long and short strength index is as follows:
[0081]
[0082] Among them, Δ(long i ) represents the total change in long positions of members on day i, Δ(short i ) represents the total change in the short position of the member on the i-th day, ΔOI i Indicates the number of newly created warehouse orders, then LSR i That is, the change rate of the proportion of net long positions, i = t-R+1, ..., t. Since the goal is to know the direction of the long and short changes of this indicator, LSR can be i Simplified to LS i :
[0083] LS i =Δ(long i )-Δ(short i )
[0084] Wherein, i=t-R+1, ..., t.
[0085] The formula for calculating the comprehensive long and short strength index for R days is as follows:
[0086]
[0087]
[0088] Among them, R is the window period and k is the set threshold.
[0089] The basis for the strategy backtest in S5 includes the original position direction indicator and the comprehensive long-short strength indicator.
[0090] In this embodiment, the data used is the member position ranking data published by domestic futures exchanges from January 21, 2002 to September 4, 2023. The positions of the top 20 short and long position members of each commodity variety are read separately, including the long positions, short positions, position changes, etc. of the top 20 members. Among them, long positions refer to the positions held by investors after buying stock index futures contracts, and short positions refer to the positions held by investors after selling stock index futures contracts. Simply put, long positions are stocks held, and short positions are funds obtained after selling. First, calculate the long and short position change direction factors:
[0091]
[0092]
[0093] Among them, OIR long is the long position change factor, OIR short is the short position change factor, long t is the total long positions of the top N members at time t, short t is the total short positions of the top N members at time t, and R is the time window.
[0094] Then calculate the long and short position change direction indicators:
[0095]
[0096]
[0097] Among them, sign(OIR long ) is the long position change direction indicator, sign(OIR short ) is the short position change direction indicator, sign is the sign function, if x>0, then sign(x)=1; if x<0, then sign(x)=-1; if x=0, then sign(x)=0. OIR long >0 indicates an increase in long positions; OIR long =0 means long position remains unchanged; OIR long <0 means long positions are decreasing; OIR short >0 indicates that short positions are decreasing; OIR short =0 means short position remains unchanged; OIR short <0 indicates an increase in short positions.
[0098] Then calculate the combined indicator of long and short position changes:
[0099] S=sign(OIR long )+sign(OIRshort )
[0100] Among them, S represents the investor's sentiment index for the market, and the values of the S index include 2, 1, 0, -1, and -2. By analyzing the market sentiment direction represented by different indicators:
[0101] When S=2, long positions increase and short positions decrease;
[0102] OIR long >0 and OIR short >0
[0103] When S=1, short positions remain unchanged and long positions increase; long positions remain unchanged and short positions decrease;
[0104]
[0105] When S=0, long positions increase and short positions increase; long positions decrease and short positions decrease; long positions remain unchanged and short positions remain unchanged;
[0106]
[0107] When S=-1, short positions remain unchanged and long positions decrease; long positions remain unchanged and short positions increase
[0108]
[0109] When S = -2, long positions decrease and short positions increase;
[0110] OIR long <0 and OIR short <0.
[0111] The size of S indicates the investor's sentiment index for the market. The larger S is, the more optimistic the investor is about the market, and the smaller S is, the more pessimistic the investor is about the market. There are two situations for analyzing the market sentiment direction represented by different indicators, namely, the indicator can judge the market situation and the indicator cannot judge the market situation. If the indicator can judge the market situation, the strategy backtest is carried out based on historical data and indicators. If the indicator cannot judge the market situation, it is necessary to calculate the long-short strength index and the comprehensive long-short strength index for R days. Among them, the standard for the indicator to fail to judge the market situation is that the long change and the short change are in the same direction, that is, S = 0.
[0112] Further, calculate the long and short strength indicators:
[0113]
[0114] Among them, Δ(long i) represents the total change in long positions of members on the day, Δ(short i ) represents the total change in the short position of the member on the i-th day, ΔOI i Indicates the number of newly created warehouse orders, then LSR i That is, the change rate of the proportion of net long positions, i = t-R+1, ..., t. Since the goal is to know the direction of the long and short changes of this indicator, LSR can be i Simplified to LS i :
[0115] LS i =Δ(long i )-Δ(short i )
[0116] Where i = t-R+1, ..., t. When Δ(long i )>Δ(short i ),LS i >0, it means that the increase in long positions on that day is greater than the increase in short positions, and the bullish view is dominant; on the contrary, LS i <0, the proportion of short positions increased is higher, which means that the short view is dominant on this day. i Aims to measure the power of long informed traders versus short informed traders;
[0117] Furthermore, the comprehensive long and short strength index of R days is calculated:
[0118]
[0119]
[0120] Where R is the window period, k is the set threshold; for S = 0, the window period is R days, and the LS of each day in these R days is calculated separately. i The calculation of S0 is equivalent to the sign (LS i ) sum to R. In general, the value of S0 is always between 1 and -1. The larger the value of S0, the more optimistic investors are about the market, and the smaller the value of S0, the more pessimistic investors are about the market. At the same time, a threshold k is set. When S0 is greater than k, investors are more optimistic, and when S0 is less than -k, investors are more pessimistic. Therefore, when this indicator is used in investment strategies, long positions are taken when S0 is greater than k, and short positions are taken when S0 is less than -k. Based on experience, we set this threshold k to 1 in strategy backtesting. That is to say In the case of doing more, This threshold can be adjusted according to strategy requirements.
[0121] Finally, use historical data to backtest the strategy based on the indicators calculated above. This strategy combines the original position direction indicator with the comprehensive long-short strength indicator proposed in this article. Comparing the backtest results of this indicator with the results of the traditional indicator (that is, the original indicator that does not operate when S=0), it can be found that the method proposed in the present invention makes the strategy yield and other indicators have a more obvious improvement. Among them, the comprehensive long-short strength indicator S0 can not only be combined with the long-short direction indicator S into a strategy, but also can be used as a separate strategy. We call this strategy the cumulative position change direction strategy, and the approach is to directly calculate the LS of each day within the window period R i , according to LS i Calculate S0 if Then go long; if Backtesting this strategy shows that the return rate of the cumulative position change direction strategy is higher than that of the traditional direction strategy, and the Sharpe ratio is also slightly higher. The higher the Sharpe ratio, the higher the excess return of the investment portfolio under the same risk, and the better the performance.
[0122] It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above and that the invention can be implemented in other specific forms without departing from the spirit or essential features of the invention. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description, and it is intended that all variations falling within the meaning and scope of the equivalent elements of the claims be included in the invention. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.
[0123] In addition, it should be understood that although the present specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.
Claims
1. A method for designing a composite index of market long and short sentiments, characterized by: The steps include: S1: Calculate the position change direction factors of long and short positions respectively; S2: Calculate the long and short position change direction indicators separately; S3: Calculates the comprehensive index of long and short position changes; S4: Analyze the market sentiment direction represented by different indicators; S5: Backtest strategies based on historical data and indicators.
2. The method for designing a composite index of market long and short sentiment according to claim 1, characterized in that: The calculation formula of S1 is as follows: Among them, OIR long is the long position change factor, OIR short is the short position change factor, long t is the total long positions of the top N members at time t, short t is the total short positions of the top N members at time t, and R is the time window.
3. The method for designing a composite index of market long and short sentiment according to claim 1, characterized in that: The calculation formula of S2 is as follows: Among them, sign(OIR long ) is the long position change direction indicator, sign(OIR short ) is the indicator of the direction of change of short positions, sign is the sign function, if x>0, then sign(x)=1; if x<0, then sign(x)=-1; if x=0, then sign(x)=0.
4. The method for designing a composite index of market long and short sentiment according to claim 1, characterized in that: The calculation formula of S3 is as follows: S=sign(OIR long )+sign(OIR short ) Among them, S represents the investor's sentiment index for the market, and the values of the S indicator include 2, 1, 0, -1, and -2.
5. The method for designing a composite index of market long and short sentiment according to claim 4, characterized in that: The S4 includes the following situations: When S=2 EDGE long >0 and OIR short >0 When S=1 When S=0 When S=-1 When S = -2 EDGE long <0 and OIR short <0。 6. The method for designing a composite index of market long and short sentiment according to claim 5, characterized in that: The S4 includes two situations: the indicator can judge the market situation and the indicator cannot judge the market situation. If the indicator can judge the market situation, execute S5. If the indicator cannot judge the market situation, it is necessary to calculate the long-short strength index and the comprehensive long-short strength index for R days.
7. The method for designing a composite index of market long and short sentiment according to claim 6, characterized in that: The criterion for the indicator not being able to judge the market situation is that the long and short changes are in the same direction.
8. The method for designing a composite index of market long and short sentiment according to claim 6, characterized in that: The formula for calculating the long and short strength index is as follows: Among them, Δ(long i ) represents the total change in long positions of members on day i, Δ(short i ) represents the total change in the short position of the member on the i-th day, ΔOI i Indicates the number of newly created warehouse orders, then LSR i That is, the change rate of the proportion of net long positions, i = t-R+1, ..., t. Since the goal is to know the direction of the long and short changes of this indicator, LSR can be i Simplified to LS i : LS i =Δ(long i )-Δ(short i ) Wherein, i=t-R+1, ..., t.
9. The method for designing a composite index of market long and short sentiment according to claim 8, characterized in that: The formula for calculating the comprehensive long and short strength index for R days is as follows: Among them, R is the window period and k is the set threshold.
10. The method for designing a composite index of market long and short sentiment according to claim 1, characterized in that: The basis for the strategy backtest in S5 includes the original position direction indicator and the comprehensive long-short strength indicator.