Financial Time Series Data Processing for Machine Learning 笔记

论文地址: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=xmaxxminxxmin(maxmin)+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,,Sts1}(1)val={Sts,,Sts+vs1}(2)test={Sts+vs,,SK1}(3)

3.Labeling

LabelDescription
N bars Up/DownClassifier on C t + n > C t C_{t+n}>C_t Ct+n>Ct
N bars price changeRegressor on C t + n − C t C_{t+n}-C_t Ct+nCt
N bars log returnsRegressor on l o g ( C t + n C t ) log(\frac{C_{t+n}}{C_t}) log(CtCt+n)
N bars Moving AverageClassifier on M A t + n > M A t MA_{t+n}>MA_t MAt+n>MAt
N bars trend StrengthRegressor on Trend
N bars trend DirectionClassifier on Trend
%Q after N barsRegressor on %Q
QClass after N barsClassifier 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=Ctm+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+nLLt+1t+nHHt+1t+nCt
 Where

  1. n n n: time horizon in numbers of bars
  2. % 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
  3. 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
  4. 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:

  1. %Q = 1 when we have a perfect up move without any drawdown during the next n n n bars
  2. %Q = 0 when we have a perfect down move without any drawup during the next n n n bars
  3. %Q = 0:5 when we have an equally Up and Down move during the next n n n bars
ClassConditionMeaning
0 % Q > = 0.6 \%Q>=0.6 %Q>=0.6Up
1 0.4 &lt; % Q &lt; 0.6 0.4&lt;\%Q&lt;0.6 0.4<%Q<0.6Neutral
2 % Q &lt; = 0.4 \%Q&lt;=0.4 %Q<=0.4Down
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值