CN112669145A - Stock trading strategy construction method, system, equipment and medium based on dynamic threshold - Google Patents

Stock trading strategy construction method, system, equipment and medium based on dynamic threshold Download PDF

Info

Publication number
CN112669145A
CN112669145A CN202011445609.1A CN202011445609A CN112669145A CN 112669145 A CN112669145 A CN 112669145A CN 202011445609 A CN202011445609 A CN 202011445609A CN 112669145 A CN112669145 A CN 112669145A
Authority
CN
China
Prior art keywords
dynamic threshold
asset
day
stock
operation direction
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011445609.1A
Other languages
Chinese (zh)
Inventor
刘薇
蒋泓毅
姜青山
谭忠
陈会
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiamen University
Shenzhen Institute of Advanced Technology of CAS
Original Assignee
Xiamen University
Shenzhen Institute of Advanced Technology of CAS
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xiamen University, Shenzhen Institute of Advanced Technology of CAS filed Critical Xiamen University
Priority to CN202011445609.1A priority Critical patent/CN112669145A/en
Publication of CN112669145A publication Critical patent/CN112669145A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The invention provides a method, a system, equipment and a medium for constructing a stock trading strategy based on a dynamic threshold value. The method comprises the following steps: receiving stock trading data; preprocessing the data of the stock transaction data; identifying the asset operation direction of the preprocessed stock transaction data based on the dynamic threshold; and constructing a transaction strategy by utilizing a probability model according to the asset operation direction. The invention provides a stock investment strategy model with strong systematicness and high comprehensiveness to assist investors in making investment decisions, the investors can obtain the asset operation direction of a certain stock and the specific asset transaction proportion, and the investors can obtain stock parameters and related investment suggestions without calculation, so that the investment strategy is more scientific and reasonable.

Description

Stock trading strategy construction method, system, equipment and medium based on dynamic threshold
Technical Field
The invention relates to the field of stock investment, in particular to a method, a system, equipment and a medium for constructing a stock trading strategy based on a dynamic threshold value.
Background
The investment is to obtain a larger profit, however, the profit of the investment is often proportional to the risk, and the higher the profit of the investment, the greater the risk. The operation of stock assets often determines the income of investors, and the operation research aiming at the stock assets needs to have higher prospective and strategic properties. Effective risk prediction and correct trading strategy can avoid risks to the greatest extent and increase investment income. How to avoid risks and obtain benefits is the most concerned of investors.
In the prior art, a Fixed-Threshold method (Fixed-Threshold) is generally used for labeling stocks. The fixed threshold method is characterized in that a threshold value is set for a specific stock, and the price income of the stock in a fixed time interval is higher than the set threshold value and is marked as a positive example; if the price profit in the fixed time interval is lower than a certain set threshold value, marking as a negative example; if in between, then labeled as other classes. However, the threshold set in the fixed threshold method is always constant, while the price fluctuation rate varies with time. If the fluctuation rate is greatly changed, a large number of positive examples and negative examples and a small number of other classes exist; if the fluctuation ratio variation is small, there will be a large number of other classes, a small number of positive and negative examples. Therefore, the fixed threshold cannot change with the change of the fluctuation rate, and the stocks are difficult to be scientifically and accurately labeled.
The prior art is usually only limited to buying, selling and holding, namely, the prediction is only carried out on the operation direction of the assets, and an investor cannot know how much assets need to be traded in each operation. It is a big pain point of the existing stock forecasting method to only forecast the operation direction of the assets but not the transaction proportion of the assets.
In addition, in the prior art, a reasonable prediction model is lacked for the stock investment to assist investors in making investment decisions, the investors often need to acquire operation directions according to one stock trading strategy and then acquire the number of operated assets through another stock trading strategy, different stock trading strategies may not be compatible with each other, and the investors cannot scientifically and effectively acquire specific investment strategies.
Therefore, a systematic and comprehensive stock investment strategy model is needed to assist investors in making investment decisions, and the investors can acquire the asset operation direction of a certain stock and the specific asset transaction proportion, so that the investment strategy is more scientific and reasonable.
Disclosure of Invention
Based on the problems in the prior art, the invention provides a method, a system, equipment and a medium for constructing a stock trading strategy based on a dynamic threshold value. The specific technical scheme is as follows:
a stock trading strategy construction method based on a dynamic threshold value comprises the following steps: receiving stock trading data; preprocessing the data of the stock transaction data; identifying the asset operation direction of the preprocessed stock transaction data based on the dynamic threshold; and constructing a transaction strategy by utilizing a probability model according to the asset operation direction.
Specifically, the "identifying the asset operation direction of the preprocessed stock transaction data based on the dynamic threshold" specifically includes: acquiring the daily profitability of the stocks according to the preprocessed stock trading data; obtaining a standard deviation of the exponential moving weighted average fluctuation rate according to the profitability, and taking the standard deviation of the exponential moving weighted average fluctuation rate as a dynamic threshold, wherein the dynamic threshold comprises an upper dynamic threshold and a lower dynamic threshold; acquiring an asset holding time limit; and acquiring the asset operation direction according to the dynamic threshold value and the asset holding time limit of the current day based on the income rate of the current day of the stock.
More specifically, the "obtaining the asset operation direction of the current day according to the dynamic threshold value of the current day and the asset holding time limit based on the profitability of the current day of the stock" specifically includes: if the yield rate of the current day is higher than the upper dynamic threshold value of the current day, the asset operation direction of the current day is buying; if the yield rate of the current day is lower than the lower dynamic threshold value of the current day, the asset operation direction of the current day is selling; if the yield rate of the current day is between the upper dynamic threshold and the lower dynamic threshold of the current day and the time limit of the asset holding time is reached, the asset operation direction of the current day is selling; if the yield rate of the day is between the upper and lower dynamic thresholds of the day and the asset holding time limit is not reached, then the asset operating direction of the day is holding.
More specifically, the expression of the asset operating direction is:
Figure RE-GDA0002966199090000031
wherein the signaltThe direction of operation of the asset on day t, thredsholdtIs the dynamic threshold for the t-th day,
Figure BDA0002831123140000032
is the upper dynamic threshold for the t-th day,
Figure BDA0002831123140000033
lower dynamic threshold for day t, xtThe profitability on day T, T is the asset holding time period.
More specifically, the calculation formula of the dynamic threshold is as follows:
Figure BDA0002831123140000034
among them, thresholdtDynamic threshold for day t, N is number of transaction days in time interval, ytIs the magnitude of the exponentially weighted moving average for the t-th day in the time interval, mu is the average of the magnitudes of the exponentially weighted moving averages in the time interval, t is the number of days in the time interval,
the formula for calculating the exponentially weighted moving average is:
yt=(1-α)yt-1+αxt
wherein, ytExponentially weighting shifts for day tMagnitude of the mean, yt-1Is the exponentially weighted moving average size of the t-1 th day, alpha is the decay rate, xtThe yield of the day t is;
the attenuation rate α is calculated by the formula:
Figure BDA0002831123140000035
wherein span is a set time interval;
rate of return xtThe calculation formula of (2) is as follows:
Figure BDA0002831123140000036
wherein x istThe amount of the yield rate on the t day,
Figure BDA0002831123140000041
the closing price of the t-th day,
Figure BDA0002831123140000042
opening price for the t day;
the calculation formula of the upper dynamic threshold is as follows:
Figure BDA0002831123140000043
wherein,
Figure BDA0002831123140000044
upper dynamic threshold for day t, thredsholdtA dynamic threshold for day t;
the calculation formula of the lower dynamic threshold is as follows:
Figure BDA0002831123140000045
wherein,
Figure BDA0002831123140000046
lower dynamic threshold for day t, thredsholdtDynamic threshold for day t.
Specifically, the data preprocessing comprises data visualization, missing value padding and date feature construction.
More specifically, the data visualization comprises visualization processing of stock trading data through a stock K-line graph;
and/or the missing value padding comprises padding the missing stock transaction data with 0.
Specifically, the "building a transaction policy using a probabilistic model according to the asset operation direction" specifically includes: constructing a secondary label according to the asset operation direction, wherein the secondary label is used for indicating whether a transaction is carried out according to the asset operation direction; predicting the secondary label by adopting a probability model to obtain a prediction probability; and constructing a trading strategy according to the prediction probability, wherein the trading strategy comprises an asset trading proportion.
More specifically, the "constructing a secondary tag according to the asset operation direction" specifically includes:
Figure BDA0002831123140000047
wherein, yndThe label is a secondary label, and the signal is the asset operation direction;
when the secondary label is 1, the transaction is carried out according to the asset operation direction;
when the secondary label is 0, it indicates that the transaction is not performed according to the asset operation direction.
More specifically, the probability model is a random forest model; the calculation formula of the probability prediction output by the random forest model is as follows:
Figure BDA0002831123140000051
wherein Prob is random forest inputThe predicted probability, K is the number of classification models,
Figure BDA0002831123140000052
is the ith secondary label, i is the ith classification model.
More specifically, the "constructing a trading strategy according to the prediction probability, the trading strategy including an asset trading ratio" specifically includes: if the prediction probability is larger than 75%, buying or selling the assets with the asset transaction proportion of 25% -40%; if the prediction probability is more than 40% and not more than 75%, buying or selling the assets with the asset transaction proportion of 5% -10%; and if the prediction probability is not more than 40%, the asset trading proportion is 0%, and no trading operation is carried out.
Further, obtaining an effect evaluation for evaluating the effect of the method.
Specifically, the effect evaluation includes model evaluation, which evaluates the method by obtaining an accuracy of the probabilistic model.
More specifically, the calculation formula of the accuracy is as follows:
Figure BDA0002831123140000053
wherein P is the accuracy of the probability model,
Figure BDA0002831123140000054
predicts an accurate number of secondary labels for the probabilistic model,
Figure BDA0002831123140000055
is the number of all secondary labels in the test set.
Specifically, the effect evaluation includes application evaluation, and the application evaluation evaluates the method by acquiring a policy profitability and an annual profitability of the method.
More specifically, the calculation formula of the strategy yield rate is as follows:
Figure BDA0002831123140000056
wherein, return _ rate is strategy yield, profit is investment income, and principal is principal;
the calculation formula of the annual profitability is as follows:
Figure BDA0002831123140000061
wherein ann _ rate is annual rate of return, profit is return on investment, principal is principal, and days is number of days on trade.
A stock trading strategy construction system based on dynamic threshold is applicable to the method, and comprises the following steps: a receiving unit: for receiving stock trading data; a pretreatment unit: the system is used for preprocessing the data of the stock transaction data; an identification unit: the system is used for identifying the asset operation direction of the stock transaction data processed by the preprocessing unit according to the dynamic threshold value; a construction unit: and the system is used for constructing a transaction strategy by utilizing a probability model according to the asset operation direction.
Furthermore, an effect evaluation unit is included for obtaining an effect evaluation of the system.
Specifically, the identification unit includes: a yield acquisition unit: the system is used for acquiring the daily profitability of the stocks according to the stock transaction data processed by the preprocessing unit; a dynamic threshold acquisition unit: the standard deviation of the exponential moving weighted average fluctuation rate is obtained through the yield rate, and the standard deviation of the exponential moving weighted average fluctuation rate is used as a dynamic threshold, wherein the dynamic threshold comprises an upper dynamic threshold and a lower dynamic threshold; holding period acquisition unit: for obtaining an asset holding time limit; an asset operation direction acquisition unit: the method is used for acquiring the asset operation direction according to the dynamic threshold value of the current day and the asset holding time period based on the profitability of the current day of the stock.
Specifically, the construction unit includes: a secondary label construction unit: the system comprises an identification unit, a first label and a second label, wherein the identification unit is used for identifying the asset operation direction of the transaction; a prediction probability acquisition unit: the probability model is used for predicting the secondary label to obtain a prediction probability; the transaction strategy construction unit: for constructing a trading strategy based on the predicted probability, the trading strategy comprising an asset trading proportion.
Specifically, the preprocessing unit includes: a visualization unit: the system is used for providing a stock K line graph to perform visualization processing on stock transaction data; missing value padding unit: for filling missing stock exchange data with 0; a date characteristic construction unit: for constructing a date signature.
A computer device, the computer device comprising: one or more processors; a memory for storing one or more programs; when executed by the one or more processors, cause the one or more processors to implement a dynamic threshold-based stock trading strategy construction method as described above.
A computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the dynamic threshold-based stock trading strategy construction method as described above.
The invention has the following beneficial effects: the stock investment operation of the investor is guided by establishing a stock trading strategy model. By setting a dynamic threshold value, the threshold value can change in real time along with the price fluctuation rate; scientifically and reasonably acquiring the asset operation direction by combining the dynamic threshold with the asset holding time limit; the forecasting probability is obtained through the probability model, and then the asset trading proportion is obtained, so that the defect that the stock trading strategy only provides an operation direction but not a specific operation amount in the prior art is overcome; and by setting effect evaluation, investment parameters such as stock income and the like can be conveniently acquired. The method is embodied and applied to a specific system to form a stock investment strategy model with strong systematicness and high comprehensiveness to assist investors in making investment decisions, the investors can obtain the asset operation direction of a certain stock and the specific asset transaction proportion, and can obtain various stock parameters and investment suggestions without calculation, so that the investment strategy is more scientific and reasonable. The stock trading strategy construction method is applied to specific computer equipment and computer storage media, and the method is embodied and has important significance for development of stock trading strategies.
The invention provides a method, a system, equipment and a medium for constructing a stock trading strategy based on a dynamic threshold value according to the defects of the prior art.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
FIG. 1 is a flow chart of a method for constructing a stock trading strategy according to an embodiment of the present invention;
FIG. 2 is a flow chart of an initialization part of a stock trading strategy construction method according to an embodiment of the present invention;
FIG. 3 is a schematic flow chart of a method for constructing a stock trading strategy according to an embodiment of the present invention, for obtaining an asset operation direction;
FIG. 4 is a flow chart of a part of a method for constructing a stock trading strategy according to an embodiment of the present invention;
FIG. 5 is a diagram of a random forest principle of a stock trading strategy construction method according to an embodiment of the present invention;
fig. 6 is a visual effect diagram of a specific application of the stock trading strategy construction method according to the embodiment of the present invention;
FIG. 7 is an asset operation direction diagram of a specific application of the stock trading strategy construction method according to the embodiment of the present invention;
FIG. 8 is a block diagram of a stock trading strategy construction system according to an embodiment of the present invention;
FIG. 9 is a block diagram of a stock trading strategy construction system according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of applying a stock trading strategy construction method to a computer device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more clearly apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The invention provides a method, a system, equipment and a medium for constructing a stock trading strategy based on a dynamic threshold, which overcome the defect that only an asset operation direction can be obtained but a specific asset investment proportion cannot be obtained in the prior art.
Example 1
Aiming at the defects of the prior art, the embodiment provides a stock trading strategy construction method based on a dynamic threshold value. The specific scheme is as follows:
a stock trading strategy construction method based on a dynamic threshold value obtains a trading strategy through stock trading data. The specific content comprises the following steps: 101. receiving stock trading data; 102. preprocessing data, namely preprocessing stock transaction data, wherein the preprocessing comprises visualization processing, missing value filling and date characteristic construction; 103. identifying an asset operation direction, and acquiring the asset operation direction by utilizing a dynamic threshold value for the preprocessed stock transaction data; 104. and (4) establishing a trading strategy, namely establishing a trading strategy of the stock by combining a probability model according to the asset operation direction. Further comprising: 105. and obtaining effect evaluation for evaluating the application effect. The specific method flow chart is shown in the specification and attached figure 1.
Specifically, stock trading data is first received. Stock trading data includes data published from stock trades available on the network. Stock trading data may be user-entered and may be entered by other channels.
Specifically, data preprocessing is performed on stock trading data. As shown in fig. 2, the data preprocessing is mainly divided into three parts: data visualization, missing value filling and date feature construction. And the acquired advanced data of the stock transaction data is processed visually so as to provide visual and clear understanding for the data. Through data visualization, information such as price trend change, trading quantity change and the like of stocks in a specified time interval can be intuitively and accurately observed. In this embodiment, the stock K-line graph is mainly used to perform data visualization processing on stock trading data. Through the stock K-line graph, the market condition expression of the stocks in a certain day or a certain period can be intuitively acquired. And then, filling missing values of the visualized data. Stock trading data may generate missing data due to lack of data on a certain trading day, closing of a market on holidays, stock stop, and the like. For missing values, we adopt attitude respecting the fact and fill the missing values with 0. Finally, a date feature is constructed. The date characteristics are constructed by the platform firm, so that the stock transaction data not only have the characteristics of opening price, highest price, lowest price, closing price, transaction amount, transaction quantity, hand-changing rate, transaction state, fluctuation amplitude and the like, but also have the date characteristics.
Specifically, for the preprocessed stock transaction data, the asset operation direction is obtained by using a dynamic threshold value method. Asset operation directions include buy, sell, and hold. In particular, the present embodiment provides a path-dependent method based on dynamic threshold to determine the asset operation direction, aiming at the disadvantage that the solid state threshold cannot change with the change of the fluctuation rate in the prior art. The specific flow is shown in figure 3 in the specification.
First, the daily profitability of the stock is calculated. And calculating the daily profitability of the stocks according to the preprocessed stock trading data, and providing a basis for calculating a dynamic threshold value and judging the asset operation direction. The calculation formula of the daily profit rate of the stock is as follows:
Figure BDA0002831123140000101
wherein x istThe amount of the yield rate on the t day,
Figure BDA0002831123140000102
the closing price of the t-th day,
Figure BDA0002831123140000103
the opening price of the t day.
Second, a dynamic threshold is calculated based on the daily profitability of the stock. In order to solve a series of problems caused by solid state threshold value to stock labeling, the embodiment provides a dynamic threshold value method, and the standard deviation of the exponential moving weighted average fluctuation rate calculated in a time interval is used as the dynamic threshold value. The dynamic threshold comprises an upper dynamic threshold and a lower dynamic threshold, wherein the upper dynamic threshold is the standard deviation of the exponential moving weighted average fluctuation rate, and the lower dynamic threshold is the negative value of the standard deviation of the exponential moving weighted average fluctuation rate. The index moving weighted average fluctuation rate reflects the stock fluctuation trend of the stocks in different periods. If the return rate of the stock exceeds the standard deviation of the exponential moving weighted average fluctuation rate, the stock will rise and fall, if the return rate of the stock is lower than the negative value of the exponential moving weighted average fluctuation rate standard deviation, namely, if the return rate exceeds the upper dynamic threshold, the stock will rise, and if the return rate is lower than the lower dynamic threshold, the stock will fall. One of the major characteristics of the exponentially weighted moving average fluctuation rates is that the near term yield is weighted more heavily than the far term. The calculation formula of the exponentially weighted moving average is as follows:
y0=x0
yt=(1-α)yt-1+αxt
wherein, y0Exponentially weighting the moving average, x, for day zero0The amount of yield on day zero, ytExponentially weighting the magnitude of the moving average, y, for day tt-1The exponential weighted moving average value of the t-1 th day, alpha is the decay rate, and the calculation formula of alpha is as follows:
Figure BDA0002831123140000111
where α is the attenuation factor, span is the set time interval, and t is 0,1, …, span. Rate of return x on day ttThe calculation formula of (a) is as follows:
Figure BDA0002831123140000112
wherein x istThe amount of the yield rate on the t day,
Figure BDA0002831123140000113
the closing price of the t-th day,
Figure BDA0002831123140000114
the opening price of the t day.
The dynamic threshold is a standard deviation of the exponential weighted average moving fluctuation rate in the time interval, and the calculation formula is as follows:
Figure BDA0002831123140000115
among them, thresholdtIs the dynamic threshold of the t day, N is the number of transaction days in the time interval, ytThe size of the exponentially weighted moving average on the tth day in the time interval is shown, μ is the average of the exponentially weighted moving average sizes in the time interval, and t is the number of days in the time interval, where t is 1,2, …, N.
The upper dynamic threshold on day t is then:
Figure BDA0002831123140000116
wherein,
Figure BDA0002831123140000117
upper dynamic on day tThreshold, thresholdtDynamic threshold for day t.
Then the lower dynamic threshold on day t is:
Figure BDA0002831123140000118
wherein,
Figure BDA0002831123140000119
lower dynamic threshold for day t, thredsholdtDynamic threshold for day t.
Next, an asset holding time period is set. The financial market is a moving market in which the assets of stocks held by investors belong to. If the investment investor does not have a signal for operation in a long time through technical means, at the moment, the rational investor does not always hold the assets, but actively sells the assets after holding for a period of time. And the set asset holding time period T is: the technical indicators do not indicate to the investor to operate on the property for consecutive days T, i.e. on the tth day, the investor actively sells the property. I.e., the asset directions are all 0 for consecutive T days.
And finally, acquiring the asset operation direction according to the asset holding time limit and the dynamic threshold. The core idea of the asset operation direction identification method is as follows: (1) respectively calculating a daily rate of return, an upper dynamic threshold and a lower dynamic threshold, and setting an asset holding time limit; (2) and comparing the yield rate of the current day with the upper dynamic threshold value and the lower dynamic threshold value, and judging the asset operation direction by judging whether the time limit of the asset holding is reached. According to the two ideas, the asset operation direction is identified in a partition mode. Specifically, the upper dynamic threshold is considered to be an upper bay, the lower dynamic threshold is considered to be a lower bay, and the asset holding time period is considered to be a vertical bay. The expression for the dynamic threshold is:
Figure BDA0002831123140000121
wherein the signaltThe direction of operation of the asset for t days, thredsholdtIs the dynamic threshold value of the t-th day,
Figure BDA0002831123140000122
is the upper dynamic threshold for the t-th day,
Figure BDA0002831123140000123
lower dynamic threshold for day t, xtThe value of the yield rate on the T day, and T is the period of the asset holding time. If the yield rate on the same day breaks through the upper partition, the asset operation direction is considered as buying, namely, the current day is marked as 1; if the yield rate on the same day breaks through the lower partition, the asset operation direction is considered to be selling, namely, the current day is marked as-1; if the yield rate of the current day does not break through the upper and lower barriers and the vertical barrier, the asset operation direction is considered to be held, and the current day is marked as 0; and if the yield rate of the current day does not break through the upper and lower barriers but touches the vertical barrier, the asset operation direction is considered to be sale, namely, the current day is marked as-1. Namely: if the yield rate of the current day is higher than the upper dynamic threshold value of the current day, the asset operation direction of the current day is buying; if the yield rate of the current day is lower than the lower dynamic threshold value of the current day, the asset operation direction of the current day is selling; if the yield rate of the current day is between the upper dynamic threshold and the lower dynamic threshold of the current day, but the time limit of the asset holding time is reached, the asset operation direction of the current day is selling; if the yield rate of the day is between the upper and lower dynamic thresholds of the day and the asset holding time limit is not reached, then the asset operating direction of the day is holding.
Specifically, a trading strategy is obtained through a probabilistic model based on asset operating directions. The asset operation direction identification method based on path dependence only identifies the asset operation direction, but does not give the size of the investor operating the asset. According to the obtained asset operation direction, acquiring an asset transaction proportion by combining a probability model, wherein the specific contents comprise: firstly, constructing a secondary label, wherein the secondary label is used for indicating whether the operation is carried out according to the asset operation direction, then predicting the secondary label by adopting a random forest model, outputting the prediction probability, and constructing a transaction strategy according to the prediction probability of the secondary label. The specific flow is shown in figure 4 in the specification.
First, a secondary tag for determining whether a transaction operation is performed at a specific time point, specifically, whether an asset operation is performed according to an asset operation direction, is constructed according to the asset operation direction. Specifically, the construction of the secondary label is carried out according to the following rules:
Figure BDA0002831123140000131
wherein, yndThe label is a secondary label, and the signal is the asset operation direction;
when the secondary label is 1, the transaction is carried out according to the asset operation direction;
when the secondary label is 0, it indicates that the transaction is not performed according to the asset operation direction.
And secondly, predicting the secondary label by adopting a probability model to obtain a prediction probability, and constructing a transaction strategy by utilizing the prediction probability. Preferably, the probabilistic model adopted in the present embodiment is a random forest model. The random forest is an idea of integrating a plurality of trees through an integration idea, a basic unit of the random forest is a decision tree, and a flow chart of a random forest algorithm is shown in an attached figure 5 in the specification. And when a certain sample needs to be predicted, counting the prediction results of each tree in the forest on the sample, and selecting the final result from the prediction results by a voting method. Random population now has two aspects, one is random sampling and the other is random sampling, which allows each tree in the forest to have both similarity and difference. Predicting the secondary label by adopting a random forest model, wherein the generation rule of the tree comprises the following steps: (1) if the training set size of the secondary label is N, for each tree, randomly and repeatedly extracting N training samples from training to serve as the training set of the tree, and repeating for K times to generate K groups of training sample sets; (2) if the sample dimension of each feature is M, a constant M far smaller than M is designated, and M features are randomly selected from the M features; (3) each tree was grown to the greatest extent possible with m features and no pruning process was performed. And then constructing K classification models for classification, and determining the optimal classification through voting. Because the trees can be trained in parallel, the random forest has higher operation efficiency and accuracy. Moreover, the random forest can process high-dimensional features without dimension reduction, and a measuring method of feature importance is provided. Furthermore, the random forest model can balance errors for data that are not class balanced. The prediction probability calculation formula of the random forest output is as follows:
Figure BDA0002831123140000141
wherein Prob is the prediction probability of random forest output, K is the number of classification models,
Figure BDA0002831123140000142
i is the ith secondary label, i is the ith classification model, i is 1,2, …, K.
And finally, constructing an interaction strategy according to the prediction probability. The trading strategy comprises an asset trading proportion, and the size of the investment asset is measured by the asset trading proportion. The specific content comprises the following steps: if the prediction probability is larger than 75%, buying or selling the assets with the asset transaction proportion of 25% -40%; if the prediction probability is more than 40% and not more than 75%, buying or selling the assets with the asset transaction proportion of 5% -10%; and if the prediction probability is not more than 40%, the asset trading proportion is 0%, and no trading operation is performed.
In addition, the method is also provided with effect evaluation for evaluating the effect of the method. Preferably, the present embodiment performs the effect evaluation from both the model evaluation and the actual application evaluation. The model evaluation evaluates the calculation accuracy of the secondary label test set through a probability model, and the actual application evaluation is evaluated through two aspects of strategy yield and annual yield. Wherein, the calculation formula of the accuracy is as follows:
Figure BDA0002831123140000143
wherein,
Figure BDA0002831123140000144
predicting the number of accurate secondary labels for the random forest,
Figure BDA0002831123140000145
for all secondary label quantities of the test set, P is the model accuracy.
And performing simulated transaction on the test data set according to the method to obtain strategy yield and annual yield, and performing actual application evaluation according to the two indexes. The strategy yield rate calculation formula is as follows:
Figure BDA0002831123140000151
wherein, return _ rate is the strategy yield, profit is the investment yield, and principal is the principal.
The calculation formula of the annual yield rate is as follows:
Figure BDA0002831123140000152
wherein ann _ rate is annual rate of return, profit is return on investment, principal is principal, days on trade, 365 is 365 days per year.
In order to verify the feasibility of the stock trading strategy construction method provided by the embodiment, the method is used for carrying out experiments, and the experiment contents specifically comprise:
selecting a Pufa bank (stock code: 600000.SH) listed on the Shanghai stock exchange as a research object, and researching the stock transaction data in a time interval of 1/4/2000 to 12/31/2019. The stock transaction data of the research object is subjected to data preprocessing, asset operation directions are identified through a path dependence mode, simulated transaction is carried out through a random forest based transaction strategy, and finally method effectiveness verification is carried out through model evaluation and practical application evaluation.
In the data preprocessing phase, the target stock trading data is first visualized to give the investor a more intuitive understanding of the stock. The result of stock Puissue Bank (600000.SH) after visualization is shown in figure 6 of the specification:
the asset holding time limit parameter is set to 15 days and the operating direction of the stock issuing bank (600000.SH) is identified, with the result shown in fig. 7.
And constructing a trading strategy by using a random forest-based method. Setting initial starting fund as 10000 yuan, simulating the transaction from 12 and 2 days in 2019 to 12 and 31 days in 2019, and then evaluating the result as the following table 1:
TABLE 1 index evaluation results
Figure BDA0002831123140000153
Figure BDA0002831123140000161
The evaluation result shows that the method provided by the embodiment is scientific and reasonable, and can assist investors to obtain scientific and reasonable asset operation directions and asset transaction strategies.
The embodiment provides a stock trading strategy construction method based on a dynamic threshold, which guides the stock investment operation of an investor by establishing a stock trading strategy model. By setting a dynamic threshold value, the threshold value can change in real time along with the price fluctuation rate; scientifically and reasonably acquiring the asset operation direction by combining the dynamic threshold with the asset holding time limit; the forecasting probability is obtained through the probability model, and then the asset trading proportion is obtained, so that the technical problem that the stock trading strategy only provides an operation direction but not a specific operation fund proportion in the prior art is solved; and by setting effect evaluation, investment parameters such as stock income and the like can be conveniently acquired.
Example 2
The embodiment provides a stock trading strategy construction system based on a dynamic threshold value aiming at the method provided by the embodiment 1, and is suitable for the stock trading strategy construction method based on the dynamic threshold value provided by the embodiment 1. A stock trading strategy construction system based on a dynamic threshold value comprises the following specific contents:
the stock trading strategy building system based on the dynamic threshold comprises a receiving unit, a preprocessing unit, an identification unit and a building unit. The receiving unit is used for receiving stock trading data; the preprocessing unit is used for preprocessing the data of the stock transaction data; the identification unit is used for identifying the asset operation direction of the preprocessed stock transaction data according to the dynamic threshold value; the construction unit is used for constructing a transaction strategy by utilizing the probability model according to the asset operation direction. The effect evaluation unit is used for evaluating the acquisition effect. The concrete structure is shown in figure 8 in the specification
Specifically, the preprocessing unit is used for performing data preprocessing on the stock transaction data. The preprocessing unit is used for preprocessing the data of the original stock transaction data and mainly comprises a visualization unit, a missing value filling unit and a date characteristic construction unit, as shown in the attached figure 9 of the specification. The stock trading data are visualized by the visualization unit through a stock K line graph, so that the data can be visually known, and information such as stock price trend change and trading quantity change in a designated interval can be visually acquired. The missing value filling unit mainly aims at data which is missing due to the lack of data on a certain trading day, closing of a market on holidays, stopping of stocks and the like, adopts attitude of respecting facts for the missing values and fills the missing values with 0. The date characteristic construction unit enables the stock trading data to be more comprehensive and abundant by constructing the date characteristic.
Specifically, the identification unit is used for identifying the asset operation direction of the preprocessed data through a dynamic threshold. The identification unit specifically includes a yield obtaining unit, a dynamic threshold obtaining unit, a holding period obtaining unit, and an asset operation direction obtaining unit, as shown in fig. 9 in the description. The yield obtaining unit is used for obtaining the daily yield of the stocks according to the stock trading data processed by the preprocessing unit and transmitting the obtained yield to the dynamic threshold obtaining unit. The dynamic threshold acquiring unit is used for acquiring the standard deviation of the exponential moving weighted average fluctuation rate through the yield rate, and taking the standard deviation of the exponential moving weighted average fluctuation rate as a dynamic threshold, wherein the dynamic threshold comprises an upper dynamic threshold and a lower dynamic threshold. The holding time limit obtaining unit is used for obtaining an asset holding time limit, and the set asset holding time limit T is as follows: the technical indicators do not indicate to the investor to operate on the property for consecutive days T, i.e. on the tth day, the investor actively sells the property. I.e., the asset directions are all 0 for consecutive T days. The asset operation direction obtaining unit is used for obtaining the asset operation direction according to the dynamic threshold value and the asset holding time period of the current day based on the profitability of the current day of the stock. The upper dynamic threshold is considered an upper bay, the lower dynamic threshold is considered a lower bay, and the asset holding time period is considered a vertical bay. The specific asset operation direction contents are as follows: if the yield rate on the same day breaks through the upper partition, the asset operation direction is considered as buying, namely, the current day is marked as 1; if the yield rate on the same day breaks through the lower partition, the asset operation direction is considered to be selling, namely, the current day is marked as-1; if the yield rate of the current day does not break through the upper and lower barriers and does not touch the vertical barrier, the asset operation direction is regarded as holding, and the current day is marked as 0; if the yield rate does not break through the upper and lower barriers on the same day but touches the vertical barrier, the asset operation direction is considered to be sale, namely, the current day is marked as 0.
Specifically, the construction unit is used for constructing the transaction strategy by applying a probability model according to the asset operation direction. The trading strategy includes the proportion of assets traded, i.e., the percentage of assets traded over the total assets. The construction unit comprises a secondary label construction unit, a prediction probability acquisition unit and a transaction strategy construction unit, as shown in the figure 9 of the specification. The secondary label constructing unit is used for constructing a secondary label according to the asset operation direction acquired by the identification unit, and the secondary label is used for indicating whether to carry out transaction according to the asset operation direction. The prediction probability obtaining unit is used for predicting the secondary label by adopting a probability model to obtain a prediction probability, preferably, the probability model adopts a random forest model, and the output secondary label is predicted by the random forest model to obtain the prediction probability. The transaction strategy construction unit is used for constructing a transaction strategy according to the prediction probability acquired by the prediction probability acquisition unit. The trading strategy comprises an asset trading proportion, and the specific strategy comprises that if the predicted probability Prob is greater than 75%, corresponding operations are carried out by using 25% -40% of funds, including buying or selling; if the prediction probability is 40% < Prob is less than or equal to 75%, carrying out corresponding operations including buying or selling by using 5% -10% of funds; if the prediction probability Prob is less than or equal to 40 percent, the operation is not carried out.
Specifically, the effect evaluation unit is used for obtaining effect evaluation of the system. The effect evaluation unit mainly comprises a model effect evaluation unit and an actual application effect evaluation unit, as shown in the figure 9 in the specification. The system is subjected to effect evaluation in two aspects of models and actual application, the model effect evaluation unit evaluates the calculation accuracy of the test set by acquiring the probability model, and the actual application effect evaluation unit evaluates the effectiveness mainly by acquiring the strategy yield and the annual yield.
In this embodiment, on the basis of embodiment 1, the stock trading strategy construction method based on the dynamic threshold value provided in embodiment 1 is systematized to form a stock trading strategy construction system based on the dynamic threshold value, and the asset operation direction and the asset trading ratio of the stock trading data are identified and confirmed by the system without human analysis, so that an investor can directly obtain a scientific and effective trading strategy through the system. The system provided by the embodiment has the characteristics of strong systematicness and high comprehensiveness, and a plurality of investment strategies are fused into one system to provide a scientific and effective trading strategy for investors.
Example 3
Fig. 10 is a schematic structural diagram of a computer device according to embodiment 3 of the present invention. The computer device 12 shown in FIG. 10 is only an example and should not bring any limitations to the functionality or scope of use of embodiments of the present invention.
As shown in FIG. 10, computer device 12 is embodied in the form of a general purpose computing device. The components of computer device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that couples various system components including the system memory 28 and the processing unit 16. Computer device 12 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by device computer 12 and includes both volatile and nonvolatile media, removable and non-removable media. The system memory 28 may include computer system readable media in the form of volatile memory.
Computer device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display, etc.), with one or more devices that enable a user to interact with computer device 12, and/or with any devices that enable computer device 12 to communicate with one or more other computing devices.
The processing unit 16 executes various functional applications and data processing by executing programs stored in the system memory 28, for example, implementing a dynamic threshold-based stock trading strategy construction method provided in embodiment 1 of the present invention, the method including:
101. receiving stock trading data; 102. data preprocessing, namely preprocessing the data of stock transaction; 103. identifying the asset operation direction, and identifying the asset operation direction of the preprocessed stock transaction data based on the dynamic threshold value; 104. establishing a transaction strategy, namely establishing the transaction strategy by utilizing a probability model according to the asset operation direction; 105. and obtaining effect evaluation. Wherein 102 specifically comprises the steps of performing visualization processing, missing value filling and date characteristic construction on the stock transaction data. 103 specifically comprises: 10301. acquiring the daily profitability of the stocks according to the stock trading data; 10302. acquiring a standard deviation of the exponential moving weighted average fluctuation rate through the yield rate, and taking the standard deviation of the exponential moving weighted average fluctuation rate as a dynamic threshold, wherein the dynamic threshold comprises an upper dynamic threshold and a lower dynamic threshold; 10303, obtaining an asset holding time limit; 10304. and acquiring the asset operation direction according to the dynamic threshold value and the asset holding time limit of the current day based on the income rate of the current day of the stock. 104 specifically comprises: 10401, constructing a secondary label according to the asset operation direction, the secondary label being used for indicating whether to conduct transaction according to the asset operation direction; 10402. predicting the secondary label by adopting a probability model to obtain a prediction probability; 10403. and constructing a trading strategy according to the prediction probability, wherein the trading strategy comprises an asset trading proportion.
The embodiment applies the stock trading strategy construction method based on the dynamic threshold to specific computer equipment, stores the method in the memory, and runs the method to construct the stock trading strategy when the actuator executes the memory, so that the method is fast and convenient to use and has wide application range.
Of course, those skilled in the art will understand that the processor may also implement the technical solution of the stock trading strategy construction method provided by any embodiment of the present invention.
Example 4
This embodiment 4 provides a computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the steps of a dynamic threshold-based stock trading strategy construction method provided by any embodiment of the present invention, the method including:
101. receiving stock trading data; 102. data preprocessing, namely preprocessing the data of stock transaction; 103. identifying the asset operation direction, and identifying the asset operation direction of the preprocessed stock transaction data based on the dynamic threshold value; 104. establishing a transaction strategy, namely establishing the transaction strategy by utilizing a probability model according to the asset operation direction; 105. and obtaining effect evaluation. Wherein 102 specifically comprises the steps of performing visualization processing, missing value filling and date characteristic construction on the stock transaction data. 103 specifically comprises: 10301. acquiring the daily profitability of the stocks according to the stock trading data; 10302. acquiring a standard deviation of the exponential moving weighted average fluctuation rate through the yield rate, and taking the standard deviation of the exponential moving weighted average fluctuation rate as a dynamic threshold, wherein the dynamic threshold comprises an upper dynamic threshold and a lower dynamic threshold; 10303, obtaining an asset holding time limit; 10304. and acquiring the asset operation direction according to the dynamic threshold value and the asset holding time limit of the current day based on the income rate of the current day of the stock. 104 specifically comprises: 10401, constructing a secondary label according to the asset operation direction, the secondary label being used for indicating whether to conduct transaction according to the asset operation direction; 10402. predicting the secondary label by adopting a probability model to obtain a prediction probability; 10403. and constructing a trading strategy according to the prediction probability, wherein the trading strategy comprises an asset trading proportion.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer-readable storage medium may be, for example but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The embodiment applies the stock trading strategy construction method based on the dynamic threshold to a computer readable storage medium, and the computer program is stored on the computer readable storage medium, and when the program is executed by a processor, the steps of the stock trading strategy construction method provided by the invention are realized, so that the method is simple, convenient and quick, is easy to store and is not easy to lose.
In summary, the invention provides a method, a system, equipment and a medium for constructing a stock trading strategy based on a dynamic threshold value, and overcomes the defect that only an asset operation direction can be obtained but a specific asset investment proportion cannot be obtained in the prior art. The stock investment operation of the investor is guided by establishing a stock trading strategy model. By setting a dynamic threshold value, the threshold value can change in real time along with the price fluctuation rate; scientifically and reasonably acquiring the asset operation direction by combining the dynamic threshold with the asset holding time limit; the forecasting probability is obtained through the probability model, and then the asset trading proportion is obtained, so that the defect that the stock trading strategy only provides an operation direction but not a specific operation amount in the prior art is overcome; and by setting effect evaluation, investment parameters such as stock income and the like can be conveniently acquired. The method is embodied and applied to a specific system to form a stock investment strategy model with strong systematicness and high comprehensiveness to assist investors in making investment decisions, the investors can obtain the asset operation direction of a certain stock and the specific asset transaction proportion, and can obtain various stock parameters and investment suggestions without calculation, so that the investment strategy is more scientific and reasonable. The stock trading strategy construction method is applied to specific computer equipment and computer storage media, and the method is embodied and has important significance for development of stock trading strategies.
It will be understood by those skilled in the art that the modules or steps of the invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of computing devices, and optionally they may be implemented by program code executable by a computing device, such that it may be stored in a memory device and executed by a computing device, or it may be separately fabricated into various integrated circuit modules, or it may be fabricated by fabricating a plurality of modules or steps thereof into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments illustrated herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
The above disclosure is only a few specific implementation scenarios of the present invention, however, the present invention is not limited thereto, and any variations that can be made by those skilled in the art are intended to fall within the scope of the present invention.

Claims (23)

1. A stock trading strategy construction method based on a dynamic threshold value is characterized by comprising the following steps:
receiving stock trading data;
preprocessing the data of the stock transaction data;
identifying the asset operation direction of the preprocessed stock transaction data based on the dynamic threshold;
and constructing a transaction strategy by utilizing a probability model according to the asset operation direction.
2. The method of claim 1, wherein the identifying the asset operation direction of the preprocessed stock trading data based on the dynamic threshold specifically comprises:
acquiring the daily profitability of the stocks according to the preprocessed stock trading data;
obtaining a standard deviation of the exponential moving weighted average fluctuation rate according to the profitability, and taking the standard deviation of the exponential moving weighted average fluctuation rate as a dynamic threshold, wherein the dynamic threshold comprises an upper dynamic threshold and a lower dynamic threshold;
acquiring an asset holding time limit;
and acquiring the asset operation direction according to the dynamic threshold value and the asset holding time limit of the current day based on the income rate of the current day of the stock.
3. The method of claim 2, wherein the step of obtaining the current-day asset operation direction according to the current-day dynamic threshold and the current-day asset holding time limit based on the current-day profitability of the stock comprises:
if the yield rate of the current day is higher than the upper dynamic threshold value of the current day, the asset operation direction of the current day is buying;
if the yield rate of the current day is lower than the lower dynamic threshold value of the current day, the asset operation direction of the current day is selling;
if the yield rate of the current day is between the upper dynamic threshold and the lower dynamic threshold of the current day and the time limit of the asset holding time is reached, the asset operation direction of the current day is selling;
if the yield rate of the day is between the upper and lower dynamic thresholds of the day and the asset holding time limit is not reached, then the asset operating direction of the day is holding.
4. The method of claim 3, wherein the expression of the asset operating direction is:
Figure FDA0002831123130000021
wherein the signaltThe direction of operation of the asset on day t, thredsholdtIs the dynamic threshold for the t-th day,
Figure FDA0002831123130000022
is the upper dynamic threshold for the t-th day,
Figure FDA0002831123130000023
lower dynamic threshold for day t, xtThe profitability on day T, T is the asset holding time period.
5. The method of claim 2, wherein the dynamic threshold is calculated by:
Figure FDA0002831123130000024
among them, thresholdtDynamic threshold for day t, N is number of transaction days in time interval, ytIs the magnitude of the exponentially weighted moving average for the t-th day in the time interval, mu is the average of the magnitudes of the exponentially weighted moving averages in the time interval, t is the number of days in the time interval,
the formula for calculating the exponentially weighted moving average is:
yt=(1-α)yt-1+αxt
wherein, ytExponentially weighting the magnitude of the moving average, y, for day tt-1Is the exponentially weighted moving average size of the t-1 th day, alpha is the decay rate, xtThe yield of the day t is;
the attenuation rate α is calculated by the formula:
Figure FDA0002831123130000025
wherein span is a set time interval;
rate of return xtThe calculation formula of (2) is as follows:
Figure FDA0002831123130000026
wherein x istThe amount of the yield rate on the t day,
Figure FDA0002831123130000027
the closing price of the t-th day,
Figure FDA0002831123130000028
opening price for the t day;
the calculation formula of the upper dynamic threshold is as follows:
Figure FDA0002831123130000029
wherein,
Figure FDA00028311231300000210
upper dynamic threshold for day t, thredsholdtA dynamic threshold for day t;
the calculation formula of the lower dynamic threshold is as follows:
Figure FDA0002831123130000031
wherein,
Figure FDA0002831123130000032
lower dynamic threshold for day t, thredsholdtDynamic threshold for day t.
6. The method of claim 1, wherein the data preprocessing comprises data visualization, missing value padding, and date feature construction.
7. The method of claim 6, wherein the data visualization comprises visualization of stock trading data through stock K-line graphs;
and/or the missing value padding comprises padding the missing stock transaction data with 0.
8. The method according to claim 1, wherein the "building a transaction policy using a probabilistic model according to the asset operation direction" specifically comprises:
constructing a secondary label according to the asset operation direction, wherein the secondary label is used for indicating whether a transaction is carried out according to the asset operation direction;
predicting the secondary label by adopting a probability model to obtain a prediction probability;
and constructing a trading strategy according to the prediction probability, wherein the trading strategy comprises an asset trading proportion.
9. The method according to claim 4 or 8, wherein the "constructing a secondary tag according to the asset operation direction" specifically comprises:
Figure FDA0002831123130000033
wherein, yndThe label is a secondary label, and the signal is the asset operation direction;
when the secondary label is 1, the transaction is carried out according to the asset operation direction;
when the secondary label is 0, it indicates that the transaction is not performed according to the asset operation direction.
10. The method of claim 8, wherein the probabilistic model is a random forest model;
the calculation formula of the probability prediction output by the random forest model is as follows:
Figure FDA0002831123130000034
wherein Prob is the prediction probability of random forest output, K is the number of classification models,
Figure FDA0002831123130000041
is the ith secondary label, i is the ith classification model.
11. The method according to claim 8, wherein the "constructing a trading strategy according to the prediction probability, the trading strategy including an asset trading proportion" specifically comprises:
if the prediction probability is larger than 75%, buying or selling the assets with the asset transaction proportion of 25% -40%;
if the prediction probability is more than 40% and not more than 75%, buying or selling the assets with the asset transaction proportion of 5% -10%;
and if the prediction probability is not more than 40%, the asset trading proportion is 0%, and no trading operation is carried out.
12. The method of claim 1, further comprising obtaining an effectiveness assessment for assessing the effectiveness of the method.
13. The method of claim 12, wherein the effect evaluation comprises a model evaluation that evaluates the method by obtaining an accuracy of the probabilistic model.
14. The method according to claim 9 or 13, wherein the accuracy is calculated by the formula:
Figure FDA0002831123130000042
wherein P is the accuracy of the probability model,
Figure FDA0002831123130000043
predicts an accurate number of secondary labels for the probabilistic model,
Figure FDA0002831123130000044
is the number of all secondary labels in the test set.
15. The method of claim 12 or 13, wherein the effectiveness evaluation comprises an application evaluation that evaluates the method by obtaining a policy profitability and an annual profitability of the method.
16. The method of claim 15, wherein the policy profitability is calculated by:
Figure FDA0002831123130000045
wherein, return _ rate is strategy yield, profit is investment income, and principal is principal;
the calculation formula of the annual profitability is as follows:
Figure FDA0002831123130000051
wherein ann _ rate is annual rate of return, profit is return on investment, principal is principal, and days is number of days on trade.
17. A dynamic threshold-based stock trading strategy construction system, adapted to the method of claim 1, comprising:
a receiving unit: for receiving stock trading data;
a pretreatment unit: the system is used for preprocessing the data of the stock transaction data;
an identification unit: the system is used for identifying the asset operation direction of the stock transaction data processed by the preprocessing unit according to the dynamic threshold value;
a construction unit: and the system is used for constructing a transaction strategy by utilizing a probability model according to the asset operation direction.
18. The system of claim 17, further comprising an effectiveness evaluation unit for obtaining an effectiveness evaluation of the system.
19. The system of claim 17, wherein the identification unit comprises:
a yield acquisition unit: the system is used for acquiring the daily profitability of the stocks according to the stock transaction data processed by the preprocessing unit;
a dynamic threshold acquisition unit: the standard deviation of the exponential moving weighted average fluctuation rate is obtained through the yield rate, and the standard deviation of the exponential moving weighted average fluctuation rate is used as a dynamic threshold, wherein the dynamic threshold comprises an upper dynamic threshold and a lower dynamic threshold;
holding period acquisition unit: for obtaining an asset holding time limit;
an asset operation direction acquisition unit: the method is used for acquiring the asset operation direction according to the dynamic threshold value of the current day and the asset holding time period based on the profitability of the current day of the stock.
20. The system of claim 17, wherein the building unit comprises:
a secondary label construction unit: the system comprises an identification unit, a first label and a second label, wherein the identification unit is used for identifying the asset operation direction of the transaction;
a prediction probability acquisition unit: the probability model is used for predicting the secondary label to obtain a prediction probability;
the transaction strategy construction unit: for constructing a trading strategy based on the predicted probability, the trading strategy comprising an asset trading proportion.
21. The system of claim 17, wherein the preprocessing unit comprises:
a visualization unit: the system is used for providing a stock K line graph to perform visualization processing on stock transaction data;
missing value padding unit: for filling missing stock exchange data with 0;
a date characteristic construction unit: for constructing a date signature.
22. A computer device, characterized in that the computer device comprises:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement a method of dynamic threshold-based stock trading policy construction according to any one of claims 1-16.
23. A computer-readable storage medium on which a computer program is stored, the program, when executed by a processor, implementing a dynamic threshold-based stock trading strategy construction method according to any one of claims 1-16.
CN202011445609.1A 2020-12-11 2020-12-11 Stock trading strategy construction method, system, equipment and medium based on dynamic threshold Pending CN112669145A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011445609.1A CN112669145A (en) 2020-12-11 2020-12-11 Stock trading strategy construction method, system, equipment and medium based on dynamic threshold

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011445609.1A CN112669145A (en) 2020-12-11 2020-12-11 Stock trading strategy construction method, system, equipment and medium based on dynamic threshold

Publications (1)

Publication Number Publication Date
CN112669145A true CN112669145A (en) 2021-04-16

Family

ID=75402135

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011445609.1A Pending CN112669145A (en) 2020-12-11 2020-12-11 Stock trading strategy construction method, system, equipment and medium based on dynamic threshold

Country Status (1)

Country Link
CN (1) CN112669145A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113781222A (en) * 2021-09-10 2021-12-10 上海卡方信息科技有限公司 Method for constructing stock trading decision model based on machine learning

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113781222A (en) * 2021-09-10 2021-12-10 上海卡方信息科技有限公司 Method for constructing stock trading decision model based on machine learning

Similar Documents

Publication Publication Date Title
Bouoiyour et al. Measuring the response of gold prices to uncertainty: An analysis beyond the mean
Zhang et al. A review of backtesting for value at risk
Giesecke et al. Risk analysis of collateralized debt obligations
Manner et al. Forecasting the joint distribution of Australian electricity prices using dynamic vine copulae
Trifonov et al. Artificial neural network intelligent method for prediction
US20110137781A1 (en) Intermarket Analysis
Johansson et al. Measuring downside portfolio risk
Muşetescu et al. The Use of GARCH Autoregressive Models in Estimating and Forecasting the Crude Oil Volatility
CN112669145A (en) Stock trading strategy construction method, system, equipment and medium based on dynamic threshold
Kumbhare et al. Algorithmic trading strategy using technical indicators
Radivojević et al. Hull-White’s value at risk model: case study of Baltic equities market
Indah et al. The accuracy of relative strength index (rsi) indicator in forecasting foreign exchange price movement
Singh et al. The Impact of derivatives on stock market volatility: a study of the Sensex index
Azis et al. Evaluation of systematic risk, corporate governance, and cash holdings: Evidence from Indonesia
Wanniarachchi et al. Macroeconomic event base expert advisor for forex trades: through algo trading
CN114036208B (en) Model training and sensitivity analysis method, device, equipment and medium
Carl Prediction of Stock Prices using Financial Analysis
KR102420952B1 (en) Loan expansion hypothesis testing system using artificial intelligence and method using the same
Bhatia et al. Algo-Indicator Based Trading in Stock Market
Alberto Patterns of skewness risk
KR102136313B1 (en) Operating method of providing investment performance forecasting information based on artificial intelligence and server providing the same
Zakrisson et al. Practical estimation of Value at Risk and Expected Shortfall: Are complex methods really necessary?
Zhao et al. Representation bias, return forecast, and portfolio selection in the stock market of China
Senarathne The Impact of Investors’ Press Reading Time on Heteroscedasticity of Stock Returns: The Case of Intercontinental Exchange
Karaa et al. Towards a better nowcasting and forecasting of Tunisian GDP growth: The relevance of sovereign ratings data

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination