Research on Quantitative Trading Strategy Based on Neural Network Algorithm and Fisher Linear Discriminant

Based on the trend background of financial development in China in recent years, and statistical analysis of trend line, this paper establishes the quantitative trading strategy through the BP Neural Network Algorithm and the Fisher Linear Discriminant. Firstly, the data is linearly regressed into equal-length trend lines and the slope is fuzzified to build the matrix of upward trend and downward trend. And then use BP Neural Network Algorithm and Fisher Linear Discriminant to carry on the price forecast respectively and take transaction behavior, and correspondingly we take Shanghai and Shenzhen 300 stock index futures as an example to carry on the back test. The result shows that, firstly, the initial price trend is well retained by fitting; secondly, the profitability and risk control ability of the trading system are improved through the training optimization of Neural Network and Fisher Linear Discriminant.


Background Description
Quantitative trading strategy is an innovative analytical method combining mathematical theory with financial data, on which, with the aid of the swift operation of the computer, subjective judgment of individuals in the market can be avoided. They break through human's limit in time and space and control the risk accurately and effectively. These incomparable advantages have made it develop along with the rapid development of the global economy and the continuous integration, making it a major trading model with great potential.
Quantitative investing, fundamental analysis and technical analysis are the most important methods so that they are widely used in overseas investment markets. More and more people begin to accept and try a variety of strategies, making it favorable in China's market prospects.
In the early history of quantitative trading, statistical model once took a dominant position. It shows the volatility of prices by exploring and analyzing financial data. Various technical indexes were also applied to assess risks, identify trends and measure volatility and other aspects. However, because the selected indicators are simple and the setup model is too subjective, there was some inaccuracy in the back test. Later the emergence of a series of intelligent algorithm promoted the development of quantitative trading. Intelligent algorithm can be learned and heavily trained to explore the non-linear relationship between the variables, thus price forecast can be possible. It is very meaningful to construct the quantitative strategy.
technical index which is based on historical data. Fama and Blume (1966), Jensen and Benington (1970) verified the moving average and relative strength in American stock market, but didn't get more returns than that obtained via buy-andhold strategy. With the financial innovation, Black and Scholes built the Option Pricing Model of derivative commodities in 1973. Ross (1976) established Arbitrage Pricing Theory, and Multi-factor Asset Pricing for choosing shares can be a typical theory of APT.
In the 1990s financial economists focused more on controlling financial risk. Efficient Markets Hypothesis was queried by more people. Using the Dow Jones index, Brock (1992) tested the moving average (MA) and the trading price range model without considering trading costs. The periodic rising trend was captured and there came returns. Burgess (1999) raised the covariate arbitrage, that is, open a position when the price spread (residual of co-integration equation ) of a stock deviates to a degree. Buy in an undervalued stock and sell an overvalued stock; close position with gains when the price spread returns to normalcy. Madhavan (2002) developed VMA strategy, which synthesizes price prediction, mean-reversion and trend tracker to forecast the short-term trend of a subject matter with the help of information about volumes. Stefano Fiorenzani (2006) systematically expounded the risk control in quantitative trading. He argued that risk, with advanced mathematical and statistical methods involved, could be controlled.
The birth of intelligent algorithm is progress for constructing quantitative trading strategy. Franklin Allen (1999) achieved the best trading rules based on Genetic Algorithm; Tak-chung Fu (2013) found the best stock portfolio among many technical indexes. Having compared FF three factor linear model and the predicting capacity of neural network, Cao and others (2005) proved the latter is better; Liao and Wang (2010) built Neural Network Model on the basis of valid function at random time and Brownian Movement. The input variables are trading prices and volumes, then the volatility of A-share index, B-share index of Shanghai Stock Exchange and four overseas stock indexes are studied and forecast. The data-fitting is ideal. Youngohc Yoon (1993) analyzed and compared Artificial Neural Network and Fisher Linear Discriminant. Fisher Linear Discriminant is more applied to hereditary and image recognition. This paper attempts to apply this feature extraction method to quantitative trading strategy.

Research Design
In this paper, we will build a quantitative trading strategy dominated by intelligent algorithm, combined with statistical methods. Take Shanghai and Shenzhen 300 stock index futures data as an example，the K-line data is linear regression fitted to make it become an equal-length trend line. Then the slope of the trend lines is encoded based on fuzzy process, and next, according to a trade rule, an uptrend matrix or a downtrend matrix is constructed by sliding window method to analyze the features of K lines before rising and declining. Then Neural Network Algorithm and Fisher Linear Discriminate were introduced to predict the price trend of stock index futures and form trading rules. This paper consists of five parts: the first part is introduction; the second part focuses on the idea and principle of quantitative trading strategy construction, as well as BP Neural Network Algorithm and Fisher Linear Discriminant method for training optimization; the third part is about the prediction and empirical test about Shanghai and Shenzhen 300 stock index futures based on the quantitative trading strategy; the fourth part is discussion about the results; the fifth part is conclusion.

Method
This paper takes advantage of statistical analysis of trend line and respectively base on the BP Neural Network Algorithm and the Fisher Linear Discriminant to establish the quantitative trading strategy to do a guide for the stock index futures trading.

Model Introduction
The following two methods BP Neural Network Algorithm and Fisher Linear Discriminant will be introduced respectively.

BP Neural Network Algorithm
Artificial Neural Network (ANNs) is an artificial intelligence method with a powerful learning ability of a strong approximation to nonlinear continuous function. It is successfully applied in economic and financial field (Pao, 2006). It consists of a series of inter-connected neurons, each of which performs two calculations and makes linear combination of variables at the input. At the output the results of the non-linear computation is given and connected to next neuron, on the basis of which the connecting weight between neurons needs to be determined. Back-propagation algorithm is a commonly used optimizing algorithm that operates connecting weights. Training samples are fit through multiple iterations to obtain the smallest prediction standard error (Zhong-Zhi, 2009 Fisher Linear Discriminant is a classic pattern recognition algorithm. It was introduced into pattern recognition and artificial intelligence by Belhumeur in 1996. His basic idea is: projecting high dimensional pattern samples over optimal discriminant vectors space to extract classified information and reduce the dimensions of eigenspace. After being projected, the maximum inter-class distance and the minimum in-class distance in the subspace, and therefore it is an effective feature extraction method (Zhao-Qi & Xue-Gong, 2000). The specific process is as follows (Fisher, 1936): First, we establish the mapping of the dimension space d to the 1-dimensional space: for the samples X 1 , X 2 , …, X n , in the d-dimension sample space X, there is a class n 1 that belongs to the class W 1 and forms a subset Y 1 ; a class n 2 that belongs to the class W 2 and forms a subset Y 2 . Then: 1, 2, , ; 1, 2 Several basic parameters are then defined: (a)Parameters in the d-dimension sample space X. The mean vector of each sample is defined as: The in-class sample scatter matrix S i and total in-class scatter matrix S w are: The mean vector of each sample is defined as: The in-class sample dispersion and total intra-class dispersion are: In summary, the definition of Fisher Discriminant criteria function is: So look for the maximum value, in other words, the numerator is as large as possible and the denominator is as small as possible. In fact, it can be obtained:

Description of the Principle
Because K-line data is random, massive and changeable, statistical method is introduced to fit the data, making it a combination of isometric trend line. Thus the data of K-line can be characterized. The angle range of the processed trend line is between -90° and 90°, then the scope is encoded in a fuzzy process. With a specific level to divide the slope of the isometric trend line and according to a rule using the sliding window method, an uptrend matrix and a downtrend are built, on the basis of which the changing trend of price in a period before stock index futures rise or decline can be found, therefore the potential rules of rising and falling are analyzed. Finally, BP Neural Network and Fisher Linear Discriminant are used to study and train the statistical data. Based on this, the price trend forecast of stock index futures is carried out. The process of building Quantitative Trading Strategy is as follows:

Linear Regression Fitting
MATLAB programming software applied, The K-line data is constructed by linear regression fitting every m time units (minutes), the first n time units are taken for fitting to build trend line combination, the trend line combination total number is: The number of the i trend line is:

Statistics
With a sliding window method, starting from the first x i trend line, we count the preceding trend line code of section k. Automatically slide backwards, from the first x i+1 trend line with the trend line of section k before is encoded, and so on to build the matrix X, namely: If the first x i trend line is larger than the specified rising level, we count the preceding trend line code of section k and then the upward trend coding matrix is constructed as the input layer which judges the rising trend; If the first x i trend line is smaller than the specified falling level, we count the preceding trend line code of section k and then the downward trend coding matrix is constructed as the input layer which judges the falling trend.

Study and Training (a) Training based on BP Neural Network
With MATLAB software, setting parameters of neural network and the training can be realized. For the rising matrix, the output layer corresponds to the value of 1, and for the declining matrix, the output layer corresponds to the value is 0, that is, 1 indicates upward trend, 0 indicates the downward trend.

(b) Training based on Fisher Linear Discriminant
The encoded "uptrend" matrix and "downtrend" matrix determine the category: the upward trend is type 1, and the downward trend is type 0. They can serve as the basis for the guidance of trading operations.

Empirical Study
Then this paper will use CSI 300 stock index futures to do a case study to verify the correctness of the quantitative trading strategy.

Data Description
The research focuses on one-minute K-line data of CFFE 300 stock index futures, which are standard and processed financial data. They were from the Second Guangdong College Students Financial Modeling Competition and Guangdong Shanghai Friendship Competition. The interval of the data was from April 16th, 2010 to December 31st, 2013. The fee is charged bilaterally (Open and close positions) by 1.5%.
With MATLAB programming software, a price chart for per minute in three years of stock index futures that had low frequency trading is made, as is shown in Figure 1. It clearly shows that there are many inflection points and trends.  The slope code grade of the isometric trend line combination is divided into uptrend 1 (0~0.536), uptrend 2 (0.536~1.732), uptrend 3 (1.732~+∞), downtrend 4 (-∞~-1.732), downtrend 5 (-1.732~-0.536), downtrend 6 (-0.536~0). With a sliding window method and from the first 11 trend line, if the code grade of trend-line is larger than rising level of uptrend 1, we count the preceding trend line code of section 10 and then the upward trend coding matrix is constructed; Similarly, if the code grade of trend-line is smaller than falling level of downtrend 6, we count the preceding trend line code of section 10 and then the downward trend coding matrix is constructed.

Conservatism Test
The K-line data following 160000 time units (minute) for the 1-minute, 5-minute, 10-minute, 50-minute, and 100-minute periods trading are respectively taken as an interval to test the robustness of quantitative trading strategy.
 1-minute trading profit results are shown in Figure 3: It can be seen from the Figure 3, 4, 5, 6, 7 that, in general, the BP Neural Network strategy and the Fisher Linear Discriminant strategy all have an increasing trend with time, which indicates that the strategy has a certain robustness. And as the trading time period gradually increases, the rising trend of the profit situation also increases gradually, and the instability increases.
ijef.ccsenet.org International Journal of Economics and Finance Vol. 9, No. 2;2017 Because of the randomness of the BP Neural Network algorithm, the profit graph of the BP Neural Network is different at different time, and the Fisher Linear Discriminant method avoids the randomness, and has the characteristics of high income and low risk. The result is superior to the BP Neural Network strategy.

Discussion
The results from the comparison between the BP Neural Network Strategy and the Fisher Linear Discriminant strategy for the 1-minute, 5-minute, 10-minute, 30-minute, and 60-minute periods trading are respectively shown in the following Table 2: As is shown in Table 2 in general, the BP Neural Network Algorithm has higher risk and less stable income in different trading time periods, the Fisher Linear Discriminant has the relative characteristics of high returns and low risk, then more trades can be made, hence the returns are better.
BP Neural Network strategy to deal with different time periods respectively, the randomness is strong, and the income risk is unstable, in practice, the operation is weak. The Fisher Linear Discriminant strategy is relatively more regular and stable performance, when it trades within a period of 10-minute, the number of transactions is more and the income risk ratio is greater than 2, and the profit performance is good. After a period of 10-minute in the back of the test performance is slightly weaker than 10 minutes, but its profitability and transaction number are considerable, that is to prove that this strategy has a certain degree of robustness.

Conclusion
Based on statistical analysis, having BP Neural Network Algorithm and Fisher linear Discriminate involved, quantitative trading strategy is constructed. It carries on the back test of Shanghai and Shenzhen 300 stock index futures and can well predicts the changing price trend of stock index futures. During the process of the statistical analysis, the data are linear regression fitted, making it a combination of isometric trend line to characterize the characteristics of K-line data, and the slope range is fuzzified to encode it. With a certain level, The slope range and the level of division can be adjusted several parameters, which can be built up and down trend encoding matrix.
As the intelligent algorithm has a strong learning and training capacity, finally, the BP Neural Network and the Fisher Linear Discriminant are used to analyze the potential characteristics of the stock index futures before and after the rise or fall. In the empirical study, it is proved that the model has strong robustness. Based on the transaction cost, the Fisher Linear Discriminant strategy is relatively more objective returns.
Currently financial innovation in Chinese capital market is developing quickly. With more and more stock index futures and a short selling mechanism entering the stock market, the trading ideas and techniques of investors will change too. Quantitative trading strategy will play a vital part and various trading strategies will be established. Quantitative trading strategy presented in this paper can discover the declining trend of stock index futures by introducing a short selling mechanism, and can avoid the problem of overfitting and reduce the waste of time and cost. Its profitability and risk control can be ensured. In the following study, macroeconomic index and company's financial index can be included in stock pricing forecast to further optimize setting a stop-loss and stop-profit point, making the strategy more practical. manuscript, I encountered many problems, but tried to solve it with the help of them and learned a lot of things. I hope to work together with my friends and teachers to achieve better results.