Está en la página 1de 6

2016 6th International Conference on Digital Home

A highly efficient quantitative transaction data mining model

Jinfei Yang Qingzhen Xu


School of Economic, School of Computer Science,
Minzu University of China, South China Normal University,
Beijing 100081, China Guangzhou 510631, China,
e-mail: yanggougou666@sina.com e-mail: xqz1997@126.com

Abstract—This paper focused on discrete time Geo/G/1 queue period's Covariance of stock price’s changes. The
with Bernoulli gated service. We proposed a new algorithm to mathematical model was as follows [4],
calculate stock's money flow by the probability generating
function (P.G.F.) of stationary waiting time and stationary
queue length. We did program by data mining of a variety of cov( P3  P2 , P2  P1 ) Es2 [ E[{( P3  P2 )( P2  P1 )} | s2 ]]
stock trading. The new algorithm could get any stock's money
flow. We have established a series of quantitative trading
k2 (k1  k2 )V T4
strategies based on the new money flow model. These strategies 2(V T2  V H2  k1 )(V T2  V H2  k2 )2
could guide investors to grasp an upward trend or avoid a
down trend. The quantitative investment trading strategies can
be automated trading. It could reduce investors’ subjective Dr. Chen studied the relation effect between money flow
operability and increase return rate. The new algorithm was direction and stock trend reversion. Stock's trend reversal
suitable for index trading, futures trading, stock trading, and was becoming more and weaker with the increasing number
ETF trading. of stock money flow. There were many researchers to study
money flow of stock [5-16]. However, their findings had
Keywords-Geo/G/1 queue; Data mining; Money flow important practical value to investors. However, it was very
weak in the stock's money flow. It was urgent need to find
I. INTRODUCTION more effective money flow model.
Our aim in this paper was to use discrete time Geo/G/1
There were many researchers to study the stock market, queue with Bernoulli gated service simulation system. We
futures market, foreign exchange market. Dr. Xiangyang Xu want to study an efficient money flow system for
studied the relationship between foreign intervention quantitative trading in the Chinese stock market. It could
exchange rate movements and stock price fluctuations. They study development of Regional Economy better by the new
proposed a complicated model called TVP-SVAR algorithm money flow model.
to predict stock price by exchange rate [1]. The stock model In this paper, section 1 is the introduction of stock
was as follows, research. Section 2 presents Geo/G/1 queue model
Pt 1 Pt  a[(1  Zc,t )( DFH,t  DFA,t )  Zc,t ( DCH,t  DCA,t )] description. Section 3 presents Money flow algorithm with L
and W queue. Section 4 presents the empirical analysis of the
Where P is Logarithmic stock price. Dr. Xu create a money flow in West Chinese Stock Market. Section 5
Nonlinear Dynamic System as follows, presents the summary and conclusions.
B BC B
'Pt 1 ( 'St 1 )  ( A  )( F  Pt )  rI t II. GEO/G/1 QUEUE MODEL DESCRIPTION
D D D
C BC In the classical Geo/G/1 queue system, we embedded
'St 1  ( 'Pt 1 )  ( D  )( St  F S )  rI t Bernoulli gated service and multiple vacation service type. If
A A , Q
The above model was Dr. Xu's relation model between there were b customers at the service time start instant, the
exchange rate and stock price [1]. Dr. Junlin Li proposed a number of customers served within service period follows
simple stock's money flow strength model called SOSFF (m).
Binomial distribution of
(Qb , q)
, where
0  q  1 , that is
The model was as follow [2-3],
m Voli  Pref to say,
Voli
SOSFF (m) ¦
i 1 Pref
u
Vout P{)
Q
k | Qb } ( b )q k (1  q)Qb k , k 0,1, , Qb .
k
Their study was very useful to retail investors, and the
result was obvious to predict short trend of a stock. It was We described the Bernoulli gated service system as
not well to stock's long trend predict. In order to solve the figure 1. Tasks entered from the left, and would encounter a
trend turning point Dr. Rui Chen studied the three different

978-1-5090-4400-9/16 $31.00 © 2016 IEEE 186


DOI 10.1109/ICDH.2016.44
E ( ¦ n 1 Z Ln )
gated system in the middle. The probability was q through )
the door. The task processed left the system on the right.
We can get the L and W queue model based figure 1. The Lv ( z )
stock exchange was similar to Bernoulli gated service system, E () )
and they were entrusted to buy and sell stocks. Then we can
(1  U )(1  z )G (1  p(1  z )) 1  v(1  p(1  z ))
deduce the stochastic decomposition of the stationary ˜
performance measures in the steady state system. We would
use the L and W queue model to calculate Money flow in
G (1  p(1  z ))  z pE (v )(1  z )
order to predict stock price. It was better than SOSFF (m) ˜Qb ( qG (1  p(1  z ))  (1  q) z )
model.
III. MONEY FLOW ALGORITHM WITH L AND W QUEUE
L( z ) Ld ( z ) Lr ( z )
Theorem 2. if U  1 , the stationary waiting time (Wv ) in
Qb
Q Geo / G / 1( BG, MV ) queue can be decomposed into the
E[ Z | Qb ] ¦ ( b )( zq) k (1  q)Qb k
)
(1  q(1  z )) Qb

k 0 k sum of three independent random variables,


Wv W  Wd  Wr
) is given as follows,
Therefore, the P.G.F. of W is the stationary waiting time in a classical
)( Z ) Qb (1  q(1  z )) Geo / G / 1 queue without vacation model, and the
Thenˈ Wd
additional delay time
Wr
and , respectively, has the
Qb( n1) Qb( n )  )  A)  Vc
Qb( n ) ( z ) by the P.G.F in two sides of the above 1  V ( z)
We get Wd ( z ) ,
equation, E (V )(1  z )
P.G.F,
Qb( n 1) ( z )
f
(n)
( ¦ P ( Qb
k i
k ) ¦ qi (1 q )k i z k i [ G (1  p (1  z )) ]) (1  q)(1  z )
k 0 i 0 Wr ( z ) Qb ((1  q)   qG ( z )).
p
˜v (1  p(1  z ))
Q (n)
((1  q) z  qG (1  p(1  z )))v (1  p (1  z )) 1 z
(1  U )(1  V ( z ))Qb ((1  q)(1 
b
)  qG( z ))
p
Wv ( z )
E ( ¦ n 1 Z Ln )
)
1 z
Lv ( z ) pE (V )(G ( z )  (1  ))
E () ) p
(1  U )(1  z ) 1  V ( z)
˜
Theorem 1. if U  1 , the stationary queue length ( Lv ) (1  z )  P(1  G ( z )) E (V )(1  z )
(1  q)(1  z )
in Geo / G / 1( BG, MV ) model can be decomposed into ˜Qb ((1  q)   qG ( z ))
the sum of three independent random variables, p
Lv L  Ld  Lr W ( z )Wd ( z )Wr ( z )
where L is the stationary queue length in a classical
Geo / G / 1 queue without vocations models, the P.G.F of
Ld Lr IV. THE EMPIRICAL ANALYSIS OF THE MONEY FLOW IN
additional queue length and are respectively given
by, WEST CHINA STOCK MARKET
1  v(1  p(1  z )) We studied the stocks from several provinces such as
Ld ( z ) Gansu Province, Qinghai Province, Xinjiang Province, and
pE (V )(1  z ) Tibet Province. We analyzed three indicators of these stocks
such as the net assets, earnings, and PE. There were 28
Lr ( z ) Qb ( qG (1  p(1  z ))  (1  q) z ) stocks in Gansu Province. Half of the stock companies from
Gansu Province were not profitable. Their net assets were
very low. The profitable company in Gansu Province had
very high PE. There were only 9 stocks that its turnover was
more than one percent. Sixty-eight percent of stock trading
was not active. There were only ten stocks in Qinghai
Province. There were only 3 stocks in Qinghai Province that

187
its turnover was more than one percent. Half of the stock related to the money inflow and outflow. Money inflow
companies from Qinghai Province were not profitable. would push the stock up, and money outflow would push the
Qinghai Province’s stocks net assets were also very low, and stock down. The investors could follow the trend by money
their PE was too high. There were 12 stocks in Tibet flow.
Province. However their profit ability was very high. There Gansu Yasheng Industrial stock was an old stock. The
were only 3 stocks had no profit. Profit stocks in Tibet stock began listing in 1997. Figure 4 was monthly money
Province had seventy-five percent. It was very high. There flow chart. From figure 4 we could know there was most
were forty-five stocks in Xinjiang Province. Twenty-two money inflow during these 20 years. Money flow continued
stocks were profitable. Profit rate was just only 49%. There to flow into the stock was generally a very good stock.
were only 18 stocks that its turnover was more than one Money inflows continued for 27 months. There were few
percent. money outflows during these 20 years. If money flow came
to shorten, investors should buy the stock immediately.
TABLE I. STOCK DATA OF WEST CHINA IN CHINESE STOCK MARKET When the stock price fall, money flow shortened very
No. quickly. On the contrary, if money outflow came to shorten,
Total No. of Turnover Stock prices rebounded very quickly.
of Profit
Province No. of Turnover rate
stocks
Profit proportion
rate >1% proportion Figure 5 showed the monthly money flow of Qinghai
Stock Salt Lake Industry Stock between October 2006 and October
Gansu 28 17 60.7% 9 32.1% 2016. The stock has been listed for 20 years. From figure 5
we knew that money inflow continue to be four months. This
Qinghai 10 5 50% 3 30% marked the stock arrived at bottom end. During this 20
years’ period, the monthly money flow has continued to flow
Tibet 12 10 83.3% 7 58.3%
in, and there were few money outflow. However, the stock
price continued to fall. The market was almost no any
Xinjiang 45 22 48.9% 18 40%
resistance, and dropped by eighty-six percent finally. Red
post in Figure 5 showed us someone beginning to buy. The
red post last four months recently indicated that the market
We got the figure 2 about profit and turnover rate from
would be beginning to rebound, and the bear market was end.
table 1. Figure 2 showed us Tibet stocks had best
Figure 6 showed the monthly money flow of Tibet
Profitability, and Tibet stock trading was very active. Tibet
Cheezheng Tibetan Medicine Stock. The stock had been
stock number was only 12. It was similar to Qinghai.
already on Chinese Stock market for seven years. Its lowest
However Qinghai’s stock was not very active. Gansu stocks
price is 10.76. However, its highest price is 28.11 in 2010. It
had better profitability, and they were not active. The
felled for 2 years. Price has fallen by 60%. However, money
number of stocks in Xinjiang was maximum. However half
inflows began to be appearing in Jan, 2013. The highest
of stocks had not profit, and they are not active.
increase was up to 5 times. Flood of money inflow last 2
In order to study the law of west China stock, we used
years until June, 2015. At present our algorithm told us that
the new money flow algorithm to find the reason and the
it was in bull market from 2013 to now. So our new money
difference between different provinces. We selected three
flow model can tell us the concise trends, investors can just
stocks from different province. We calculated their money
only wait patiently. If the stock was in bear trend, we should
flow by the new money flow model. These stocks were
wait for its drop by fifty percent beginning to buy. If it
Shenwan Hongyuan Group CO., LTD (000166), Gansu
continued to fall, you can buy more or more.
Yasheng Industrial (Group) Co., Ltd (600108), Qinghai Salt
Lake Industry Co., Ltd. (000792), and Tibet Cheezheng V. CONCLUSION
Tibetan Medicine Co., Ltd (002287). We selected a stock
from each province to mine operation rules behind the data.
Using Matlab programming calculation based the above new From the results of the above new money flow model, we
money flow model, we got the amount of every stock’s did some research in West Chinese stocks to study West
money flow. We got the data figure from the money flow China’s stock law. We study four stocks from different
model calculating as figure 3 to figure 6. provinces in west China. We find that Tibet stocks were very
Figure 3 showed the monthly Money flow of Shenwan active and profitable. Tibet stocks continued to be money
Hongyuan. The red post in the figure 3 was money inflows inflow. There was little time to be money outflow. That’s to
of this stock. The blue post in the figure 3 was money say that we should prefer to operate stocks in Tibet. However
outflow. The green curve showed the stock price volatility. If the stocks from Qinghai Province were very inactive and not
the money flow of a stock changed to red from blue, it profitable. We should avoid these stocks. The number of
represented the stock price rose to usher. If red post came to stocks of listed companies in Xinjiang is maximum. The
be short, it showed us the stock price would fall. The number of Xinjiang is four times Qinghai’s. Our new model
investors should sell their stocks to avoid loss. If blue post can be applied to other region. We will study American
came to be short, it showed us the stock price would rise. stock market, European stock market, and Japanese stock
The investors should buy stocks waiting for Stock up. We market in the future. We can predict the up and down trend
could draw a conclusion that the stock price was closely accurately. The Research results convinced us it'd be better
for our investor to identify stock activity.

188
ACKNOWLEDGMENT [7] J. Zhu, Q. Xie,S. I. Yu,W. H. “Wong. Exploiting Link Structure for
Web Page Genre Identification”. Data Mining and Knowledge
The Project was supported by the National Natural Discovery,30:550–575
Science Foundation of China (No.61402185), Natural [8] J. Zhu, Q. Xie, K. Zheng. “An Improved Early Detection Method of
Science Foundation of Guangdong Province (No. Type-2 Diabetes Mellitus Using Multiple Classifier
2015A030313382), and Guangdong Provincial Public Systems”. Information Sciences, volume 292, pages 1-14.
Research and Capacity Building Foundation funded project [9] J. Zhu, S. Hassan, H. Mirza, Q. Xie. “Measuring Recent Research
(Nos. 2016A020223012) Performance for Chinese Universities Using Bibliometric
Methods”. Scientometrics, 101(1):429-443
[10] Zhanyou Ma, “The Geom/G/1 queue with multiple vacation and
REFERENCES server set- up/close times”, Operation Research and Management
Science, vol.13, no.1, pp. 21-25,2004.
[1] He Chengying,Liu Lin, “Xu Xiangyang and Wang Zhanhai. Foreign [11] Zhanyou Ma,,etc, “ General decrementing service M/G/1 queue with
intervention, exchange rate movements and stock price fluctuations”, multiple adaptive vacations”. Applied Mathematics and
Economic Research, No. 10, pp. 29-42, 2013. Computation, vol.204, no.1, pp. 478-484, 2008.
[2] Ju Hong-yan, Li Jun-lin, Dong An-qiang. “The empirical research and [12] E.C. Tichmarsh. Theory of Functions. Oxford University Press,
evaluation of stock fund flows strength”, science technology and London, 1952.
industry, vol.15, No.11, pp.133-136, 2015.
[13] E.T. Whittaker. G.N. Watson. A Course of Modern Analysis.
[3] Yan Liang, Li Jun-lin, Dong An-qiang. “The empirical analysis of Cambrige University Press. London. 1946
stock fund flows strength”, Finance & economy, No.22, pp.148-150,
2014. [14] H. Takagi. Queueing Analysis: Vacation and Priority Systems, vol.1,
Elsevier Science Publishers.1991.pp.202-227
[4] Chengying He, Rui Chen, Haiping Lan, Xiangyang Xu. “Investor
Overconfidence and unsustainable Contrarian Stock Market”, [15] P.kanniappan, “Necessary conditions for optimality of no
Management World, No.8, pp. 44-54, 2014 differentiable convex multiobjective programming”, JOTA, vol.40,
no.1, pp. 167-173, 1983.
[5] Ruixue Yang. “ Improved Way of Watershed based on marked using
in the Segmentation of Brain Tumor image of MRI”. Master's [16] T.Amahroq,N.Gadhi, “Second order ptimality conditions for the
Thesis㸪shandong University of traditional Chinese medicine㸪2016 extremal problem under inclusion constraints”, J.Math.Anal.Appl. ,
vol.285, no.1, pp. 74-85, 2003.
[6] Qingzhen Xu, Zhanyou Ma, “Discrete time Geo/G/1 queue with
Bernoulli gated service simulation system ", Applied Mathematics
and Computation, vol.204, no.1, pp.37-44, 2008.

Figure 1. Bernoulli gated service system

Figure 2. Profit and Turnover rate

189
Money Flow



Money flow
 
-40000 -20000 

0 20000 40000 60000 80000 Money flow
  

-200000
-100000
100000
200000
300000
400000
500000
600000

0
 
 

-400000
-300000
-200000
-100000
100000
200000
300000

   0
  

   
 
 

  
 


  
 

 

   
 
  
  
 


  
 
  
  
 
  
  
 
  
  
 
  
  
  
 
  
 
 
   
 
  
  
 


  


 

  
  

    
 
 
   
  


0RQH\LQIORZ
   
 


  
 


   
0RQH\,QIORZ

  
   

190
Date

 
 

0RQH\,QIORZ


Date
  

Date
 


   
 
  
  

Stock Code:000792
 
 
Stock code:600108


Stock code:000166

  
0RQH\RXWIORZ

 
 
  

  


  
  
 
  

0RQH\2XWIORZ
  
0RQH\2XWIORZ

 
  
 
 

  
 

 
  
  

Figure 3. Shenwan Hongyuan Stock money flow results

  
&ORVH3ULFH

  


Figure 4. Gansu Yasheng Industrial Stock money flow results

Figure 5. Qinghai Salt Lake Industry Stock money flow result


  

  
   
 
 

FORVLQJSULFH
  
 
 

  
 


    
&ORVLQJǂ3ULFH

 
 
  
  
  
   
 
 
  
 
  
  
0
2
4
6
8

 

10
12
14
16

 


 
 Stock Price
0
2
4
6
8

0
10
12
14

10
20
30
40
50
60
70
80
90
100

Closing Price Closing Price


Closing Price
45

40

35

30

25

20

15

10






&ORVLQJ3ULFH

Figure 6. Tibet Cheezheng Tibetan Medicine Stock money flow result








Stock Code:002287

0RQH\2XWIORZ


Date



191




0RQH\,QIORZ












0
14000

12000

10000

8000

6000

4000

2000

-2000

-4000
Money flow