论文地址:https://arxiv.org/abs/1907.03010
1.Scaling
1.MinMax
z
=
x
−
x
m
i
n
x
m
a
x
−
x
m
i
n
(
m
a
x
−
m
i
n
)
+
m
i
n
z = \frac{x-x_{min}}{x_{max}-x_{min}}(max-min)+min
z=xmax−xminx−xmin(max−min)+min
max和min 是feature range。
2.Standardization
z = x − μ σ μ : m e a n σ : s t a n d a r d d e v i a t i o n z = \frac{x-\mu}{\sigma} \\ \mu:mean\\ \sigma: standard deviation z=σx−μμ:meanσ:standarddeviation
2.Split
t r a i n = { S 0 , ⋯   , S t s − 1 } ( 1 ) v a l = { S t s , ⋯   , S t s + v s − 1 } ( 2 ) t e s t = { S t s + v s , ⋯   , S K − 1 } ( 3 ) train=\{S_0,\cdots,S_{ts-1}\}\qquad(1)\\ val=\{S_{ts},\cdots,S_{ts+vs-1}\}\qquad(2)\\ test=\{S_{ts+vs},\cdots,S_{K-1}\}\qquad(3) train={S0,⋯,Sts−1}(1)val={Sts,⋯,Sts+vs−1}(2)test={Sts+vs,⋯,SK−1}(3)
3.Labeling
Label | Description |
---|---|
N bars Up/Down | Classifier on C t + n > C t C_{t+n}>C_t Ct+n>Ct |
N bars price change | Regressor on C t + n − C t C_{t+n}-C_t Ct+n−Ct |
N bars log returns | Regressor on l o g ( C t + n C t ) log(\frac{C_{t+n}}{C_t}) log(CtCt+n) |
N bars Moving Average | Classifier on M A t + n > M A t MA_{t+n}>MA_t MAt+n>MAt |
N bars trend Strength | Regressor on Trend |
N bars trend Direction | Classifier on Trend |
%Q after N bars | Regressor on %Q |
QClass after N bars | Classifier on Qclass |
If
C
t
C_t
Ct is the closing price at time
t
t
t, assume the corresponding time series slice of size
m
m
m ending by
C
t
C_t
Ct is defined by
S
t
=
C
t
−
m
+
1
,
⋯
 
,
C
t
S_t = C_{t−m+1},\cdots, C_t
St=Ct−m+1,⋯,Ct
Then
%
Q
t
+
1
t
+
n
=
H
H
t
+
1
t
+
n
−
C
t
H
H
t
+
1
t
+
n
−
L
L
t
+
1
t
+
n
\%Q^{t+n}_{t+1} =\frac{HH^{t+n}_{t+1}-C_t}{HH^{t+n}_{t+1}-LL^{t+n}_{t+1}}
%Qt+1t+n=HHt+1t+n−LLt+1t+nHHt+1t+n−Ct
Where
- n n n: time horizon in numbers of bars
- % Q t + 1 t + n \%Q^{t+n}_{t+1} %Qt+1t+n : %Q between t + 1 t+1 t+1 and t + n t+n t+n
- H H t + 1 t + n HH^{t+n}_{t+1} HHt+1t+n : Highest High price between t + 1 t+1 t+1 and t + n t+n t+n
- L L t + 1 t + n LL^{t+n}_{t+1} LLt+1t+n : Lowest Low price between t + 1 t+1 t+1 and t + n t+n t+n
So %Q is interpreted as following:
- %Q = 1 when we have a perfect up move without any drawdown during the next n n n bars
- %Q = 0 when we have a perfect down move without any drawup during the next n n n bars
- %Q = 0:5 when we have an equally Up and Down move during the next n n n bars
Class | Condition | Meaning |
---|---|---|
0 | % Q > = 0.6 \%Q>=0.6 %Q>=0.6 | Up |
1 | 0.4 < % Q < 0.6 0.4<\%Q<0.6 0.4<%Q<0.6 | Neutral |
2 | % Q < = 0.4 \%Q<=0.4 %Q<=0.4 | Down |