東証一部上場全銘柄ペアに対する ペア・トレードの大規模

.
東証一部上場全銘柄ペアに対する
ペア・トレードの大規模実証実験.
室田 光晶,
井上 純一
.
北海道大学 大学院情報科学研究科
第 2 回金融ネットワーク研究会@NEC 芝倶楽部
室田 光晶, 井上 純一 (北海道大学)
ペア・トレードの大規模実証実験
2014 年 6 月 6 日
1 / 26
Nikkei stock average
The Nikkei stock average around the Tohoku earthquake (March 2011)
11500
11000
10500
10000
9500
9000
8500
8000
2010/03/01
2010/07/01
2010/11/01
2011/03/01
2011/07/01
We visualized the collective behavior of stocks during the crisis through
‘correlations’ (Ibuki et. al. (2012))
室田 光晶, 井上 純一 (北海道大学)
ペア・トレードの大規模実証実験
2014 年 6 月 6 日
2 / 26
Stocks during the crisis
1800
450
2501
2502
2503
2531
2533
2801
1600
1801
1802
1803
1812
400
1400
1200
350
1000
qk
qk
300
800
600
250
400
200
200
0
2011/01
2011/03
2011/06
2011/09
2011/12
150
2011/01
2011/03
2011/06
2011/09
2011/12
2501: Sapporo Breweries, 2502: Asahi Breweries, 2503: Kirin Holdings, 2531: Takara Holdings, 2533:
Oenon Holdings, 2801: Kikkoman Corporation, 1801: Taisei Corporation, 1802: Obayashi Corporation,
1803: Shimizu Corporation, 1812: Kajima Corporation.
Quantify the pair-wise correlation by
∆ri (t )∆rj (t ) − (∆ri (t ))(∆rj (t ))
ρij (t ) = √
[(∆ri
(t ))2
室田 光晶, 井上 純一 (北海道大学)
−
(∆ri (t ))2 ][(∆rj (t ))2
− (∆rj
ペア・トレードの大規模実証実験
, ∆ri : return in log-scale
(t ))2 ]
2014 年 6 月 6 日
3 / 26
Collective behavior: before crisis
From correlation to distance:
√
dij (t ) =
2011/03/10
室田 光晶, 井上 純一 (北海道大学)
1 − ρij (t )
2
(0 ≤ dij (t ) ≤ 1, −1 ≤ ρij (t ) ≤ 1)
2011/03/11
ペア・トレードの大規模実証実験
2014 年 6 月 6 日
4 / 26
Collective behavior: after crisis
2011/03/14
2011/03/15
References:
T. Ibuki, S. Higano, S. Suzuki and J. Inoue, ASE Human Journal 1, Issue 2, pp.74-87 (2012).
T. Ibuki, S. Higano, S. Suzuki, J. Inoue and A. Chakraborti, Journal of Physics: Conference Series 473, 012008
(16pages) (2013).
室田 光晶, 井上 純一 (北海道大学)
ペア・トレードの大規模実証実験
2014 年 6 月 6 日
5 / 26
Pairs trading
A use of ‘correlations’ for trading with a small risk
(600 yen)
Selling (a short posi.on)
price
(550 yen)
(400 yen)
Stock 1
Stock 2
Buying (a long posi.on)
(200 yen)
Arbitrage= (600-­‐200)-­‐(550-­‐400)=400-­‐150=250 yen (profit)
.me
The pairs trading is based on a simple assumption that the spread between
strongly correlated two stocks might shrink eventually even if the two prices of the
stocks temporally exhibit ‘mis-pricing’ leading up to a large spread
室田 光晶, 井上 純一 (北海道大学)
ペア・トレードの大規模実証実験
2014 年 6 月 6 日
6 / 26
Aim of this study
Constructing a very simple platform to make a pairs trading automatically
To do this, we are trying to answer the following questions
How does one choose suitable pairs of stocks for trading?
How many parameters are needed?, and which of them are actually relevant?
Robustness of the choice of parameters
Several distinctions of our study are
Pairs trading as a mixture of first-passage processes
Large-scale empirical study which has never been done so far
室田 光晶, 井上 純一 (北海道大学)
ペア・トレードの大規模実証実験
2014 年 6 月 6 日
7 / 26
Spread and first-passage times
The stock price normalized by the value itself at τ-times before as
γi (t ) ≡
pi (t ) − pi (t − τ + 1)
pi (t )
=
− 1, i = 1, 2
pi (t − τ + 1)
pi (t − τ + 1)
pi (t ): a price of the stock i at time t
The spread:
dij (t ) ≡ |γi (t ) − γj (t )|
The first-passage times:
(ij )
t<
= min{t > 0 | dij (t ) ≥ θ} (starting)
(ij )
t>
(ij )
t∗
= min{t > t< | θ < dij (t ) ≤ ε} (profit-taking)
(ij )
(ij )
(ij )
= min{t> > t > t< | dij (t ) > Ω} (stop-loss)
The profit (gain) and loss:
(ij )
(ij )
(ij )
(ij )
gij = dij (t< ) − dij (t> ), lij = dij (t∗ ) − dij (t< )
室田 光晶, 井上 純一 (北海道大学)
ペア・トレードの大規模実証実験
2014 年 6 月 6 日
8 / 26
Profit-taking case
Price
Sell
Buy
star4ng
profit-­‐taking
stock1
stock2
Sell
Buy
Time
(ij )
(ij )
profit: gij = dij (t< ) − dij (t> )
(ij )
t<
= min{t > 0 | dij (t ) ≥ θ} (starting)
(ij )
t>
= min{t > t< | θ < dij (t ) ≤ ε} (profit-taking)
室田 光晶, 井上 純一 (北海道大学)
(ij )
ペア・トレードの大規模実証実験
2014 年 6 月 6 日
9 / 26
Stop-loss case
Price
Sell
Buy
star4ng
stop-­‐loss
stock1
Buy
stock2
Sell
Time
(ij )
(ij )
loss: lij = dij (t∗ ) − dij (t< )
(ij )
t<
= min{t > 0 | dij (t ) ≥ θ} (starting)
(ij )
t∗
= min{t> > t > t< | dij (t ) > Ω} (stop-loss)
室田 光晶, 井上 純一 (北海道大学)
(ij )
(ij )
ペア・トレードの大規模実証実験
2014 年 6 月 6 日
10 / 26
Small risk
We can get profit even if the both stocks are dropping
Price
stock1
Sell
stock2
Buy
star4ng
profit-­‐taking
Buy
Sell
Small risk
Time
A well-known historical pair is Coca Cola and Pepsi Cola
室田 光晶, 井上 純一 (北海道大学)
ペア・トレードの大規模実証実験
2014 年 6 月 6 日
11 / 26
Market neutral portfolio
Let us consider the return of the two stocks i and j which are described as
∆γi (t ) =
∆γj (t ) =
βi ∆γm (t ) + qi (t )
βj ∆γm (t ) + qj (t )
∆γm (t ): the return of stock average, βi , βj : ‘market betas’ for the stocks i , j given by
∆γm (t )∆γj (t )
∆γm (t )∆γi (t )
βi = √
, βj = √
(∆γm (t ))2
(∆γm (t ))2
Then, let us assume that we take a short position (‘selling’ in future) of the stock j
by volume r and a long position (‘buying’ in future) of the stock i . For this action,
we have the return of the portfolio as
∆γij (t ) = ∆γi (t ) − r ∆γj (t ) = (βi − r βj )∆γm (t ) + qi (t ) − rqj (t ) = dij (t + 1) − dij (t )
which is market neutral for r = βi /βj
室田 光晶, 井上 純一 (北海道大学)
ペア・トレードの大規模実証実験
2014 年 6 月 6 日
12 / 26
From Arbitrage Pricing Theory (APT)
In the arbitrage pricing theory (APT) , the condition for searching suitable pairs is
the linear combination of ‘non-stationary’ time series γi (t ) and γj (t ), namely, say
γi (t ) − r γj (t ) becomes co-integration, namely, it becomes ‘stationary’. Then, the
quantity possesses a long-time equilibrium value µ and we can write
γi (t ) − r γj (t ) =
γi (t + l ) − r γj (t + l ) =
µ+ω
µ−ω
with a small deviation ω(> 0) from the mean µ. Therefore, we easily find
γi (t ) − r γj (t ) − {γi (t + l ) − r γj (t + l )} ' dij (t ) − dij (t + l ) = 2ω
namely, we obtain the profit with very small risk
References:
R.F. Engle and C.W. Granger, Co-integration and Error-Correction: Representation, Estimation and Testing,
Econometrica 55, No.2, pp. 251-276 (1987).
E.G. Gatev, W.N. Goetzmann and K.G. Rouwenhorst, Pairs Trading: Performance of a Relative Value Arbitrage
Rule, NBER Working Papers 7032, National Bureau of Economic Research Inc. (1999).
G. Vidyamurthy, Pairs Trading: Quantitative Methods and Analysis, Wiley Finance (2004).
室田 光晶, 井上 純一 (北海道大学)
ペア・トレードの大規模実証実験
2014 年 6 月 6 日
13 / 26
A constraint for the thresholds
We define
Ω−θ
≡ α, namely,
θ−ε
Ω − θ = α(θ − ε)
|{z}
‘typical’ loss
0
For positive constants δ, δ , the gap of the spreads (profit) is written as
(ij )
(ij )
0
0
dij (t< ) − dij (t> ) = θ + δ − (ε − δ ) = θ − ε + (δ + δ ) ≥
θ−ε
|{z}
minimum of profit
We set α = 1 as ‘neutral strategy’ , which gives
Ω = 2θ + ε
Under the constraint, we sweep the thresholds θ, ε as 0.01 ≤ θ ≤ 0.09, 0.0 ≤ ε ≤ θ
(d θ = 0.01) and 0.1 ≤ θ ≤ 1.0, 0.0 ≤ ε ≤ θ (d θ = 0.1) in our numerical calculations
室田 光晶, 井上 純一 (北海道大学)
ペア・トレードの大規模実証実験
2014 年 6 月 6 日
14 / 26
Correlation coefficient and volatility
Correlation coefficent:
∑t
ρij (t ) = √
− ∆γi (t ))(∆γj (t ) − ∆γj (t ))
∑t
∑t
2
2
∆t =t −τ+1 (∆γi (t ) − ∆γi (t ))
∆t =t −τ+1 (∆γj (t ) − ∆γj (t ))
∆t =t −τ+1 (∆γi (t )
Volatility:
v
u
t
σi (t ) =
t
∑
(γi (l ) − γi (t ))2
l =t −τ+1
under the definition:
A=
室田 光晶, 井上 純一 (北海道大学)
1
τ
t
∑
A (l )
l =1−τ+1
ペア・トレードの大規模実証実験
2014 年 6 月 6 日
15 / 26
Observables
The number of ‘active’ pairs:
N (θ, ε) =
∑∑
(ij )
(ij )
(ij )
Θ(ρij (t< ) − ρ0 ){Θ(σi (t< ) − σmin ) − Θ(σi (t< ) − σmax )}
j <i
i
The wining probability:
∑ ∑
pw (θ, ε)
=
=
i
j <i
(ij )
(ij )
(ij )
(ij )
Θ(dij (t< ) − dij (ˆt (ij ) ))Θ(ρij (t< ) − ρ0 ){Θ(σi (t< ) − σmin ) − Θ(σi (t< ) − σmax )}
∑ ∑
(ij )
(ij )
(ij )
i j <i Θ(ρij (t< ) − ρ0 ){Θ(σi (t< ) − σmin ) − Θ(σi (t< ) − σmax )}
(ij )
Θ(dij (t< ) − dij (ˆt (ij ) )) =
Nw (θ, ε)
Nl (θ, ε)
=1−
N (θ, ε)
N (θ, ε)
where we defined
∑ ∑
· · · ≡
(ij )
j <i (· · · )Θ(ρij (t< )
i
∑∑
i
j <i
(ij )
(ij )
− ρ0 ){Θ(σi (t< ) − σmin ) − Θ(σi (t< ) − σmax )}
(ij )
(ij )
(ij )
Θ(ρij (t< ) − ρ0 ){Θ(σi (t< ) − σmin ) − Θ(σi (t< ) − σmax )}
Hence, the profit rate is given by
(ij )
η(θ, ε) = dij (t< ) − dij (ˆt (ij ) ) 室田 光晶, 井上 純一 (北海道大学)
ペア・トレードの大規模実証実験
2014 年 6 月 6 日
16 / 26
Algorithm of ‘game’
An algorithm of pairs trading to repeat
1
2
We collect a pair of stocks (i , j ) from daily data for the past one year.
Do the following procedures from t = 0 to
t = τ: the number of daily data for one year.
(1) Calculate ρij (t ) and σi (t ), σj (t ) to determine whether the pair (i , j ) satisfies the
start condition.
Start condition:
If σmin < σi (t ), σj (t ) < σmax and ρij (t ) > ρ0 , go to (3).
If not, go to (2).
(2) t ← t + 1 and back to (1).
(3) t ← t + 1 and go to the termination condition.
Termination condition:
(ij )
.
(ij )
If dij (t> ) < ε, or dij (t∗ ) > Ω, go to the next pairs (k , l ) , (i , j ).
If not, go back to (3).
We choose
τ = 250 [days], ρ0 = 0.6, σmin = 0.05, σmax = 0.2
The algorithm is applied to about 1, 784 stocks listed on the first section of the
Tokyo Stock Exchange leading up to totally 1,784 C2 = 1, 590, 436 pairs
室田 光晶, 井上 純一 (北海道大学)
ペア・トレードの大規模実証実験
2014 年 6 月 6 日
17 / 26
Preliminary: Correlation coefficient and volatility
Distributions of {ρij (t )} (left) and {σi (t )} (right) for the past four years (2009-2012)
0.018
0.08
2009
2010
2011
0.016
2009
2010
2011
0.07
2012
2012
0.014
0.06
0.012
0.05
P(ρ)
P(σ)
0.01
0.04
0.008
0.03
0.006
0.02
0.004
0.01
0.002
0
-1
-0.8
-0.6
-0.4
-0.2
室田 光晶, 井上 純一 (北海道大学)
0
ρ
0.2
0.4
0.6
0.8
1
0
0
0.05
0.1
0.15
0.2
0.25
σ
ペア・トレードの大規模実証実験
2014 年 6 月 6 日
18 / 26
Preliminary: First-passage times
It should be noted that we observe the duration t as a first passage time from the
point t< in time axis, hence, the distributions of the duration t are given for
P (t )
=
P (t> − t< ) (for win),
P (t )
=
P (t∗ − t< )
(for lose),
respectively
2010
P(t*-t<)
P(t>-t<)
2010
0
50
100
150
200
250
0
t>-t<
室田 光晶, 井上 純一 (北海道大学)
50
100
150
200
250
t*-t<
ペア・トレードの大規模実証実験
2014 年 6 月 6 日
19 / 26
Winning prob. (2012-2010 : from top most to bottom)
室田 光晶, 井上 純一 (北海道大学)
ペア・トレードの大規模実証実験
2014 年 6 月 6 日
20 / 26
Profit rate (2012-2010: clock-wise)
Assume that the pairs (i , j ) and (k , l ) lose and the pair (m, n) wins for a specific
choice of thresholds (θ+ , ε+ ). Then, the wining probability is pw = 1/3, but
(mn)
η(θ+ , ε+ ) = dmn (t>
(mn)
) − dmn (t>
(ij )
(ij )
(kl )
(kl )
) − {dij (t> ) − dij (t∗ )} − {dkl (t> ) − dkl (t∗ )} > 0
could hold
室田 光晶, 井上 純一 (北海道大学)
ペア・トレードの大規模実証実験
2014 年 6 月 6 日
21 / 26
Profit rate for winner pairs versus volatilities
200
ε=0.1θ
180
160
140
η
120
100
80
60
40
20
0
0.05
0.055
0.06
0.065
σ
0.07
0.075
0.08
The lower bound for the profit rate η should be estimated for 0.1 ≤ θ ≤ 0.3 as
η ≥ ηmin = 0.9 θ = 0.9 × 0.1 = 0.09.
室田 光晶, 井上 純一 (北海道大学)
ペア・トレードの大規模実証実験
2014 年 6 月 6 日
22 / 26
Examples of winner pairs
Here we list only three pairs as examples, each of which includes SANYO
SPECIAL STEEL Co. Ltd. (ID: 5481) and the corresponding partners are HITACHI
METALS. Ltd. (ID: 5486), MITSUI MINING & SMELTING Co. Ltd. (ID: 5706) and
PACIFIC METALS Co. Ltd. (ID: 5541). Namely, the following three pairs
(5481,5486), (5481,5706),(5481,5541)
actually won in our empirical analysis of the game. These are all the same type of
industry (the steel industry)
室田 光晶, 井上 純一 (北海道大学)
ペア・トレードの大規模実証実験
2014 年 6 月 6 日
23 / 26
Summary
We proposed a very simple and effective algorithm to make the pairs trading
and applied our algorithm to daily data of stocks in the first section of the
Tokyo Stock Exchange
Numerical evaluations of the algorithm were carried out for all possible pairs
by changing the starting (θ), profit-taking (ε) and stop-loss (Ω) conditions to
look for the best possible combination of the conditions (θ, ε, Ω)
We found that for most of the combinations (θ, ε) under the constraint
Ω = 2θ + ε, one can obtain the positive profit rate η > 0, which means that
our algorithm actually achieves almost risk-free asset management at least
for the past three years (2010-2012) and it might be a justification of the
usefulness of pairs trading
Finally, we showed several examples of active pairs to win the game
We should conclude that the fact η > 0 in most cases of thresholds (θ, ε)
implies that automatic pairs trading system could be constructed by applying
our algorithm for all possible (θ, ε) in parallel way
室田 光晶, 井上 純一 (北海道大学)
ペア・トレードの大規模実証実験
2014 年 6 月 6 日
24 / 26
Damage spreading?
H=−
∑
(k )
Jij Si
(k )
Sj
(k )
, Si
= ±1, k = A , B , {Jij }: interactions
ij
‘Damage’ (S.A. Kauffman 1969) :
∆(t ) =
1 ∑ (A )
(B )
Si (t ) − Si (t )
2N i
Start from ∆(0) and observe if the damage spreads (as ‘chaos’) or it is frozen
室田 光晶, 井上 純一 (北海道大学)
ペア・トレードの大規模実証実験
2014 年 6 月 6 日
25 / 26
Thank you for your attention
室田 光晶, 井上 純一 (北海道大学)
ペア・トレードの大規模実証実験
2014 年 6 月 6 日
26 / 26