CN106485363A - The one B shareB in a few days quantization of upward price trend and Forecasting Methodology - Google Patents

The one B shareB in a few days quantization of upward price trend and Forecasting Methodology Download PDF

Info

Publication number
CN106485363A
CN106485363A CN201610919181.7A CN201610919181A CN106485363A CN 106485363 A CN106485363 A CN 106485363A CN 201610919181 A CN201610919181 A CN 201610919181A CN 106485363 A CN106485363 A CN 106485363A
Authority
CN
China
Prior art keywords
price
stock
day
trend
few days
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
CN201610919181.7A
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.)
Henan University of Technology
Original Assignee
Henan University of Technology
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 Henan University of Technology filed Critical Henan University of Technology
Priority to CN201610919181.7A priority Critical patent/CN106485363A/en
Publication of CN106485363A publication Critical patent/CN106485363A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Landscapes

  • Business, Economics & Management (AREA)
  • Engineering & Computer Science (AREA)
  • Economics (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Human Resources & Organizations (AREA)
  • Marketing (AREA)
  • Finance (AREA)
  • Development Economics (AREA)
  • Physics & Mathematics (AREA)
  • Accounting & Taxation (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Game Theory and Decision Science (AREA)
  • Technology Law (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Operations Research (AREA)
  • Quality & Reliability (AREA)
  • Tourism & Hospitality (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The present invention constructs a B shareB in a few days quantization of upward price trend and Forecasting Methodology.First, obtain stock history in a few days bid-ask spread, in a few days variation tendency is quantified by stock price by constructing in a few days transaction stream feature, and in a few days upward price trend feature includes, in a few days fluctuation, in a few days extreme difference, opening quotation tendency, closing quotation tendency, in a few days tendency.Then, using t 1 day, in a few days transaction stream feature inputted as forecast model, and the ups and downs that the t days stock prices compare 1 day stock price of t export as forecast model, using 1000 days in a few days transaction data set up sample set.Finally, stock price trend prediction model testing model effectiveness are trained by sample set.

Description

Method for quantifying and predicting price trend of stock in day
Technical Field
The invention relates to a method for quantifying and predicting price trend of stocks in a day, belonging to the field of quantitative investment.
Background
In recent years, more and more quantitative investment is appearing in the domestic stock and future markets. Quantitative investment refers to the investment mode realized by quantitative and computer programmed trading. In quantifying investment, statistical arbitrage is an important investment pattern among them. The statistical arbitrage is to establish a prediction model according to historical transaction data and perform arbitrage according to the rules of historical transaction information. The basis of statistical arbitrage is historical trading data, and the most common statistical arbitrage is to build a prediction model according to a rate of return sequence of stocks. This direct use of time series modeling is too simple, with limited information contained therein and often less than ideal accuracy. Therefore, some common technical indexes, public company financial reports, economic indexes, and even social public opinions in the stock market can be used as characteristic data for stock prediction.
We can find that the stock trader is not concerned about the price trend of the stock all the time during the opening period, and judge the future change direction of the stock by the short-term change situation of the stock. Experienced traders can earn trades based on the short-term trends of the stock. This shows that the short-term trend of the stock can reveal some hidden information, wherein strong regularity exists, so that the statistical arbitrage using the short-term trend of the stock is feasible. By means of the capacity of the computer in data processing and data mining, the mode of the short-term trend influence on the future price of the stock can be obtained more accurately. The problem that exists is how to quantify the short-term trends in stock prices into a form of data that can be processed by a computer.
The invention provides a method for quantifying and predicting the price trend of a stock in a day, which quantifies the price change situation of the stock in the day into the trend characteristic of the stock in the day, establishes a prediction model according to the trend characteristic of the stock in the day and predicts the future trend of the stock.
Disclosure of Invention
The invention aims to provide a method for quantifying and predicting the price trend of stocks in the day, which is used for improving the accuracy of stock trend prediction.
The invention constructs a method for quantifying and predicting the price trend of stocks in a day. The method quantifies the daily trend of the stock to obtain the characteristic quantity of the daily trend of the stock; then, the daily trend feature quantity is used to predict the stock trend of the next trading day.
The specific content comprises the following steps:
step 1: acquiring the divided stroke transaction data in the stock history day; preprocessing data, including data format conversion, data noise elimination and filling default items; quantifying the price trend of the stock in the stock days by using the daily stroke data of the stock, wherein the quantified price trend of the stock in the stock days comprises the following characteristic quantities: fluctuation in the day, extreme difference in the day, tendency of opening a tray, tendency of high and low tray, and tendency of closing a tray.
Step 2: predicting the future stock price trend by adopting a support vector machine prediction model; inputting the trading trend characteristics in the t-1 th day as a prediction model, and outputting the rise and fall of the stock price in the t-1 th day compared with the stock price in the t-1 th day as the prediction model; establishing a sample set by using trade trend characteristics within 1000 days, and taking the next rise and fall of the stock corresponding to the sample as a sample label, namely the next rise and fall, wherein the sample label is 1; the next day, falling, the sample is labeled-1.
And step 3: dividing the established sample set into a training set, a cross validation set and a test set; the training set accounts for 70% of the sample set, the cross validation set accounts for 15% of the sample set, and the test set accounts for 15% of the sample set. Training the prediction model by using a training set and a cross validation set and determining model parameters; and (5) using the trained model for a test set, and checking the effectiveness of the prediction model.
And 4, step 4: and using the validated prediction model for stock price trend prediction.
The data of the stock in the historical days in step 1 can be obtained by various professional financial databases. The acquired data is preprocessed, usually including format conversion, noise elimination, and completion defaults. In the invention, the data in the share day is arranged in reverse order according to the time sequence, for example, 2000 data in a certain day, the 2000 th data in the serial number corresponds to the first transaction data in the day, and the 1 st data in the serial number corresponds to the last transaction data in the day.
The method for quantifying the price trend of the stocks in the days by using the stock day time stroke data comprises the following specific steps: and constructing the characteristic quantities of the price trend of the stock in the day, including daily fluctuation, daily range, opening tendency, height tendency and closing tendency.
The daily fluctuation is shown as
Wherein,the stock price in the ith transaction data is represented by i, the ith transaction is represented by i, the N represents N transaction data in a day,the price average value of the daily graded data,
the intraday range is expressed as
Wherein,respectively representing the highest price and the lowest price of the day;
the opening trend is quantized into a one-digit binary number, '1' represents that the opening price of today is more than or equal to the closing price of yesterday, '0' represents that the opening price of today is less than the closing price of yesterday;
the closing trend is also quantized into a one-digit binary number, '1' represents that the closing price of today is more than or equal to the opening price of today, '0' represents that the closing price of today is less than the opening price of today;
the trend of high and low is represented by the time characteristics of the occurrence of the highest price and the lowest price, in the invention, the disc opening time is represented as '0', the disc closing time is represented as '1', namely the transaction time in the day is linearly mapped to the interval [0,1](ii) a The moment when the highest price occurs is expressed asThe time when the lowest price occurs is expressed as
Because the data of the divided strokes in the stock days are arranged in reverse order according to the time sequence,the calculation method is as follows:
the information of the highest price, the time when the lowest price appears in the day and the like can be passedIs shown according toStock price trends within a day can be simply depicted.
The forecasting of stock price trend is classified forecasting, namely forecasting of stock price fluctuation. In the step 2, a Support Vector Machine (SVM) is used as a prediction model, the SVM is a machine learning algorithm developed based on a statistical theory, and the SVM has strong processing capability on the classification problem. SVM is used for classification problems, typically considering a training set ofWhereinFor the (i) th input(s),the corresponding output for the ith input. When the SVM is classified in two ways, a classification hyperplane is searched
(1)
WhereinTypically a non-linear mapping, the input is mapped from a low dimensional space (n-dimensional) to a high dimensional feature space (m-dimensional). The positive and negative samples are respectively positioned on two sides of the hyperplane, so that two classifications are realized. However, directly throughClassifying the hyperplane to separate two types of samples is not a good classification method because it is not only difficult to optimize but also the classification effect is not good because of the noise of the sample data. Therefore we want positive and negative sample points as far away from the classification hyperplane as possible. According to the structural risk minimization theory, the original classification problem can be expressed as
(2)
Wherein,is the relaxation variable. Thus the original problem is described as a convex optimization problem, minimizedIt is equivalent to maximize the interval of positive and negative hyperplanes. Satisfies the conditionsThe vertical vector of the sample point to the classification hyperplane of (1) is a support vector,andto support vector hyperplane, positive class samplesIn thatAnd far away from one side of the classification hyperplane, a negative sampleIn thatAnd is far away from one side of the classification hyperplane.
In the invention, the characteristic quantity of the trend in the stock day is used as the input of a prediction modelNext day stock fluctuation as model output(rise is represented by '1' and fall is represented by '1'), and a sample set for historical data construction is used.
In step 3, dividing the established sample set into a training set, a cross validation set and a test set; in the invention, the training set accounts for 70% of the sample set, the cross validation set accounts for 15% of the sample, and the test set accounts for 15% of the sample. The training set is used for training the SVM prediction model; the function of the cross validation set is to determine the optimal parameters of the SVM prediction model, including the penalty coefficientAnd parameters in non-linear mapping(ii) a The test set verifies the validity of the predictive model.
Drawings
FIG. 1 is a flow chart of a method for quantifying and predicting a stock price trend within a day according to the present invention.
Detailed Description
The embodiments of the present invention are described below with reference to the drawings and the summary, which are used for illustration and not for limitation of the embodiments of the present invention, and the present invention may be implemented by other different embodiments.
In the embodiment, the data preprocessing and the stock daily trend quantification process are completed through python programming; the modeling prediction process is completed by Matlab programming.
As shown in FIG. 1, the process of quantifying and predicting the price trend in a stock day is shown as steps S1-S4.
At step S1, the stock historical intra-day split transaction data is obtained by Tushare (a free, open source python financial data interface package) in this embodiment, or other financial data collection tools or related databases. And preprocessing the obtained data, including data format conversion, data noise elimination and filling default items. Quantifying the price trend of the stock in the stock days by using the daily stroke data of the stock, wherein the quantified price trend of the stock in the stock days comprises the following characteristic quantities: the method is characterized in that the method comprises the following steps of daily fluctuation, daily range difference, opening tendency, height tendency and closing tendency, and the method is obtained by compiling corresponding characteristic structure functions through python.
The daily fluctuation is shown as
Wherein,the stock price in the ith transaction data is represented by i, the ith transaction is represented by i, the N represents N transaction data in a day,the price average value of the daily graded data,
the intraday range is expressed as
Wherein,respectively representing the highest price and the lowest price of the day;
the opening trend is quantized into a one-digit binary number, '1' represents that the opening price of today is more than or equal to the closing price of yesterday, '0' represents that the opening price of today is less than the closing price of yesterday;
the closing trend is also quantized into a one-digit binary number, '1' represents that the closing price of today is more than or equal to the opening price of today, '0' represents that the closing price of today is less than the opening price of today;
the trend of high and low is represented by the time characteristics of the occurrence of the highest price and the lowest price, in the invention, the disc opening time is represented as '0', the disc closing time is represented as '1', namely the transaction time in the day is linearly mapped to the interval [0,1](ii) a The moment when the highest price occurs is expressed asThe time when the lowest price occurs is expressed as
In this embodiment, the data is divided into different data in the stock dayThe time sequence is arranged in reverse order, for example, the number of the divided stroke data of a certain transaction day is 2000, the number of the transaction data of the 1 st stroke after opening the disc is 2000, the number of the transaction data of the 2 nd stroke is 1999, and so on, and the number of the transaction data of the 2000 th stroke is 1.The calculation method is as follows:
the serial number corresponding to the highest price and the lowest price can be calculated. According toStock price trends within a day can be simply depicted.
Step S2: predicting the future stock price trend by adopting a Support Vector Machine (SVM) prediction model; inputting the trading trend characteristics in the t-1 th day as a prediction model, and outputting the rise and fall of the stock price in the t-1 th day compared with the stock price in the t-1 th day as the prediction model; establishing a sample set by using trade trend characteristics within 1000 days, and taking the next rise and fall of the stock corresponding to the sample as a sample label, namely the next rise and fall, wherein the sample label is 1; the next day, falling, the sample is labeled-1.
Step S3, dividing the established sample set into a training set, a cross validation set and a test set; in this embodiment, the training set accounts for 70% of the sample set, the cross validation set accounts for 15% of the sample set, and the test set accounts for 15% of the sample set. The training set is used for training the SVM prediction model; the function of the cross validation set is to determine the optimal parameters of the SVM prediction model, including the penalty coefficientAnd parameters in non-linear mapping(ii) a The test set verifies the validity of the predictive model.
In the present embodiment, the accuracy and precision of the trained support vector machine prediction model on the prediction of the test set reach 79.68 and 75.32% respectively, and the result shows the confidence level of the prediction model in the short-term trend prediction. The investor selects a prediction model under an appropriate confidence level according to the self risk preference and the investment requirement.
And step S4, using the effective prediction model for stock trend prediction, namely using the daily trend characteristics of the stock on the t th day to predict the price trend of the stock on the t +1 th day.
Steps S2, S3, and S4 are all performed by writing a Matlab program, where the LIBSVM under the Matlab version is used for the support vector machine model.
The foregoing embodiments are merely illustrative of the principles and utilities of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or change the above-mentioned embodiments without departing from the spirit and scope of the present invention. Accordingly, it is intended that all equivalent modifications or changes which can be made by those skilled in the art without departing from the spirit and technical spirit of the present invention be covered by the claims of the present invention.

Claims (2)

1. A method for quantifying and predicting price trend in a stock day is characterized by comprising the following steps:
step 1: acquiring the divided stroke transaction data in the stock history day; preprocessing data, including data format conversion, data noise elimination and filling default items; quantifying the price trend of the stock in the stock days by using the daily stroke data of the stock, wherein the quantified price trend of the stock in the stock days comprises the following characteristic quantities: fluctuation in the day, extreme difference in the day, tendency of opening a tray, tendency of high and low tray, and tendency of closing a tray;
step 2: predicting the future stock price trend by adopting a support vector machine prediction model; inputting the trading trend characteristics in the t-1 th day as a prediction model, and outputting the rise and fall of the stock price in the t-1 th day compared with the stock price in the t-1 th day as the prediction model; establishing a sample set by using trade trend characteristics within 1000 days, and taking the next rise and fall of the stock corresponding to the sample as a sample label, namely the next rise and fall, wherein the sample label is 1; the next fall, with the sample labeled-1;
and step 3: dividing the established sample set into a training set, a cross validation set and a test set; the training set accounts for 70% of the sample set, the cross validation set accounts for 15% of the sample set, and the test set accounts for 15% of the sample set; training the prediction model by using a training set and a cross validation set and determining model parameters; using the trained model in a test set, and checking the effectiveness of the prediction model;
and 4, step 4: and using the validated prediction model for stock price trend prediction.
2. The method for quantifying and predicting the price trend of a stock in a day as claimed in claim 1, wherein the specific method for quantifying the price trend of the stock in the day in step 1 is as follows: constructing price trend characteristic quantities in a stock day, including daily fluctuation, daily range, opening tendency, height tendency and closing tendency;
the daily fluctuation is shown as
Wherein,the stock price in the ith transaction data is represented by i, the ith transaction is represented by i, the N represents N transaction data in a day,the price average value of the daily graded data,
the intraday range is expressed as
Wherein,respectively representing the highest price and the lowest price of the day;
the opening trend is quantized into a one-digit binary number, '1' represents that the opening price of today is more than or equal to the closing price of yesterday, '0' represents that the opening price of today is less than the closing price of yesterday;
the closing trend is also quantized into a one-digit binary number, '1' represents that the closing price of today is more than or equal to the opening price of today, '0' represents that the closing price of today is less than the opening price of today;
the trend of high and low is represented by the time characteristics of the occurrence of the highest price and the lowest price, in the invention, the disc opening time is represented as '0', the disc closing time is represented as '1', namely the transaction time in the day is linearly mapped to the interval [0,1](ii) a The moment when the highest price occurs is expressed asThe time when the lowest price occurs is expressed as
CN201610919181.7A 2016-10-21 2016-10-21 The one B shareB in a few days quantization of upward price trend and Forecasting Methodology Pending CN106485363A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610919181.7A CN106485363A (en) 2016-10-21 2016-10-21 The one B shareB in a few days quantization of upward price trend and Forecasting Methodology

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610919181.7A CN106485363A (en) 2016-10-21 2016-10-21 The one B shareB in a few days quantization of upward price trend and Forecasting Methodology

Publications (1)

Publication Number Publication Date
CN106485363A true CN106485363A (en) 2017-03-08

Family

ID=58269918

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610919181.7A Pending CN106485363A (en) 2016-10-21 2016-10-21 The one B shareB in a few days quantization of upward price trend and Forecasting Methodology

Country Status (1)

Country Link
CN (1) CN106485363A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108765154A (en) * 2018-05-24 2018-11-06 东莞市波动赢机器人科技有限公司 Training method, electronic equipment and the computer storage media of transaction machine people's disaggregated model
CN109408531A (en) * 2018-09-25 2019-03-01 平安科技(深圳)有限公司 The detection method and device of slow drop type data, electronic equipment, storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108765154A (en) * 2018-05-24 2018-11-06 东莞市波动赢机器人科技有限公司 Training method, electronic equipment and the computer storage media of transaction machine people's disaggregated model
CN109408531A (en) * 2018-09-25 2019-03-01 平安科技(深圳)有限公司 The detection method and device of slow drop type data, electronic equipment, storage medium
CN109408531B (en) * 2018-09-25 2023-04-18 平安科技(深圳)有限公司 Method and device for detecting slow-falling data, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
Shah et al. A comprehensive review on multiple hybrid deep learning approaches for stock prediction
AU2022211812A1 (en) Method and system of dynamic model selection for time series forecasting
Nikolic et al. The application of brute force logistic regression to corporate credit scoring models: Evidence from Serbian financial statements
Babenko et al. Classical machine learning methods in economics research: Macro and micro level example
Farboodi et al. Where has all the big data gone?
CN106355499A (en) Stock price trend forecasting and trading method
US20130024395A1 (en) System and method for constructing outperforming portfolios relative to target benchmarks
Claveria et al. Evolutionary computation for macroeconomic forecasting
CN104463673A (en) P2P network credit risk assessment model based on support vector machine
CN111563821A (en) Financial stock fluctuation prediction method based on quantitative investment of support vector machine
Raffinot et al. Investing through economic cycles with ensemble machine learning algorithms
Miciuła The concept of FTS analysis in forecasting trends of exchange rate changes
Badenhorst et al. The value‐relevance of fair value measurement for inventories
CN106485363A (en) The one B shareB in a few days quantization of upward price trend and Forecasting Methodology
Kaihatsu et al. Phillips Correlation and Price‐Change Distributions under Declining Trend Inflation
TWM642113U (en) Investment protfolio analysis system
Alfaro-Cid et al. Minimising value-at-risk in a portfolio optimisation problem using a multi-objective genetic algorithm
CN109658253A (en) A kind of fund position in storehouse estimating algorithm returned based on index sector
Huang et al. An enhanced approach to optimizing the stock portfolio selection based on Modified Markowitz MV Method
Shaju et al. Prediction Model for Stock Trading using Combined Long Short Term Memory and Neural Prophet with Regressors.
CN113077189A (en) Method and device for evaluating life cycle of small and micro enterprise
US20200051175A1 (en) Method and System for Predicting and Indexing Probability of Financial Stress
Ben Ami et al. Event-based trading: Building superior trading strategies with state-of-the-art information extraction tools
Meghanadh et al. Imputation of missing values in the fundamental data: using MICE framework
Claveria et al. Tracking economic growth by evolving expectations via genetic programming: A two-step approach

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20170308