Improvement and Test of Stock Index Futures Trading Model Based on Bollinger Bands

Bollinger Bands trading model is an important strategy in program trading. But in practice, the trade model based on the traditional Bollinger Bands theory has great flaws such as “over-sensitive” flaw, incomplete transaction stop-loss, and the adaptability of the model’s basic parameters is poor. In this paper, the empirical research method is used to analyze the shortcomings of the traditional Bollinger Bands transaction model and put forward improved methods. Accordingly, we introduce the price speed, improve the stop-loss rules, and adjust the basic parameters to improve the model. The improved trading model is tested with the data of Shanghai and Shenzhen stock index futures. The result showed that the modified Bollinger Bands transaction model has strong profitability and low risk, which is instructive to the practice of stock index futures


Introduce the Problem
Stock index futures refers to the stock index as the subject matter of standardized futures contracts, the two sides agree upon a specific date in the future and follow the pre-determined size of the stock price index for the sale of the underlying index.Since Kansas Futures Exchange has developed a value index futures contract in February 1982, Stock index futures have been increasingly valued by all kinds of investors, the scale of the transaction has been expanding rapidly and the variety of trading has been increasing.At present, the stock index futures have become the world's largest futures trading varieties.Shanghai and Shenzhen 300 stock index futures (CSI300) market has been running in China for more than six years.It is active during these years and provides researchers with lots of real and valuable market data.
With the rise and gradual development of the stock index futures market, in order to obtain greater profits and hedging, the major trading institutions and investors began to conduct in-depth research and focus on discovering more complex trading strategies.However, the implementation of most trading strategies must rely on the implementation of programmatic transactions.In foreign markets, as the main trading mode in the securities market, programmatic transactions have gradually replaced ordinary artificial trading.Due to the backward development of China's financial market, there is a certain gap on the development of program trading between America and European countries.Development of programming trading can not only help to achieve the risk management and optimize investment combination, but make full use of the advantages of speed in the process of trading to improve the market efficiency.
Bollinger Bands model needs to be improved to adapt to different markets.

Describe Relevant Scholarship
At present, the research on Bollinger Bands trading model is relatively mature in the world .Bollinger Bands theory was first proposed by John Bollingerin the 1980s to measure the level of stock prices (John, 2001).Then the research on Bollinger Bands has become popular around the world, and the research scope is very extensive.After comparing the profitability of the moving average and Bollinger Bands model were compared, Joseph Man-Joe Leung and TerenceTai-Leung Chong finds that Bollinger Bands model is more capable to capture sudden price fluctuations, but the profitability is lower than the moving average model (Joseph & Terence, 2003).According to OD Williams (2006), Bollinger Bands could capture the abrupt fluctuation of the price level and profits level of the model could be affected by the adjustment of its input.According to Lento (2007), by testing the profitability of the Bollinger Bands model, she found that the profitability of the Bollinger Bands model might not be as good as the strategy of buying and holding when the transaction costs were adjusted.Then, Bollinger Bands model was put forward to be applied to forecast stock price trend widely and its application value was proved (K.Senthamarai, 2010).Basing on the previous research, some scholars began to propose the strategy to improve the traditional model.Bouble-Bollinger Bands theory compensated the defects of the traditional Bollinger Bands model and could more accurately judge the running trend of the security price (Kathy, 2015).
The research on Bollinger trading model is few in China, scholars mainly analyzed the theory framework of the Bollinger Bands and put forward the use of this index in China's securities market.The scientific rigor of the Bollinger Bands its use limitations in China's securities market were first explained in 2001 (Deng, 2001).According to Shenjun, Qing and Yunbo (2011), the K line and Bollinger Bands could be used as the basic tool to determine and predicte the Xiamen real estate cycle fluctuations and price trends.As the Chinese markets are quite different from the foreign, some scholars attempted to evaluate the validity of the Bollinger Bands based on the Shanghai Composite Index.The results shows that the Bollinger Bands model is effective in Chinese market (Jusheng, Yixuan, & Wei, 2014).As we can see, the domestic and foreign scholars mainly pay attention to the profitability of Bollinger Bands theory and its application research.The study on the improvement of Bollinger trading model and the application of Bollinger Bands trading model in stock index futures are few.

Frame of Paper
This paper first builds the Bollinger Bands transaction model based on the traditional Bollinger Bands theory, then analyzes its shortcomings and finds out the improvement strategy.Finally, we use the one-minute K-line data of CSI300 market from 2010 to 2013 to test the improved Bollinger Bands model and put forward the rationalization suggestion according to the practice of China's stock index futures market.

Theory of Bollinger Bands
Bollinger Bands was first designed by the stock analyst John Bollinger in USA in the actual transaction based on statistical principles.It is one of the technical indicators commonly used in the capital market.Bollinger Bands is put forward according to the philosophy of relativity, Bollinger argued that stock prices were relative rather than absolute, so he set a "channel" (consisting of upper, middle and lower tracks), which the price of stock fluctuates around.He hoped that through this "channel" on the stock price, relatively high and low of the prices could be defined.That is to say when the stock traverses the trajectory, the stock price is relatively high.On the contrary, when the stock price fell below the trajectory, the stock price is relative low.Therefore, the rationality of "channel" design rationality is the key to the rationality of the design of Bollinger bands.
Weighted moving average, moving Average, and exponential smoothing average line, etc. can be used as the trajectory of Bollinger Bands.Bollinger validated these different methods through statistical methods.The results show that the weighted average line and the exponential smoothing average line are more complex, but their promotion to grasp the price trends is not obvious.So, the trajectory of the Bollinger Bands is generally defined by the moving average.The main line of traditional Bollinger Bands is decided by the 20-day moving average.Of course, investors in the practical application can change the time parameter according to the actual situation.The width of the Bollinger "channel" is determined by the standard deviation.The upper trajectory is a multiple of the standard deviation of the stock price, and the lower trajectory is the same multiple of the standard deviation of the stock price minus the trajectory.From a statistical point of view, when the multiples of 2, the probability of the stock price between the upper and lower trajectory is more than 95%.In other words, when the stock price is outside the trajectory, we believe that the corresponding high or low stock price is reasonable.This shows that the design of Bollinger "channel" is reasonable.The relationship between Bandwidth and statistical probability is shown in Table 1.

Basic Indicators of Bollinger Bands
Calculation of N-minute moving average: Where, N is the period of the moving average, C i is the closing price of the i-th minute.
Calculation of N-minute of standard deviation of the price.
Calculation of the trajectory, Where, ML is the main line or the middle trajectory, UP is the upper bands, LW is the lower bands, SD is standard deviation of the price, K represents bands will be K standard deviations above or below the main line.

Admission Rules
Sell and open a position: When Price breaks the upper line, it indicates stock index futures prices are overvalued and have more possibility of correction.In order to avoid risks and gain profits, we will sell and open a position.
Buy and open a position: When Price breaks the lower line, it indicates stock index futures prices are undervalued and have more possibility of rebounding.In order to avoid risks and gain profits, we will buy and open a position.

Departure Rules
Buy and close a position: when the price fall down to the main line from the peak, it indicates the stock index futures prices have more possibility of rising.In order to avoid risks and gain profits, we will buy and close a position.
Sell and close a position: when the price rises up to the main line from the bottom, it indicates the stock index futures prices have more possibility of falling.In order to avoid risks and gain profits, we will sell and close a position.

Scaling Rules
To simplify the transaction process and explain the basic principles of transactions, this article does not consider the scaling rules.In the study, the transactions are single-handed transactions, that is, when you open a position, you have to close the position before a new trade.

Principles of Profits
When stock index futures price rise to the upper line, we have the bearish outlook, sell the contract and open a position.We will buy the contract and close a position when price falls down to the main line.Therefore, we could gain the profits because of the difference in price.Just like that, we can also buy the contract and open a position when stock index futures price fall to the lower line, and then sell the contract and close a position when a correction sent prices is up to the main line.

Traditional Bollinger Bands Model Analysis of Traditional Bollinger Bands Transaction Model's Defects
With MATLAB software, we wrote a program and used the traditional Bollinger Bands model to have a back test to find its shortcomings.The date was1 minute K-line transaction data in CSI 300 index market from 2010-2013.
In this quantitative strategy operation, the closing price of the stock index futures transaction was taken every 1 minute.We took the 20-cycleclosing price to calculate the average price as a point of the main line.As the cycle shifts one unit, we would get a new point, and connect these points to get moving average line, that is, the main line.Upper bands would be 2 times standard deviations above the main line, and the lower would be below.The test results are shown in Figure 1 and Table 2 below.Figure 1 shows that the model only gains profits at the beginning of the transaction and then have a substantial decline, the transactions are at a loss.Table 2 shows the number of transactions is up to 9129 times, the ultimate loss of is up to 2.35 million Yuan, and the maximum retracement of is up to 2.36 million Yuan, while the cumulative maximum profits are only 625.1460 Yuan.Though the winning rate is relative high, the final income is negative, indicating that the amount of transactions to achieve profitability is very small.The benefit-to-risk ratio is negative indicates the trade losses are serious.It shows that the traditional Bollinger Bands model fails in the test and has serious flaws.It is found that the defects of the traditional Bollinger Bands transaction model are mainly embodied in several aspects, such as "over-sensitive" and transaction stop-loss, and the adaptability of the model's basic parameters is poor.

Over-Sensitive Defects
As shown in Figure 2, we extract the test process from 36034 minutes to 36054 minutes for a total of 20 minutes and get the Bollinger Bands plot.In accordance with the traditional Bollinger band trading strategies, at the point A, when the stock price rises to the upper band, we will sell the contract and open a position and then buy the contract back and close a position when a correction sent prices down to the main line.Through the transaction, we will gain profits.However, according to Figure 2,we can see the price still rise above point A to point B. In practice, we sell the contract and open a position at point A and have a bearish outlook, resulting in a large loss.Actually, the time when price is at the point B or close to the point B, it is the best opportunity to deal.At this time we can lead to smaller losses and obtain higher profits.In order to solve this problem, it is necessary to confirm whether the original trend has ended when the stock price breaks the bands.We believe that, in most cases, before changing the original trend, stock prices will still run in accordance with the original trend for some time.Stock prices will eventually reverse until the failure of the original trend.We call this nature of stock price "inertia of stock price."Therefore, according to the traditional trading strategy, we define the original trend is about to reverse when the stock price break.This does not meet the logic of the stock price movement ---"stock price inertia."

Stop-Loss Deficiencies
Stop loss is one of the basic concepts of investment.The setting of stop-loss during a programmed trading is called "the soul of a programmed transaction".Some stop-loss strategies such as Time stop-loss, spreads stop-loss, tracking stop-loss and limit stop-loss are common in practice.Futures trading have the delivery date and a leverage effect because of the characteristics of its margin trading.If the loss can't be stopped in time, we will face the risk being forced to cut positions and lead to serious losses.Traditional Bollinger Bands trading strategy stops loss mainly rely on the breakout of the main line to select the time to close a position, which has great limitations in the volatile, frequent changes market.As shown in Figure 3, we extract the test process from 712minutes to 812 minutes for a total of 100 minutes and get the Bollinger Bands graph.losses.Therefore, in addition to taking into account the "stock price inertia", choose the right time to trade, we also need to set a reasonable stop-loss strategy to avoid trading risk caused by the excessive price fluctuations.

Lack of Basic Parameters' Applicability
Because of the complexity, variability and periodic characteristics of the stock index futures market, thebasic parameters of the traditional Bollinger Bands model are difficult to adapt to the changing market.
In practice, it is necessary to adjust the basic parameters of the Bollinger Bands model according to the different types of stages of the transactions to design different trading strategies, which are more in line with the actual transactions.

Improvement of Over-Sensitive Defects
The above analysis of defects has pointed out that when the stock price breaks through the Bollinger Bands, we determine the original trend is about to reverse, which does not meet the stock index price logic --"stock price inertia".Taking into account this situation into account, we set rules that when the stock price breaks the Bollinger Bands, the program will not make reverse transactions immediately, but determine whether the original trend has changed through a series of conditions.When the change in the trend is confirmed, the program will open or close a position.
Referring to the results of previous research (Ting, 2013) Where, Y is the closing price in recent N minutes, ε is an error term with a independent identically distributed variance σ 2 and mean 0.
The coefficients of the regression model are estimated using the least squares estimator: x and y are defined as follows Substituting into the calculation, we can get the result.
, 3 12 12 6 2 Where, S t is defined the price speed at the t minute.
, 1 ( ) Where, S t >0 means futures prices have rising trend, S t <0 means futures prices have downward trend.S t =0 means the prices were flat.As seen from the formula of price speed, the speed can be defined as the weighted average of stock price centering.For a certain time t and a fixed number of observations N, the weight increases with the increase of the price.That is, the closer to time t, the greater the weight of the price.The principle is consistent with the view that the actual price is strongly influenced by the recent price.When the futures price breaks the bands and S t >0, there is a big possibility to keep the rising trend.When S t =0, there is a big possibility that the original upward trend is over.Making transactions at this time can increase revenue a lot.In general, the probability of events that price rise to the upper bands and fall to the lower bands are small.Though it happens, the futures prices are very high or very low and the trends are not stable.At this point the misjudgment of the timing of transactions will result in huge losses.In order to accurately determine the timing of the transaction without causing too much loss, when the price of the price changes in the range of [-a, a], futures prices are in a flat state and close to the peak point.The best trading opportunity is in this period of time.This paper tested and found that when a is between 0-0.1, the effect of transaction is better.In practice, it can be adjusted according to transaction needs.Prices close to the main line are in the middle and fluctuant.When the price of the price changes in the range of [-b, b], futures prices are in a relative flat state and close to the peak point.The best trading opportunity is in this period of time.We tested and found that when b is between 0.1-0.2, the effect of transaction is better.Also, in practice, the parameters can be adjusted.

Improvement of the Trading Stop Defect
From the analysis of the stop-loss trade, it is necessary to set the stop-loss in the process of trading.Stop-loss strategies such as time stops, spreads stops, tracking stop-loss and limit stops are common and widely applied.This article draws on the view of Lai Xiangqun (2008), and uses the method of limit stop to set stop-loss rules.
Assuming the principal is one unit, after the transaction of n times, the previous (n-1) times are at a loss, the last time we get profits, then at this time our amount of money can be expressed by the following formula.
From the above formula, the profits and loss of the transaction are determined by a single time stop loss β, profits and loss ratio x and the winning rate v. Due to the prevailing winning rate in the existing procedural trading model is about 1/3, setting a single stop loss of 0-5% is appropriate.In practice, according to the needs of the transaction, it can be adjusted.The optimal stop loss is a mathematical concept that has important reference value, it helps to achieve the lowest possible risk to obtain the maximum profits in the transaction.Stock index futures investment is an art, the program trading model need to set the necessary transaction profits and loss ratio and stop loss and resolutely implement.So for the above defects, we make the following improvements.When the closing price breaks through the upper bands, we may choose a time to open and sell positions.At the same time, we set γ times the price as a stop-loss point.When the closing price in the future does not reach the right time to buy open, and the closing price has reached the γ times as much as the open price, the program immediately buy and close a position to prevent greater losses.
Similarly, when the closing price breaks through the lower price, we may choose a time to open and buy positions.At the same time, we set ω times the price as a stop-loss point.When the closing price in the future does not reach the right time to open and sell a position, and the closing price ω times below the open price of buying times, the program immediately sell and close a position to prevent greater losses.And the value γ and ω can be adjusted according to trading practices.

Adjustment of Basic Parameters
The trading model should be designed according to the different transaction types and trading phases.The adjustment of the basic parameters of the Bollinger Bands model is more in line with the actual transaction, thus reducing the risk and gaining more profits.

Empirical Testing
We improve the design of trading strategy according to the above principles and test the improved model with 1 minute K-line transaction data in CSI 300 market from 2010-2013 again.

Basic Parameters
The parameters of the Bollinger Bands in actual transaction can be set according to different actual conditions.Considering the model applied to China's stock index futures market has its particularity, we make some adjustments to the basic parameters.After lots of tests, we find that when N=14 and k=17, the transaction indicators of the model are ideal.In the following, the specific parameters in the trading rules are also adjusted.

Admission Rules
Sell and open a position: When Price breaks the upper bands, it indicates stock index futures prices are overvalued and have more possibility of correction.At the same time, the price speed S t1 changes in [-0.0547, 0.0547], futures prices are in a relative flat state and close to the peak point.The best trading opportunity is in this period of time.
Buy and open a position: When Price breaks the lower bands, it indicates stock index futures prices are undervalued and have more possibility of rebounding.At the same time, the price speed S t1 changes in [-0.0547, 0.0547], futures prices are in a relative flat state and close to the peak point.Then, we will buy and open a position to gain profits.4.1.3Departure Rules Buy and close a position: when the price fall down to the main line from the peak, it indicates the stock index futures prices have more possibility of rising.At the same time, the price speed S t2 changes in [-0.1785, 0.1785], futures prices are in a relative flat state and close to the peak point.Then, we will buy and close a position to gain profits.
Sell and close a position: when the price rise up to the main line from the bottom, it indicates the stock index futures prices have more possibility of falling.At the same time, the price speed S t2 changes in [-0.1785, 0.1785], futures prices are in a relative flat state and close to the peak point.Then, we will sell and close a position to gain profits.

Stop-Loss Rules
When the price breaks through the upper bands, we may choose a time to open and sell positions.We may choose a time to open and buy positions.At the same time, the program will choose the point that is 2.11% higher than the price of CSI 300 as a stop-loss point.When the closing price in the future does not reach the price of buying, and the closing price has reached a point which is 2.11% higher than the selling price, the program will immediately buy and open a position to prevent greater losses.Similarly, when the price breaks through the lower bands, we may choose a time to open and buy a position.At the same time, the program will choose the point that is 2.11% lower than the price of CSI 300 index as a stop-loss point.When the closing price in the future does not reach the price of selling, and the price falls to the 98.74% of the buying price, the program will immediately sell and close a position to prevent greater losses.

Analysis of the Test Results
There are lots of data of the results, the main performance results are shown in Table 3 and Figure    Figure 4 shows that the model at the beginning of the transaction is at a loss, and then after the cumulative profits with the transaction, the total profits curve volatility rises, finally turnaround and achieves a higher level of profitability.Table 3 shows the number of transactions is 3510 times, compared with the trading model before the improvement, there is a significant reduction in the number of transactions.That means the transaction costs will be greatly reduced, and there is more profits margins.We can see that the "transaction over-sensitive" defects have improved.The maximum retracement is 45,600 Yuan, which is about 1/60 of the traditional trading strategy model.Therefore, the risk of improved model declined dramatically.We can see the "over-sensitive" and trading stop defects have improved a lot.For winning rate, it is similar to the traditional model.The profitability of the improved model unit transaction is greatly improved, the final income reaches 374,800 Yuan, and the profits-to-risk ratio is up to 2.1658.Generally speaking, when profits-to-risk ratio is greater than 2, we believe that the model has practical value.Therefore, the improved model can be applied to actual market operation and is highly likely to be profitable.This improvement method is scientific and feasible.

Conclusions and Recommendations
The traditional Bollinger Bands model has serious flaws.In this paper, we make a series of improvements to the existing defects.
Firstly, the traditional Bollinger Bands model does not take into account the "stock price inertia", which generally exists in the stock index futures market.Before changing the original trend, stock prices will still run in accordance with the original trend for some time.Stock prices will eventually reverse until the failure of the original trend.This article creatively introduces the price speed to judge whether the original trend has changed.
When the price speed is close to zero, the change of the trend can be confirmed and it is the proper time to open or close a position.
Secondly, the set of the stop-loss rules in traditional Bollinger Bands model is not perfect.In the improved model, when the price rise is up to the upper bands, the program will choose a proper time to sell and open a position while setting γ times the price of the CSI 300 as a stop point.When the price fall down to the lower bands, the program will choose a proper time to buy and open a position while setting ω times the price of the CSI 300 as a stop point.Improved stop-loss settings reduce losses due to trend misjudgments a lot.
Thirdly, basic parameters of Bollinger Bands model should be adjusted according to the transaction type and the trading stage to meet the actual transaction, thereby reducing the risk and get more benefits.
In this paper, based on the review of the Bollinger Bands model at home and abroad, the paper first builds the traditional Bollinger Bands transaction model, and then analyzes its "excess sensitivity", "stop loss" and "basic parameter adaptability "defects.Next, we improve the model by introducing price speed to judge the price trend, improving the stop rules and adjusting the basic parameters.Finally, we use the one-minute K-line data of CSI 300 market from 2010 to 2013 to test the improved Bollinger Bands model.The empirical results show that the modified Bollinger Bands transaction model has higher profitability and lower risk.This article is of great significance to the practice of stock index futures market.
In addition, the improved Bollinger Bands trading model can be applied not only to the stock index futures market, but also a wider range of trading varieties by learning the basic ideas and adjusting the basic parameters.

Figure 1 .
Figure 1.The cumulative profits curve of the traditional Bollinger bands model

Figure 2 .
Figure 2. 20-minute trading of traditional Bollinger bands model

Figure 4 .
Figure 4. Profits curve of improved Bollinger bands

Table 1 .
Relationship between bandwidth and statistical probability

Table 2 .
Test results of traditional Bollinger bands model on the stock index futures price trend, this paper uses the price index of stock index futures to judge the price trend.(y t , t=1, 2…) are regarded as price series of stock index futures.That means y t represents the t time of the stock index futures price t=1 is regarded the as the first minute stock index futures closing price.Price series econometric model are established as follows.

Table 3 .
Test results of improved Bollinger bands model