Risk control early warning method and device based on opportunity cost, computer equipment and readable storage medium
By calculating the stop loss ratio entered by the user and the opportunity cost of the current number of opportunities, and combining the changes in the account assets, clearance processing or prompting the user, the lack of risk control warning problems in the existing technology that comprehensively considers the stop loss ratio, opportunity cost and number of opportunities is solved, and accurate and effective risk control is achieved.
Patent Information
- Application Number
- CN202411644102.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-18
- Publication Date
- 2025-04-01
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
There is a lack of an accurate risk control warning mechanism that comprehensively considers the stop loss ratio, opportunity cost and number of opportunities in the prior art, making it difficult to effectively manage risks in financial investment.
By obtaining the stop loss ratio entered by the user and the number of opportunities under the current risk control structure, the corresponding stop loss value and opportunity cost are calculated. When the account assets decrease or increase an opportunity cost, clearance processing or prompt the user, and stop the risk control warning when the number of opportunities is 0.
Accurate and effective risk control is achieved, and user assets are protected and risks are reduced by dynamically adjusting the number of opportunities and performing clearance processing.
Smart Images

Figure CN119741120A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of risk control and early warning, and in particular to a risk control and early warning method, device, computer equipment and readable storage medium based on opportunity cost. Background Art
[0002] In the field of financial investment, risk control is crucial. In the existing technology, there is a lack of an accurate risk control warning mechanism that can comprehensively consider the stop loss ratio, opportunity cost and number of opportunities. Summary of the invention
[0003] The object of the present invention is to provide a risk control early warning method, device, computer equipment and readable storage medium based on opportunity cost.
[0004] In a first aspect, an embodiment of the present invention provides a risk control early warning method based on opportunity cost, comprising:
[0005] Obtain the stop loss ratio input by the user, and calculate the stop loss value corresponding to the stop loss ratio;
[0006] Obtain the number of opportunities for the user under the current risk control structure, and calculate the opportunity cost corresponding to the number of opportunities;
[0007] When the user's account assets are reduced by one of the opportunity costs, liquidation processing is performed and the number of opportunities is reduced by one unit;
[0008] When the user's account assets increase by one of the opportunity costs, the number of opportunities increases by one unit and the user is prompted;
[0009] When the number of opportunities is 0, the liquidation process is performed and the opportunity risk control warning for the account assets is stopped.
[0010] In a possible implementation, obtaining the number of opportunities of the user under the current risk control structure and calculating the opportunity cost corresponding to the number of opportunities includes:
[0011] Obtain the number of opportunities for the user under the current risk control structure;
[0012] Obtaining the position information of the account assets, wherein the position information includes multiple contracts;
[0013] According to the buying index of each of the contracts and the daily line data of the main contract within the preset period range, the maximum increase or decrease of the account assets at the preset time node is calculated, and the profit probability and loss probability corresponding to each of the contracts are determined according to the maximum increase or decrease;
[0014] The account odds are calculated based on the profit probability and the loss probability;
[0015] According to the account odds corresponding to each of the contracts, the loss amount of the account assets at a preset time point is calculated;
[0016] The undetermined opportunity cost is obtained by dividing the absolute value of the stop loss value by the number of opportunities;
[0017] The larger of the loss amount and the undetermined opportunity cost shall be taken as the opportunity cost.
[0018] In a possible implementation, the buying index includes the price fluctuation, trading volume and volume-price ratio, and the maximum price fluctuation of the account assets at a preset time node is calculated based on the buying index of each contract and the daily line data of the main contract in a preset period range, and the profit probability and loss probability corresponding to each contract are determined based on the maximum price fluctuation, including:
[0019] Obtain the similarity times of the indicators of the rise and fall, trading volume and volume-price ratio of each of the contracts;
[0020] According to the daily line data of the main contract in the preset period range, the maximum increase or decrease of the account assets at the preset time node is calculated, and the number of profitable times is determined according to the maximum increase or decrease;
[0021] The profit probability is obtained by dividing the number of profit times by the number of indicator similarities, and the complementary number of the profit probability is used as the loss probability.
[0022] In a possible implementation, the calculating the account odds according to the profit probability and the loss probability includes:
[0023] Get the asset ratio of each of the contracts;
[0024] The account odds are calculated based on the asset ratio, the profit probability and the loss probability by the formula: f=(bp-q) / b;
[0025] Among them, f is the asset ratio, p is the profit probability, q is the loss probability, and b is the odds.
[0026] In a possible implementation, the calculating the loss amount of the account assets at a preset time point according to the account odds corresponding to each of the contracts includes:
[0027] Obtaining the occupied funds of a target contract, where the target contract is any one of multiple contracts;
[0028] Calculate and obtain the product of the occupied funds of the target contract and the account odds;
[0029] The difference between the multiplication result and the occupied funds of the target contract is taken as the profit or loss result of the target contract;
[0030] The profit and loss results corresponding to each of the contracts are accumulated and summed to calculate the loss amount of the account assets at the preset time node.
[0031] In a possible implementation, the method further includes:
[0032] Provide a user interface to display the current number of opportunities, opportunity costs, account asset status, and risk control warning status;
[0033] When the number of opportunities approaches or reaches 0, a high-level warning signal is issued through the user interface, and a preset adjustment of the investment strategy or a preset increase in margin operation is executed.
[0034] In a possible implementation, the method further includes:
[0035] When executing the liquidation process, a liquidation notification is sent to the user, and the liquidation notification includes the liquidation reason and the current account asset status.
[0036] In a second aspect, an embodiment of the present invention provides a risk control early warning device based on opportunity cost, comprising:
[0037] The acquisition module is used to acquire the stop loss ratio input by the user, calculate the stop loss value corresponding to the stop loss ratio; acquire the number of opportunities of the user under the current risk control structure, and calculate the opportunity cost corresponding to the number of opportunities;
[0038] The early warning module is used to execute the liquidation process and reduce the number of opportunities by one unit when the user's account assets decrease by one of the opportunity costs; increase the number of opportunities by one unit and prompt the user when the user's account assets increase by one of the opportunity costs; and execute the liquidation process and stop the opportunity risk control early warning for the account assets when the number of opportunities is 0.
[0039] In a third aspect, an embodiment of the present invention provides a computer device, comprising a processor and a non-volatile memory storing computer instructions, wherein when the computer instructions are executed by the processor, the computer device executes the method described in the first aspect.
[0040] In a fourth aspect, an embodiment of the present invention provides a readable storage medium, wherein the readable storage medium includes a computer program, and when the computer program is executed, the computer device where the readable storage medium is located is controlled to execute the method described in the first aspect.
[0041] Compared with the prior art, the beneficial effects provided by the present invention include: using a risk control warning method, device, computer equipment and readable storage medium based on opportunity cost disclosed by the present invention, including: first obtaining the stop loss ratio input by the user to calculate the stop loss value, and then obtaining the number of opportunities under the current risk control structure and calculating its corresponding opportunity cost. When the account assets decrease by one opportunity cost, the position is cleared and the number of opportunities is reduced by one; when the assets increase by one opportunity cost, the number of opportunities is increased by one and the user is prompted. When the number of opportunities is 0, the position is cleared and the opportunity risk control warning is stopped, so as to achieve accurate and effective risk control. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only illustrate certain embodiments of the present invention and should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can also be obtained based on these drawings without creative work.
[0043] Figure 1 A schematic diagram of the steps of a risk control and early warning method based on opportunity cost provided by an embodiment of the present invention;
[0044] Figure 2 A schematic block diagram of the structure of a risk control and early warning device based on opportunity cost provided by an embodiment of the present invention;
[0045] Figure 3 A schematic block diagram of the structure of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0046] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, 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 part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0047] The specific implementation modes of the present invention are described in detail below in conjunction with the accompanying drawings.
[0048] In order to solve the technical problems in the aforementioned background technology, Figure 1 The present invention provides a flow chart of a risk control and early warning method based on opportunity cost according to an embodiment of the present invention. The risk control and early warning method based on opportunity cost is introduced in detail below.
[0049] Step S201, obtaining a stop loss ratio input by a user, and calculating a stop loss value corresponding to the stop loss ratio;
[0050] Step S202, obtaining the number of opportunities for the user under the current risk control structure, and calculating the opportunity cost corresponding to the number of opportunities;
[0051] Step S203, when the user's account assets decrease by one of the opportunity costs, liquidation processing is performed and the number of opportunities is reduced by one unit;
[0052] Step S204, when the user's account assets increase by one of the opportunity costs, the number of opportunities increases by one unit and the user is prompted;
[0053] Step S205, when the number of opportunities is 0, the liquidation process is performed and the opportunity risk control warning for the account assets is stopped.
[0054] In the embodiment of the present invention, for example, assume that the server receives a stop loss ratio of 10% from the user, and the user's total assets are 1 million yuan. Then the server calculates the stop loss value to be 1 million yuan*10%=100,000 yuan.
[0055] Assume that the number of opportunities set by the user is 5. The server first automatically reads the current position of the account. Assume that there are three contracts in the account, namely Contract A, Contract B and Contract C.
[0056] For contract A, the price fluctuation range at the time of purchase is 5%, the trading volume is 1,000 lots, and the volume-price ratio is 2. The server analyzes the daily data of the main contracts in the past three years and finds that the total number of similar cases (the price fluctuation range, trading volume, and volume-price ratio errors are all within 3%) is 100 times, of which 60 times are profitable after 1 week. The profit probability of contract A is 60 / 100=0.6, and the loss probability is 1-0.6=0.4.
[0057] Assume the odds are 1:1.2. The capital occupied by Contract A is 200,000 yuan. Then the profit or loss of Contract A is 200,000 yuan*1.2-200,000 yuan=40,000 yuan.
[0058] The same method is used to calculate the profit and loss of Contract B and Contract C. Assume that the profit and loss of Contract B is -30,000 yuan, and the profit and loss of Contract C is 20,000 yuan.
[0059] The loss amount A1 of the entire account after one week is the sum of the gains and losses of contracts A, B, and C, that is, 4-3+2=30,000 yuan.
[0060] The total absolute value of stop loss is 100,000 yuan, and the total number of opportunities is 5 times, so the opportunity cost A2 is 100,000 yuan / 5=20,000 yuan.
[0061] The system compares A1 and A2 and selects the larger one as the opportunity cost. In this example, A1 (30,000 yuan) is greater than A2 (20,000 yuan), so the opportunity cost is 30,000 yuan.
[0062] Assume that the user's account assets were originally 800,000 yuan. After a period of trading, the assets were reduced to 770,000 yuan, and the amount of reduction reached the opportunity cost of 30,000 yuan.
[0063] When the server receives the asset change data, it immediately executes the liquidation operation and sells all the contracts held by the user. At the same time, the number of opportunities is reduced from 5 to 4, and the user is prompted with a message such as "Your account assets have reduced one opportunity cost, and the liquidation process has been executed. The current number of opportunities is 4."
[0064] Assume that a user's account assets increase from 770,000 yuan to 800,000 yuan, and the increase reaches an opportunity cost of 30,000 yuan.
[0065] The server detects the increase in assets, increases the number of opportunities from 4 to 5, and sends a message to the user, such as "Your account assets have increased by one opportunity cost, and the number of opportunities has increased to 5."
[0066] Assume that after a series of transactions, the user's number of opportunities has been reduced to 0.
[0067] The server will immediately execute the liquidation operation, sell all open contracts in the user's account, and stop the opportunity risk control warning for the account's assets. At the same time, a message notification will be sent to the user, such as "Your number of opportunities has reached 0, the liquidation operation has been executed, and the opportunity risk control warning has stopped."
[0068] In the embodiment of the present invention, the obtaining of the number of opportunities of the user under the current risk control structure and the calculation of the opportunity cost corresponding to the number of opportunities may be implemented through the following example.
[0069] Obtain the number of opportunities for the user under the current risk control structure;
[0070] Obtaining the position information of the account assets, wherein the position information includes multiple contracts;
[0071] According to the buying index of each of the contracts and the daily line data of the main contract within the preset period range, the maximum increase or decrease of the account assets at the preset time node is calculated, and the profit probability and loss probability corresponding to each of the contracts are determined according to the maximum increase or decrease;
[0072] The account odds are calculated based on the profit probability and the loss probability;
[0073] According to the account odds corresponding to each of the contracts, the loss amount of the account assets at a preset time point is calculated;
[0074] The undetermined opportunity cost is obtained by dividing the absolute value of the stop loss value by the number of opportunities;
[0075] The larger of the loss amount and the undetermined opportunity cost shall be taken as the opportunity cost.
[0076] In the embodiment of the present invention, illustratively, the server receives the number of opportunities set under the current risk control structure submitted by the user. Assume that the number of opportunities set by the user is 8 times.
[0077] The server automatically reads the position information in the user's account. Assume that the user's position includes three contracts, namely Contract X, Contract Y and Contract Z.
[0078] For contract X, the purchase price is 50 yuan and the purchase quantity is 1,000 shares; the purchase price of contract Y is 80 yuan and the purchase quantity is 800 shares; the purchase price of contract Z is 120 yuan and the purchase quantity is 500 shares.
[0079] The server first obtains the buying indicators of contract X, such as the increase or decrease at the time of purchase is 3%, the trading volume is 5,000 lots, and the volume-price ratio is 1.5. Then, the server queries the daily line data of the main contract in the past three years.
[0080] Through comparative analysis, it is found that the total number of times similar to the current buying indicators (the increase or decrease, trading volume and volume-price ratio errors are all within 3%) is 200 times. Among them, the number of times the price rose at the close of the market one week later is 120 times. The profit probability of contract X is 120 / 200=0.6, and the loss probability is 1-0.6=0.4.
[0081] The profit probability and loss probability of Contract Y and Contract Z are calculated in the same way.
[0082] Assume that the profit probability of contract Y is 0.5 and the loss probability is 0.5; the profit probability of contract Z is 0.7 and the loss probability is 0.3.
[0083] According to the Kelly formula f=(bp-q) / b, where f is the proportion of contract funds, p is the probability of profit, q is the probability of loss, and b is the odds.
[0084] For contract X, assume the calculated odds are 1:1.2.
[0085] For contract Y, assume the odds are 1:1.1.
[0086] For contract Z, assume the odds are 1:1.3.
[0087] The capital occupied by contract X is 50 yuan*1000 shares=50,000 yuan. Its profit or loss is 50,000 yuan*1.2-50,000 yuan=10,000 yuan.
[0088] The capital occupied by contract Y is 80 yuan*800 shares=64,000 yuan. Its profit or loss is 64,000 yuan*1.1-64,000 yuan=6,400 yuan.
[0089] The capital occupied by contract Z is 120 yuan*500 shares=60,000 yuan. Its profit and loss is 60,000 yuan*1.3-60,000 yuan=18,000 yuan.
[0090] The loss amount of the entire account is the sum of the gains and losses of contracts X, Y, and Z, that is, 10,000+6,400+18,000=34,400 yuan.
[0091] Assuming that the user sets a stop loss ratio of 15% and the total assets are 2 million yuan, the stop loss value is 2 million yuan*15%=300,000 yuan.
[0092] The number of opportunities is 8, and the undetermined opportunity cost is 300,000 yuan / 8 = 37,500 yuan.
[0093] In this example, the undetermined opportunity cost of RMB 37,500 is greater than the loss amount of RMB 34,400.
[0094] Therefore, the opportunity cost determined by the server is 37,500 yuan.
[0095] The server will monitor the changes in the user's account assets based on this opportunity cost and perform corresponding risk control operations. For example, if the account assets decrease by 37,500 yuan, the server will perform liquidation processing and reduce the number of opportunities by one unit; if the account assets increase by 37,500 yuan, the server will increase the number of opportunities by one unit and prompt the user. When the number of opportunities is 0, the server will perform liquidation processing and stop the opportunity risk control warning for the account assets.
[0096] In an embodiment of the present invention, the buying indicators include price fluctuation, trading volume and volume-price ratio. The maximum price fluctuation of the account assets at a preset time node is calculated based on the buying indicators of each contract and the daily data of the main contract in a preset period range, and the profit probability and loss probability corresponding to each contract are determined based on the maximum price fluctuation. The implementation can be performed through the following examples.
[0097] Obtain the similarity times of the indicators of the rise and fall, trading volume and volume-price ratio of each of the contracts;
[0098] According to the daily line data of the main contract in the preset period range, the maximum increase or decrease of the account assets at the preset time node is calculated, and the number of profitable times is determined according to the maximum increase or decrease;
[0099] The profit probability is obtained by dividing the number of profit times by the number of indicator similarities, and the complementary number of the profit probability is used as the loss probability.
[0100] In the embodiment of the present invention, illustratively, the server receives the purchase information of multiple contracts in the user account. Assume there are contracts A, B and C.
[0101] For contract A, the increase or decrease at the time of purchase is 8%, the trading volume is 8,000 lots, and the volume-price ratio is 1.8. The server searches and compares the daily data of the main contracts in the past three years.
[0102] After complex calculations and matching, the server determined that the number of times similar to the buying indicators of Contract A (the errors in price increase or decrease, trading volume and volume-price ratio were all within 3%) was 150 times.
[0103] For contract B, the increase or decrease when buying is 5%, the trading volume is 6,000 lots, and the volume-price ratio is 1.2. The server also searches and compares and determines that the number of similarities is 120.
[0104] For contract C, the increase or decrease at the time of purchase is 10%, the trading volume is 10,000 lots, and the volume-price ratio is 2.0. After comparison, the number of similarities is 180.
[0105] The server continues to analyze similar situations as above.
[0106] For the 150 similar situations of contract A, after the preset 1-week time node, the server calculated the maximum increase or decrease of the asset. Through further screening and judgment, it was determined that the number of times the price increase brought profits was 90 times.
[0107] For the 120 similar situations of contract B, after the 1-week time node, the number of profitable times was determined to be 60 times.
[0108] For the 180 similar situations of Contract C, there were 120 profitable times after the 1-week time node.
[0109] For contract A, the probability of profit is 90÷150=0.6, and the probability of loss is 1-0.6=0.4.
[0110] For contract B, the probability of profit is 60÷120=0.5, and the probability of loss is 1-0.5=0.5.
[0111] For contract C, the probability of profit is 120÷180≈0.67, and the probability of loss is 1-0.67=0.33.
[0112] Through the above detailed calculations and analysis, the server accurately obtains the profit probability and loss probability of each contract. These probability data will be used for subsequent account odds calculations and opportunity cost determination, thus providing an important basis for the implementation of precise risk control measures. For example, when the user's account assets change, the server can quickly determine whether it is necessary to execute liquidation, adjust the number of opportunities, etc. based on these probabilities and odds to ensure the safety of the user's assets and achieve effective risk management.
[0113] In subsequent operations, if the asset status of contract A changes, the server will calculate its possible profit and loss based on a profit probability of 0.6 and a loss probability of 0.4. Assuming that the current occupied funds of contract A are 50,000 yuan, based on the calculated odds, the server can predict the possible profit or loss amount in a week. If the account assets decrease to a certain extent, such as reducing the calculated opportunity cost, the server will immediately perform corresponding risk control operations, such as liquidation and adjusting the number of opportunities.
[0114] Similarly, for Contract B and Contract C, the server will continue to monitor their asset changes and conduct risk assessment and control based on the calculated probabilities and odds. This series of operations is to protect users' assets to the greatest extent, reduce risks, and achieve stable investment and asset appreciation in a complex and changing market environment.
[0115] By continuously collecting and analyzing market data, the server can continuously optimize and adjust the calculation of these probabilities and odds to adapt to market changes and improve the accuracy and effectiveness of risk control. At the same time, the server will promptly feedback the risk status and operation tips of the account to the user, so that the user can understand his investment situation and make reasonable decisions.
[0116] In the embodiment of the present invention, the account odds calculated according to the profit probability and the loss probability can be implemented through the following examples.
[0117] Get the asset ratio of each of the contracts;
[0118] The account odds are calculated based on the asset ratio, the profit probability and the loss probability by the formula: f=(bp-q) / b;
[0119] Among them, f is the asset ratio, p is the profit probability, q is the loss probability, and b is the odds.
[0120] In the embodiment of the present invention, the server first obtains the asset details of each contract in the user's account. Assume that the total assets of the user's account are 5 million yuan, of which the occupied funds of contract M are 1 million yuan, the occupied funds of contract N are 1.5 million yuan, and the occupied funds of contract O are 2.5 million yuan.
[0121] Then, the asset ratio of contract M = 1 million yuan / 5 million yuan = 0.2; the asset ratio of contract N = 1.5 million yuan / 5 million yuan = 0.3; the asset ratio of contract O = 2.5 million yuan / 5 million yuan = 0.5.
[0122] Assume that the profit probability p of contract M is 0.6, the loss probability q is 0.4, and the asset ratio f is 0.2.
[0123] Substituting these values into the formula f = (bp-q) / b, we obtain 0.2 = (b*0.6-0.4) / b.
[0124] 0.2b=0.6b-0.4; 0.4=0.4b; b=1.
[0125] So the odds of contract M are 1:1.
[0126] Assume that the profit probability p of contract N is 0.7, the loss probability q is 0.3, and the asset ratio f is 0.3.
[0127] Substitute into the formula 0.3 = (b*0.7-0.3) / b.
[0128] 0.3b=0.7b-0.3; 0.3=0.4b; b=0.75.
[0129] So the odds of contract N are 1:0.75.
[0130] The server uses the above calculations to derive the odds for each contract. These odds will be used to subsequently calculate the amount of loss in the account at a preset time point, and then determine the opportunity cost, in order to achieve risk control and management of the user's account assets.
[0131] In the actual market environment, the server will continuously monitor the status of each contract in the user's account, and timely update the data such as profit probability, loss probability and asset ratio according to the dynamic changes of the market and the user's operation, and recalculate the odds and opportunity cost. When the change of account assets reaches the preset risk control threshold, the server will quickly take corresponding measures, such as liquidation, adjustment of the number of opportunities, etc., to ensure the safety of users' assets and the realization of investment goals.
[0132] At the same time, the server will also promptly feedback the calculation results and related risk warning information to users, so that users can clearly understand the risk status of their investment portfolios and make more informed investment decisions. Through this precise and timely risk control mechanism, the server can effectively reduce the risk of user investments and improve the stability and sustainability of investments.
[0133] In the embodiment of the present invention, the loss amount of the account assets at a preset time node is calculated according to the account odds corresponding to each of the contracts, which can be implemented through the following examples.
[0134] Obtaining the occupied funds of a target contract, where the target contract is any one of multiple contracts;
[0135] Calculate and obtain the product of the occupied funds of the target contract and the account odds;
[0136] The difference between the multiplication result and the occupied funds of the target contract is taken as the profit or loss result of the target contract;
[0137] The profit and loss results corresponding to each of the contracts are accumulated and summed to calculate the loss amount of the account assets at the preset time node.
[0138] In the embodiment of the present invention, illustratively, the server receives the user's account information, which includes multiple contracts. Assume that there are contract A, contract B and contract C.
[0139] The purchase price of Contract A is RMB 20, and the purchase quantity is 1,000 shares. The capital occupied is RMB 20 × 1,000 shares = RMB 20,000.
[0140] The purchase price of contract B is 30 yuan, the purchase quantity is 800 shares, and the capital occupied is 30 yuan × 800 shares = 24,000 yuan.
[0141] The purchase price of Contract C is 40 yuan, the purchase quantity is 1,200 shares, and the capital occupied is 40 yuan × 1,200 shares = 48,000 yuan.
[0142] Assume that the account odds of Contract A is 1:1.2 and the capital occupied is 20,000 yuan.
[0143] The product is 20,000 yuan × 1.2 = 24,000 yuan.
[0144] Assume that the account odds of Contract B is 1:0.9 and the occupied funds are 24,000 yuan.
[0145] The product is 24,000 yuan × 0.9 = 21,600 yuan.
[0146] Assume that the account odds of Contract C is 1:1.1 and the occupied funds are 48,000 yuan.
[0147] The product is 48,000 yuan × 1.1 = 52,800 yuan.
[0148] For contract A, the profit and loss is 24,000 yuan - 20,000 yuan = 4,000 yuan.
[0149] For contract B, the profit and loss result is 21,600 yuan - 24,000 yuan = -2,400 yuan.
[0150] For contract C, the profit and loss result is 52,800 yuan - 48,000 yuan = 4,800 yuan.
[0151] Add up the profit and loss results of contracts A, B, and C: 4,000 yuan + (-2,400 yuan) + 4,800 yuan = 6,400 yuan.
[0152] Through the above precise calculations, the server concluded that the loss of the user's account assets at the preset time point was 6,400 yuan. This result will be used for subsequent comparison and judgment with other relevant values to determine whether to trigger risk control measures, such as liquidation, adjustment of the number of opportunities, etc.
[0153] During the continuous monitoring process, the server will continue to repeat these calculation steps, and update the profit and loss status of each contract and the overall risk level of the account assets in a timely manner as the market changes and the user's operation is updated. For example, if the price fluctuations of the contract cause the occupied funds to change, or the account odds are recalculated due to the update of market data, the server will quickly make corresponding adjustments and calculations.
[0154] If the amount of loss of account assets continues to increase in subsequent calculations and reaches the previously calculated opportunity cost or other preset risk control thresholds, the server will execute the established risk control strategy without hesitation to protect the user's asset security to the greatest extent. At the same time, the server will also promptly and accurately feedback these changes and decision results to the user, so that the user can understand the risk status of his account in real time and make corresponding adjustments based on his investment goals and risk tolerance.
[0155] Through this rigorous and efficient calculation and monitoring mechanism, the server can provide users with reliable risk control services in the complex and ever-changing financial markets, helping users achieve more robust and sustainable investment returns.
[0156] In the embodiments of the present invention, the following implementation modes are also provided.
[0157] Provide a user interface to display the current number of opportunities, opportunity costs, account asset status, and risk control warning status;
[0158] When the number of opportunities approaches or reaches 0, a high-level warning signal is issued through the user interface, and a preset adjustment of the investment strategy or a preset increase in margin operation is executed.
[0159] In an embodiment of the present invention, illustratively, the server builds an intuitive and clear user interface for the user. On this interface, the current number of opportunities is clearly displayed, for example, it is displayed as "Current number of opportunities: 5 times". At the same time, the numerical value of the opportunity cost is accurately presented, such as "Opportunity cost: 30,000 yuan". The account asset status is also displayed in the form of a specific amount, such as "Total account assets: 500,000 yuan", and the distribution of each asset is also subdivided, such as stock assets of 300,000 yuan, fund assets of 150,000 yuan, and cash of 50,000 yuan. In addition, the risk control warning status is also displayed with a striking logo, such as "Current risk control status: normal" or "Warning level: low".
[0160] As the user's investment transactions proceed, the number of opportunities gradually decreases. When the number of opportunities approaches 0, assuming that there is only 1 opportunity left, the server will immediately issue a striking high-level warning signal on the user interface. This warning signal may appear in the form of a flashing red icon, a pop-up warning window, or a text message notification, clearly informing the user that "your number of opportunities is about to run out, please pay attention to the risks!"
[0161] At the same time, the server will automatically execute preset investment strategy adjustments. For example, the server may automatically reduce some positions according to pre-set rules, sell some investment products with higher risks or smaller profit margins, in order to reduce the overall risk.
[0162] Alternatively, if the preset operation is to increase the margin, the server will calculate the amount of margin to be increased and prompt the user to pay it. For example, if it is calculated that the margin needs to be increased by 50,000 yuan, the user interface will display "To ensure the safety of your investment, the margin needs to be increased by 50,000 yuan. Please complete the payment as soon as possible."
[0163] Throughout the entire process, the server always maintains real-time monitoring and timely response to the user's account status. Through the user interface, it effectively communicates and interacts with users to help users better manage risks during the investment process and ensure the safety and stable appreciation of assets.
[0164] In the embodiments of the present invention, the following implementation modes are also provided.
[0165] When executing the liquidation process, a liquidation notification is sent to the user, and the liquidation notification includes the liquidation reason and the current account asset status.
[0166] In the embodiment of the present invention, illustratively, when the server executes the risk control strategy and decides to liquidate the user's account, a series of operations will be immediately initiated.
[0167] First, the server will generate a detailed liquidation notice. This notice clearly states the reason for the liquidation. For example, the notice will state: "Dear user, because the reduction of your account assets has reached the preset opportunity cost threshold, in order to protect the safety of your assets, according to the established risk control rules, we have executed a liquidation operation on your account."
[0168] At the same time, the notification will accurately present the current status of the account assets. The specific value of the total assets will be listed, for example: "The total assets of your current account are XX million yuan, including XX million yuan in stock assets, XX million yuan in fund assets, and XX million yuan in cash assets." It will also detail the specific profit and loss of each investment, such as: "The purchase cost of stock A you hold is XX million yuan, the current market value is XX million yuan, and the loss is XX million yuan; the purchase amount of fund B is XX million yuan, the current net value is XX million yuan, and the profit is XX million yuan."
[0169] The server will send this liquidation notice to the user through various channels. If the user has set up SMS notifications in the system, the server will immediately send a text message containing the above content to the user's registered mobile phone number. If the user prefers to receive notifications via email, the server will also send the carefully prepared liquidation notice to the user's registered email address.
[0170] Assume that user Xiaoming's account assets have reduced an opportunity cost due to market fluctuations, triggering a liquidation operation. The server quickly generates a liquidation notification and sends it to Xiaoming via SMS and email at the same time. The SMS concisely and clearly informs Xiaoming of the liquidation reason and total asset status, while the email lists the specific situation of each investment in more detail.
[0171] After receiving the notification, Xiao Ming can immediately and clearly understand the latest situation of his account and why his position was liquidated. This enables Xiao Ming to have a clear understanding of his investment status and understand that the risk control measures taken by the server are to protect his assets.
[0172] Through such timely, accurate and comprehensive liquidation notification services, the server can improve users' understanding and acceptance of risk control operations while ensuring the safety of users' assets, and enhance trust and communication between users and the system.
[0173] In order to more clearly describe the solution provided by the embodiment of the present invention, a relatively complete implementation method is provided below.
[0174] Step A: The system receives the stop loss ratio entered by the user.
[0175] Step B: The system automatically calculates the corresponding stop loss value.
[0176] Step C: The system receives the number of opportunities for the user under the risk control structure.
[0177] Step D: The system automatically calculates the corresponding opportunity cost.
[0178] Opportunity cost calculation method: After the user sets the stop loss percentage, the system will multiply the total assets by the stop loss percentage to get the total stop loss absolute value. The system automatically reads the current account positions, and for each contract in the position, the maximum increase or decrease at the closing price one week later is calculated based on the indicators bought at the time (including price fluctuation, trading volume and volume-price ratio) combined with the daily data of the main contracts in the past three years, so as to obtain the profit probability of each position contract (based on the total number of similar buying indicators (price fluctuation, trading volume, volume-price ratio errors are all within 3%), the number of profitable times after one week / total times = profit probability) and the loss probability (1-profit probability); then according to the asset proportion of each contract, according to the Kelly formula f = (bp-q) / b (where f is the contract The odds are calculated by taking the total stop loss absolute value divided by the total number of opportunities to get the opportunity cost A2. The system selects the larger of A1 and A2 as the opportunity cost.
[0179] Step E: User initiates opportunity risk control.
[0180] Step F: The system automatically monitors the changes in assets. When an asset decreases by one opportunity cost, execute step G1; when an asset increases by one opportunity cost, execute step G2 and return to step F.
[0181] Step G1: The system automatically clears the inventory, reduces the number of opportunities by 1, and prompts the user with a message.
[0182] Step G2: The opportunity number is increased by 1, and a message is sent to the user.
[0183] Step H: The system monitors whether the number of opportunities is 0. If it is 0, execute step 109.
[0184] Step I: Clear the system and stop the opportunity risk control.
[0185] Please refer to Figure 2 , Figure 2 An opportunity cost-based risk control warning device 110 provided in an embodiment of the present invention includes:
[0186] The acquisition module 1101 is used to acquire the stop loss ratio input by the user, calculate the stop loss value corresponding to the stop loss ratio; acquire the number of opportunities of the user under the current risk control structure, and calculate the opportunity cost corresponding to the number of opportunities;
[0187] The early warning module 1102 is used to execute the liquidation process and reduce the number of opportunities by one unit when the user's account assets decrease by one of the opportunity costs; to increase the number of opportunities by one unit and prompt the user when the user's account assets increase by one of the opportunity costs; and to execute the liquidation process and stop the opportunity risk control early warning for the account assets when the number of opportunities is 0.
[0188] It should be noted that the implementation principle of the aforementioned risk control warning device 110 based on opportunity cost can refer to the implementation principle of the aforementioned risk control warning method based on opportunity cost, which will not be repeated here. It should be understood that the division of the various modules of the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into a physical entity, or physically separated. And these modules can all be implemented in the form of software called by processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software called by processing elements, and some modules can be implemented in the form of hardware. For example, the risk control warning device 110 based on opportunity cost can be a separately established processing element, or it can be integrated in a chip of the above device. In addition, it can also be stored in the memory of the above device in the form of program code, and called and executed by a processing element of the above device. The function of the risk control warning device 110 based on opportunity cost. The implementation of other modules is similar. In addition, all or part of these modules can be integrated together, or they can be implemented independently. The processing element described here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each module above can be completed by an integrated logic circuit of hardware in a processor element or an instruction in the form of software.
[0189] For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more microprocessors (digital signal processors, DSP), or one or more field programmable gate arrays (FPGA), etc. For another example, when a module above is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0190] The embodiment of the present invention provides a computer device 100, which includes a processor and a non-volatile memory storing computer instructions. When the computer instructions are executed by the processor, the computer device 100 executes the aforementioned risk control warning device 110 based on opportunity cost. Figure 3 As shown, Figure 3 The computer device 100 provided in the embodiment of the present invention is a structural block diagram. The computer device 100 includes a risk control warning device 110 based on opportunity cost, a memory 111, a processor 112 and a communication unit 113.
[0191] To achieve data transmission or interaction, the memory 111, the processor 112 and the communication unit 113 are electrically connected to each other directly or indirectly. For example, these elements can be electrically connected to each other through one or more communication buses or signal lines. The risk control and early warning device 110 based on opportunity cost includes at least one software function module that can be stored in the memory 111 in the form of software or firmware or solidified in the operating system (OS) of the computer device 100. The processor 112 is used to execute the risk control and early warning device 110 based on opportunity cost stored in the memory 111, such as the software function modules and computer programs included in the risk control and early warning device 110 based on opportunity cost.
[0192] An embodiment of the present invention provides a readable storage medium, which includes a computer program. When the computer program is running, it controls the computer device where the readable storage medium is located to execute the aforementioned risk control and early warning device 110 based on opportunity cost.
[0193] For illustrative purposes, the foregoing description is made with reference to specific embodiments. However, the above illustrative discussion is not intended to be exhaustive or to limit the present disclosure to the precise form disclosed. Numerous modifications and variations are possible in accordance with the above teachings. These embodiments are selected and described in order to best illustrate the principles of the present disclosure and its practical application, so that those skilled in the art can best utilize the present disclosure and utilize various embodiments with different modifications to suit the intended specific application.
Claims
1. A risk control early warning method based on opportunity cost, characterized in that: include: Obtain the stop loss ratio input by the user, and calculate the stop loss value corresponding to the stop loss ratio; Obtain the number of opportunities for the user under the current risk control structure, and calculate the opportunity cost corresponding to the number of opportunities; When the user's account assets are reduced by one of the opportunity costs, liquidation processing is performed and the number of opportunities is reduced by one unit; When the user's account assets increase by one of the opportunity costs, the number of opportunities increases by one unit and the user is prompted; When the number of opportunities is 0, the liquidation process is performed and the opportunity risk control warning for the account assets is stopped.
2. The method according to claim 1, characterized in that The obtaining the number of opportunities of the user under the current risk control structure and calculating the opportunity cost corresponding to the number of opportunities includes: Obtain the number of opportunities for the user under the current risk control structure; Obtaining the position information of the account assets, wherein the position information includes multiple contracts; According to the buying index of each of the contracts and the daily line data of the main contract within the preset period range, the maximum increase or decrease of the account assets at the preset time node is calculated, and the profit probability and loss probability corresponding to each of the contracts are determined according to the maximum increase or decrease; The account odds are calculated based on the profit probability and the loss probability; According to the account odds corresponding to each of the contracts, the loss amount of the account assets at a preset time point is calculated; The undetermined opportunity cost is obtained by dividing the absolute value of the stop loss value by the number of opportunities; The larger of the loss amount and the undetermined opportunity cost shall be taken as the opportunity cost.
3. The method according to claim 2, characterized in that The buying indicators include the price fluctuation, trading volume and volume-price ratio. The maximum price fluctuation of the account assets at the preset time node is calculated based on the buying indicators of each contract and the daily line data of the main contract in the preset period range, and the profit probability and loss probability corresponding to each contract are determined according to the maximum price fluctuation, including: Obtain the similarity times of the indicators of the rise and fall, trading volume and volume-price ratio of each of the contracts; According to the daily line data of the main contract in the preset period range, the maximum increase or decrease of the account assets at the preset time node is calculated, and the number of profitable times is determined according to the maximum increase or decrease; The profit probability is obtained by dividing the number of profit times by the number of indicator similarities, and the complementary number of the profit probability is used as the loss probability.
4. The method according to claim 2, characterized in that: The calculating the account odds according to the profit probability and the loss probability includes: Get the asset ratio of each of the contracts; The account odds are calculated based on the asset ratio, the profit probability and the loss probability by the formula: f=(bp-q) / b; Among them, f is the asset ratio, p is the profit probability, q is the loss probability, and b is the odds.
5. The method according to claim 2, characterized in that: The calculating the loss amount of the account assets at a preset time point according to the account odds corresponding to each of the contracts includes: Obtaining the occupied funds of a target contract, where the target contract is any one of multiple contracts; Calculate and obtain the product of the occupied funds of the target contract and the account odds; The difference between the multiplication result and the occupied funds of the target contract is taken as the profit or loss result of the target contract; The profit and loss results corresponding to each of the contracts are accumulated and summed to calculate the loss amount of the account assets at the preset time node.
6. The method according to claim 1, characterized in that The method further comprises: Provide a user interface to display the current number of opportunities, opportunity costs, account asset status, and risk control warning status; When the number of opportunities approaches or reaches 0, a high-level warning signal is issued through the user interface, and a preset adjustment of the investment strategy or a preset increase in margin operation is executed.
7. The method according to claim 1, characterized in that The method further comprises: When executing the liquidation process, a liquidation notification is sent to the user, and the liquidation notification includes the liquidation reason and the current account asset status.
8. A risk control early warning device based on opportunity cost, characterized in that: include: The acquisition module is used to acquire the stop loss ratio input by the user, calculate the stop loss value corresponding to the stop loss ratio; acquire the number of opportunities of the user under the current risk control structure, and calculate the opportunity cost corresponding to the number of opportunities; The early warning module is used to execute the liquidation process and reduce the number of opportunities by one unit when the user's account assets decrease by one of the opportunity costs; increase the number of opportunities by one unit and prompt the user when the user's account assets increase by one of the opportunity costs; and execute the liquidation process and stop the opportunity risk control early warning for the account assets when the number of opportunities is 0.
9. A computer device, characterized in that: The computer device comprises a processor and a non-volatile memory storing computer instructions. When the computer instructions are executed by the processor, the computer device executes the method according to any one of claims 1 to 7.
10. A readable storage medium, characterized in that: The readable storage medium includes a computer program, and when the computer program is executed, the computer device where the readable storage medium is located is controlled to execute the method according to any one of claims 1 to 7.