一、

台灣二十檔大型股票代號及名稱。

library(quantmod)
## Warning: package 'quantmod' was built under R version 3.5.3
## Loading required package: xts
## Warning: package 'xts' was built under R version 3.5.3
## Loading required package: zoo
## 
## Attaching package: 'zoo'
## The following objects are masked from 'package:base':
## 
##     as.Date, as.Date.numeric
## Loading required package: TTR
## Warning: package 'TTR' was built under R version 3.5.3
## Version 0.4-0 included new data defaults. See ?getSymbols.
tw20_adj_close<-read.csv("2018Q4_20.csv")
head(tw20_adj_close, 20)
##    name   share1 industry           share2
## 1  1101     台泥    1.03%         水泥工業
## 2  1216     統一    2.15%         食品工業
## 3  1301     台塑    3.16%         塑膠工業
## 4  1402   遠東新    0.70%         紡織纖維
## 5  2002     中鋼    1.92%         鋼鐵工業
## 6  2105     正新    0.48%         橡膠工業
## 7  2912   統一超    1.12%         貿易百貨
## 8  9904 寶成工業    0.56%             其他
## 9  6505 台塑石化    0.95%       油電燃氣業
## 10 2303     聯電    0.85%         半導體業
## 11 2330   台積電   34.72%         半導體業
## 12 2408   南亞科    0.29%         半導體業
## 13 2357     華碩    0.91% 電腦及週邊設備業
## 14 3008   大立光    2.11%           光電業
## 15 3481 群創光電    0.54%           光電業
## 16 2412   中華電    2.76%       通信網路業
## 17 2308   台達電    1.80%     電子零組件業
## 18 2327     國巨    0.79%     電子零組件業
## 19 2317     鴻海    5.42%       其他電子業
## 20 2474 可成科技    1.07%       其他電子業

二、

從TEJ資料庫下載「除權調整後日收盤價」,將檔案輸出並儲存為tw20.txt。

library(readr)
## Warning: package 'readr' was built under R version 3.5.3
tw20.txt<-read.table("tw20.txt", header = T)
head(tw20.txt, 50)
##    證券代碼   簡稱   年月日 收盤價.元.
## 1      1101   台泥 20140102      32.76
## 2      1216   統一 20140102      40.41
## 3      1301   台塑 20140102      65.53
## 4      1402 遠東新 20140102      27.04
## 5      2002   中鋼 20140102      22.13
## 6      2105   正新 20140102      62.60
## 7      2912 統一超 20140102     170.17
## 8      9904   寶成 20140102      35.77
## 9      6505 台塑化 20140102      66.81
## 10     2303   聯電 20140102      10.10
## 11     2330 台積電 20140102      89.00
## 12     2408 南亞科 20140102      33.91
## 13     2357   華碩 20140102     199.29
## 14     3008 大立光 20140102    1119.08
## 15     3481   群創 20140102       9.36
## 16     2412 中華電 20140102      73.37
## 17     2308 台達電 20140102     139.78
## 18     2327   國巨 20140102      30.20
## 19     2317   鴻海 20140102      63.71
## 20     2474   可成 20140102     171.06
## 21     1101   台泥 20140103      32.15
## 22     1216   統一 20140103      40.04
## 23     1301   台塑 20140103      65.28
## 24     1402 遠東新 20140103      26.68
## 25     2002   中鋼 20140103      21.97
## 26     2105   正新 20140103      61.71
## 27     2912 統一超 20140103     167.29
## 28     9904   寶成 20140103      35.77
## 29     6505 台塑化 20140103      65.90
## 30     2303   聯電 20140103      10.06
## 31     2330 台積電 20140103      87.29
## 32     2408 南亞科 20140103      35.99
## 33     2357   華碩 20140103     199.29
## 34     3008 大立光 20140103    1128.36
## 35     3481   群創 20140103       9.40
## 36     2412 中華電 20140103      73.37
## 37     2308 台達電 20140103     138.12
## 38     2327   國巨 20140103      30.88
## 39     2317   鴻海 20140103      62.91
## 40     2474   可成 20140103     169.32
## 41     1101   台泥 20140106      31.46
## 42     1216   統一 20140106      40.04
## 43     1301   台塑 20140106      64.87
## 44     1402 遠東新 20140106      26.36
## 45     2002   中鋼 20140106      21.88
## 46     2105   正新 20140106      61.71
## 47     2912 統一超 20140106     168.52
## 48     9904   寶成 20140106      34.54
## 49     6505 台塑化 20140106      66.73
## 50     2303   聯電 20140106      10.18

三、

利用「dcast函數」將tw20.txt轉換成xts格式,並命名為tw20.xts。

library(reshape2)
colnames(tw20.txt)<-c("id","", "date", "price")
tw20.xts = dcast(tw20.txt, date~id)
## Using price as value column: use value.var to override.
head(tw20.xts, 50)
##        date  1101  1216  1301  1402  2002  2105  2303   2308  2317  2327
## 1  20140102 32.76 40.41 65.53 27.04 22.13 62.60 10.10 139.78 63.71 30.20
## 2  20140103 32.15 40.04 65.28 26.68 21.97 61.71 10.06 138.12 62.91 30.88
## 3  20140106 31.46 40.04 64.87 26.36 21.88 61.71 10.18 136.87 62.60 31.69
## 4  20140107 31.86 39.96 64.38 26.36 21.72 63.00 10.35 136.87 62.60 31.82
## 5  20140108 31.68 39.81 64.05 26.76 21.72 63.40 10.64 137.28 62.99 32.49
## 6  20140109 30.96 39.14 64.71 26.52 21.67 62.60 10.55 137.28 63.79 33.71
## 7  20140110 31.61 39.06 64.71 26.60 21.67 62.12 10.51 134.37 64.34 33.71
## 8  20140113 31.61 39.06 64.87 26.92 21.88 62.36 10.39 137.70 64.82 34.38
## 9  20140114 31.83 38.99 64.54 26.88 22.22 62.60 10.35 137.28 65.21 33.98
## 10 20140115 32.29 38.99 64.87 26.44 22.30 62.76 10.43 138.12 66.00 34.65
## 11 20140116 31.75 38.62 65.04 26.12 22.30 62.60 10.43 140.61 66.48 34.25
## 12 20140117 31.61 38.47 64.63 26.20 22.09 63.00 10.47 138.95 66.40 34.52
## 13 20140120 31.86 38.24 64.87 25.81 22.26 63.88 10.51 142.28 67.51 34.65
## 14 20140121 32.40 37.94 65.28 25.57 22.26 63.80 10.51 143.11 66.95 34.38
## 15 20140122 32.62 37.49 65.69 26.08 22.26 63.40 10.47 143.11 66.72 34.25
## 16 20140123 32.80 37.57 65.61 25.69 22.26 62.60 10.55 139.78 66.48 34.25
## 17 20140124 32.73 37.57 65.77 25.49 22.34 62.44 10.55 141.44 67.35 33.84
## 18 20140127 31.97 37.42 64.05 25.01 21.72 61.39 10.14 138.53 67.27 33.71
## 19 20140205 30.74 36.22 61.83 24.45 21.01 60.59  9.86 131.88 64.42 33.57
## 20 20140206 31.32 35.62 61.75 24.77 21.21 62.20  9.90 130.21 64.89 35.87
## 21 20140207 31.46 36.07 61.92 24.77 21.38 62.20  9.94 129.80 64.50 37.62
## 22 20140210 31.97 36.07 62.08 24.93 21.51 62.76  9.94 130.21 64.74 37.62
## 23 20140211 32.22 36.37 62.65 24.85 21.63 62.60  9.94 131.46 63.71 38.70
## 24 20140212 32.69 36.15 63.15 25.09 21.67 62.68 10.02 138.53 65.21 38.02
## 25 20140213 32.80 35.66 62.82 25.01 21.42 61.79 10.02 136.45 65.53 37.48
## 26 20140214 33.02 36.60 63.23 25.45 21.72 61.96 10.10 136.45 66.16 37.21
## 27 20140217 33.20 36.89 62.98 25.41 21.55 62.44 10.02 136.45 66.16 37.75
## 28 20140218 33.23 37.42 62.98 25.49 21.80 62.52 10.02 139.36 66.40 37.48
## 29 20140219 33.05 37.42 63.48 25.29 21.76 63.16 10.06 140.20 66.56 37.62
## 30 20140220 33.09 36.67 62.74 25.01 21.38 62.76 10.02 137.70 65.61 37.21
## 31 20140221 33.88 37.38 63.23 25.37 21.55 63.00 10.10 137.70 66.32 39.78
## 32 20140224 33.67 37.27 63.06 25.21 21.47 63.00 10.06 135.20 65.53 39.78
## 33 20140225 34.50 37.08 63.39 25.29 21.38 62.76 10.06 136.04 65.61 39.51
## 34 20140226 34.32 37.42 63.64 25.05 21.30 63.08 10.14 137.70 66.24 38.97
## 35 20140227 34.86 37.87 63.23 25.37 21.42 63.32 10.10 140.20 66.56 38.97
## 36 20140303 34.39 37.38 62.41 25.37 21.34 62.76 10.27 138.95 65.85 38.97
## 37 20140304 33.56 37.19 61.83 24.97 21.17 62.76 10.18 135.62 65.61 38.56
## 38 20140305 34.35 37.42 62.00 25.05 21.13 62.84 10.22 141.03 65.77 39.24
## 39 20140306 34.03 37.87 62.00 25.17 21.30 63.40 10.43 142.69 66.88 39.51
## 40 20140307 33.92 37.64 62.65 25.33 21.47 63.48 10.39 141.03 67.11 38.43
## 41 20140310 34.28 38.02 61.92 25.21 21.21 63.24 10.27 138.53 67.03 37.75
## 42 20140311 33.59 37.87 62.41 25.01 21.47 63.08 10.47 141.44 66.72 38.29
## 43 20140312 34.10 37.94 61.59 24.93 21.30 62.60 10.59 145.60 67.11 37.21
## 44 20140313 33.99 38.24 61.59 24.69 21.38 62.20 10.72 155.59 68.22 36.00
## 45 20140314 33.92 39.36 60.36 24.69 21.09 61.47 10.59 151.01 67.75 38.43
## 46 20140317 34.21 39.36 59.94 24.97 21.01 61.47 10.64 148.93 68.70 37.75
## 47 20140318 33.92 39.06 60.77 24.81 21.34 63.00 10.72 148.93 68.14 37.62
## 48 20140319 33.70 38.69 60.19 24.69 21.13 63.00 10.55 148.93 67.59 37.75
## 49 20140320 33.70 37.72 60.60 24.69 21.30 62.04 10.39 146.44 66.88 38.02
## 50 20140321 33.16 37.57 59.94 24.69 20.96 61.96 10.27 143.94 67.11 38.02
##     2330   2357  2408  2412   2474   2912    3008 3481  6505  9904
## 1  89.00 199.29 33.91 73.37 171.06 170.17 1119.08 9.36 66.81 35.77
## 2  87.29 199.29 35.99 73.37 169.32 167.29 1128.36 9.40 65.90 35.77
## 3  87.29 198.18 38.47 72.97 165.41 168.52 1091.22 9.14 66.73 34.54
## 4  86.87 199.29 41.11 72.81 168.89 165.64 1095.86 9.27 66.81 35.36
## 5  88.57 206.67 43.91 72.81 168.89 165.64 1054.07 9.23 67.47 34.95
## 6  86.02 205.93 46.94 72.81 173.23 165.23 1049.42 9.73 68.05 33.92
## 7  86.87 204.09 46.78 72.66 176.27 165.23 1068.00 9.65 66.73 34.00
## 8  87.72 213.31 47.58 72.73 177.13 162.34 1068.00 9.57 68.46 34.95
## 9  88.15 214.05 47.34 72.73 173.23 159.87 1035.49 9.40 67.55 34.25
## 10 89.42 212.20 47.34 72.73 177.57 159.87 1105.15 9.36 66.81 34.58
## 11 91.13 211.84 44.07 72.73 176.27 157.40 1091.22 9.31 66.81 35.24
## 12 91.55 211.10 41.03 72.73 176.27 159.05 1123.72 9.40 65.33 35.36
## 13 91.55 212.57 42.07 72.58 180.17 160.28 1142.29 9.36 63.19 35.15
## 14 90.70 211.84 39.99 72.66 179.74 161.52 1160.87 9.14 63.27 34.37
## 15 91.55 215.53 39.99 72.66 182.78 165.23 1156.22 8.98 64.01 35.24
## 16 91.55 215.53 40.39 72.58 179.30 165.64 1100.50 8.89 63.19 35.07
## 17 91.98 213.31 40.39 72.50 178.00 166.88 1077.29 8.98 63.02 35.15
## 18 89.42 208.15 39.99 72.66 175.40 167.70 1081.93 8.85 62.77 34.54
## 19 85.59 206.30 40.63 71.39 174.53 160.28 1063.35 8.55 62.36 33.80
## 20 86.87 204.45 43.43 71.39 180.61 161.11 1068.00 8.55 61.54 33.30
## 21 88.57 206.67 44.39 71.47 191.03 163.58 1068.00 8.89 62.20 33.55
## 22 87.72 210.73 44.79 71.39 187.12 162.76 1081.93 8.77 62.61 33.47
## 23 89.00 209.62 43.19 71.23 189.72 160.28 1109.79 8.72 62.69 33.88
## 24 89.42 214.05 42.95 71.71 198.41 159.87 1128.36 8.85 63.02 34.25
## 25 89.42 212.57 41.27 71.71 191.03 157.81 1105.15 9.02 62.44 33.76
## 26 91.55 212.57 40.23 72.10 185.38 156.57 1100.50 9.14 62.61 34.21
## 27 92.40 211.10 37.43 72.10 189.29 156.57 1091.22 9.02 62.86 33.92
## 28 91.98 216.26 38.63 72.18 190.16 152.45 1081.93 8.85 63.02 34.54
## 29 91.98 222.54 37.43 72.58 188.86 152.87 1086.57 8.89 63.43 34.41
## 30 90.70 217.37 38.39 72.18 187.12 149.57 1081.93 8.81 62.69 33.63
## 31 91.55 218.48 37.59 72.50 187.55 154.51 1156.22 9.23 63.27 33.55
## 32 91.13 217.37 36.87 72.58 190.16 153.28 1156.22 9.06 63.02 33.06
## 33 91.98 215.90 38.23 72.26 191.03 153.69 1146.94 9.06 63.19 33.59
## 34 91.55 215.53 38.87 72.26 194.50 153.69 1225.88 9.19 63.68 33.92
## 35 91.98 215.16 38.07 72.73 191.03 154.93 1249.09 9.10 64.09 33.26
## 36 91.98 212.94 37.03 72.50 193.20 152.45 1281.60 8.93 63.35 33.88
## 37 91.55 212.57 34.47 72.18 191.03 153.28 1281.60 8.77 63.02 34.13
## 38 93.68 208.88 32.07 72.66 189.29 154.93 1290.88 8.81 63.10 35.03
## 39 96.24 209.99 33.67 72.97 191.90 163.17 1290.88 8.77 63.10 35.36
## 40 97.51 212.20 31.99 73.05 194.07 160.70 1272.31 8.77 63.10 34.41
## 41 96.24 208.88 30.39 73.05 194.07 159.87 1281.60 8.68 62.11 33.67
## 42 97.09 211.10 32.47 73.52 192.76 162.34 1276.95 8.72 63.43 34.04
## 43 96.24 213.31 33.19 73.52 191.03 162.76 1295.53 8.77 62.61 33.72
## 44 99.22 212.94 31.99 73.68 191.03 163.99 1300.17 8.77 63.43 33.72
## 45 97.94 215.53 31.99 72.89 187.55 165.23 1304.82 8.68 62.77 33.26
## 46 97.09 217.00 31.59 73.13 187.99 165.64 1281.60 8.89 62.94 33.43
## 47 97.51 217.37 30.07 73.52 191.03 165.64 1276.95 8.81 63.43 33.67
## 48 97.51 214.79 29.19 73.76 191.03 169.35 1314.10 8.81 63.43 33.43
## 49 95.38 210.73 29.99 73.45 187.12 171.00 1286.24 8.68 62.77 33.14
## 50 95.81 211.47 29.51 73.52 185.38 168.94 1253.74 8.77 61.87 32.03

四-1、

計算每日報酬率,並將資料輸出為tw20.day.ret。

library(reshape2)
colnames(tw20.txt)<-c("id","", "date", "price")
tw20.xts = dcast(tw20.txt, date~id)
## Using price as value column: use value.var to override.
tw20.xts$date<-as.Date(as.character(tw20.xts$date), "%Y%m%d") 
library(xts)
tw20.xts.1<-xts(tw20.xts[,-1], order.by = tw20.xts$date)
saveRDS(tw20.xts.1, "tw20_xts_all")
library(PerformanceAnalytics)
## Warning: package 'PerformanceAnalytics' was built under R version 3.5.3
## 
## Attaching package: 'PerformanceAnalytics'
## The following object is masked from 'package:graphics':
## 
##     legend
library(magrittr)
tw20.day.ret <-Return.calculate(tw20.xts.1, method = "log")
head(tw20.day.ret)
##                    1101         1216         1301        1402         2002
## 2014-01-02           NA           NA           NA          NA           NA
## 2014-01-03 -0.018795808 -0.009198325 -0.003822342 -0.01340303 -0.007256268
## 2014-01-06 -0.021695553  0.000000000 -0.006300443 -0.01206651 -0.004104909
## 2014-01-07  0.012634407 -0.002000001 -0.007582241  0.00000000 -0.007339482
## 2014-01-08 -0.005665738 -0.003760817 -0.005138998  0.01506053  0.000000000
## 2014-01-09 -0.022989518 -0.016973175  0.010251721 -0.00900907 -0.002304680
##                    2105         2303         2308         2317        2327
## 2014-01-02           NA           NA           NA           NA          NA
## 2014-01-03 -0.014319286 -0.003968259 -0.011946886 -0.012636403 0.022266801
## 2014-01-06  0.000000000  0.011857846 -0.009091302 -0.004939855 0.025892449
## 2014-01-07  0.020688734  0.016561509  0.000000000  0.000000000 0.004093849
## 2014-01-08  0.006329135  0.027633964  0.002991066  0.006210706 0.020837327
## 2014-01-09 -0.012698583 -0.008494624  0.000000000  0.012620455 0.036862180
##                   2330         2357       2408         2412        2474
## 2014-01-02          NA           NA         NA           NA          NA
## 2014-01-03 -0.01940046  0.000000000 0.05953117  0.000000000 -0.01022396
## 2014-01-06  0.00000000 -0.005585342 0.06663759 -0.005466735 -0.02336318
## 2014-01-07 -0.00482316  0.005585342 0.06637268 -0.002195089  0.02082038
## 2014-01-08  0.01938045  0.036362268 0.06589068  0.000000000  0.00000000
## 2014-01-09 -0.02921337 -0.003587013 0.06672811  0.000000000  0.02537258
##                    2912         3008         3481         6505        9904
## 2014-01-02           NA           NA           NA           NA          NA
## 2014-01-03 -0.017069104  0.008258332  0.004264399 -0.013714328  0.00000000
## 2014-01-06  0.007325604 -0.033468915 -0.028049304  0.012516185 -0.03499148
## 2014-01-07 -0.017237678  0.004243107  0.014122994  0.001198143  0.02346317
## 2014-01-08  0.000000000 -0.038880582 -0.004324331  0.009830285 -0.01166277
## 2014-01-09 -0.002478316 -0.004421231  0.052754848  0.008559674 -0.02991366

四-2、

計算每月報酬率,並將資料輸出為tw20.mon.ret。

library(reshape2)
colnames(tw20.txt)<-c("id","", "date", "price")
tw20.xts = dcast(tw20.txt, date~id)
## Using price as value column: use value.var to override.
tw20.xts$date<-as.Date(as.character(tw20.xts$date), "%Y%m%d") 
library(xts)
tw20.xts.1<-xts(tw20.xts[,-1], order.by = tw20.xts$date)
saveRDS(tw20.xts.1, "tw20_xts_all")
library(quantmod)
tw20.mon.ret <- to.monthly(tw20.xts.1, indexAt = "lastof", OHLC=FALSE)
head(tw20.mon.ret)
##             1101  1216  1301  1402  2002  2105  2303   2308  2317  2327
## 2014-01-31 31.97 37.42 64.05 25.01 21.72 61.39 10.14 138.53 67.27 33.71
## 2014-02-28 34.86 37.87 63.23 25.37 21.42 63.32 10.10 140.20 66.56 38.97
## 2014-03-31 33.92 39.66 62.57 25.77 21.38 69.74 10.55 156.42 68.38 37.62
## 2014-04-30 34.57 38.24 63.89 24.61 21.13 69.50 10.72 153.92 68.62 38.70
## 2014-05-31 32.19 39.29 62.98 24.69 20.51 65.00 11.54 162.24 73.21 47.60
## 2014-06-30 32.62 40.11 65.53 25.61 20.92 61.31 12.28 180.96 79.24 57.58
##              2330   2357  2408  2412   2474   2912    3008  3481  6505
## 2014-01-31  89.42 208.15 39.99 72.66 175.40 167.70 1081.93  8.85 62.77
## 2014-02-28  91.98 215.16 38.07 72.73 191.03 154.93 1249.09  9.10 64.09
## 2014-03-31 100.92 222.54 32.39 74.08 191.46 177.18 1337.32  8.81 63.84
## 2014-04-30 100.92 230.29 39.59 74.47 220.98 185.01 1750.59  8.77 62.53
## 2014-05-31 101.77 244.31 66.30 75.90 232.71 204.37 1820.24  9.99 60.38
## 2014-06-30 107.73 245.79 61.58 76.05 241.82 196.95 2210.29 11.80 64.09
##             9904
## 2014-01-31 34.54
## 2014-02-28 33.26
## 2014-03-31 35.32
## 2014-04-30 31.58
## 2014-05-31 27.22
## 2014-06-30 29.56

六、

依90天移動平均操作策略,股票之操作績效。

con = gzcon(url('http://www.systematicportfolio.com/sit.gz', 'rb'))
source(con)
close(con)

load.packages('quantmod')

tw20.all<-readRDS("D:/gittest/01/0415/tw20_xts_all")
head(tw20.all)
##             1101  1216  1301  1402  2002  2105  2303   2308  2317  2327
## 2014-01-02 32.76 40.41 65.53 27.04 22.13 62.60 10.10 139.78 63.71 30.20
## 2014-01-03 32.15 40.04 65.28 26.68 21.97 61.71 10.06 138.12 62.91 30.88
## 2014-01-06 31.46 40.04 64.87 26.36 21.88 61.71 10.18 136.87 62.60 31.69
## 2014-01-07 31.86 39.96 64.38 26.36 21.72 63.00 10.35 136.87 62.60 31.82
## 2014-01-08 31.68 39.81 64.05 26.76 21.72 63.40 10.64 137.28 62.99 32.49
## 2014-01-09 30.96 39.14 64.71 26.52 21.67 62.60 10.55 137.28 63.79 33.71
##             2330   2357  2408  2412   2474   2912    3008 3481  6505  9904
## 2014-01-02 89.00 199.29 33.91 73.37 171.06 170.17 1119.08 9.36 66.81 35.77
## 2014-01-03 87.29 199.29 35.99 73.37 169.32 167.29 1128.36 9.40 65.90 35.77
## 2014-01-06 87.29 198.18 38.47 72.97 165.41 168.52 1091.22 9.14 66.73 34.54
## 2014-01-07 86.87 199.29 41.11 72.81 168.89 165.64 1095.86 9.27 66.81 35.36
## 2014-01-08 88.57 206.67 43.91 72.81 168.89 165.64 1054.07 9.23 67.47 34.95
## 2014-01-09 86.02 205.93 46.94 72.81 173.23 165.23 1049.42 9.73 68.05 33.92
tw20.all.1<-tw20.all[complete.cases(tw20.all),]
head(tw20.all.1)
##             1101  1216  1301  1402  2002  2105  2303   2308  2317  2327
## 2014-01-02 32.76 40.41 65.53 27.04 22.13 62.60 10.10 139.78 63.71 30.20
## 2014-01-03 32.15 40.04 65.28 26.68 21.97 61.71 10.06 138.12 62.91 30.88
## 2014-01-06 31.46 40.04 64.87 26.36 21.88 61.71 10.18 136.87 62.60 31.69
## 2014-01-07 31.86 39.96 64.38 26.36 21.72 63.00 10.35 136.87 62.60 31.82
## 2014-01-08 31.68 39.81 64.05 26.76 21.72 63.40 10.64 137.28 62.99 32.49
## 2014-01-09 30.96 39.14 64.71 26.52 21.67 62.60 10.55 137.28 63.79 33.71
##             2330   2357  2408  2412   2474   2912    3008 3481  6505  9904
## 2014-01-02 89.00 199.29 33.91 73.37 171.06 170.17 1119.08 9.36 66.81 35.77
## 2014-01-03 87.29 199.29 35.99 73.37 169.32 167.29 1128.36 9.40 65.90 35.77
## 2014-01-06 87.29 198.18 38.47 72.97 165.41 168.52 1091.22 9.14 66.73 34.54
## 2014-01-07 86.87 199.29 41.11 72.81 168.89 165.64 1095.86 9.27 66.81 35.36
## 2014-01-08 88.57 206.67 43.91 72.81 168.89 165.64 1054.07 9.23 67.47 34.95
## 2014-01-09 86.02 205.93 46.94 72.81 173.23 165.23 1049.42 9.73 68.05 33.92

1101

讀取1101的資料。

library(xts)
data1<-new.env()
data1$prices<-tw20.all.1$'1101'
prices<-data1$prices
sma1101<-SMA(prices, 90)
head(sma1101, 91)
##                 SMA
## 2014-01-02       NA
## 2014-01-03       NA
## 2014-01-06       NA
## 2014-01-07       NA
## 2014-01-08       NA
## 2014-01-09       NA
## 2014-01-10       NA
## 2014-01-13       NA
## 2014-01-14       NA
## 2014-01-15       NA
## 2014-01-16       NA
## 2014-01-17       NA
## 2014-01-20       NA
## 2014-01-21       NA
## 2014-01-22       NA
## 2014-01-23       NA
## 2014-01-24       NA
## 2014-01-27       NA
## 2014-02-05       NA
## 2014-02-06       NA
## 2014-02-07       NA
## 2014-02-10       NA
## 2014-02-11       NA
## 2014-02-12       NA
## 2014-02-13       NA
## 2014-02-14       NA
## 2014-02-17       NA
## 2014-02-18       NA
## 2014-02-19       NA
## 2014-02-20       NA
## 2014-02-21       NA
## 2014-02-24       NA
## 2014-02-25       NA
## 2014-02-26       NA
## 2014-02-27       NA
## 2014-03-03       NA
## 2014-03-04       NA
## 2014-03-05       NA
## 2014-03-06       NA
## 2014-03-07       NA
## 2014-03-10       NA
## 2014-03-11       NA
## 2014-03-12       NA
## 2014-03-13       NA
## 2014-03-14       NA
## 2014-03-17       NA
## 2014-03-18       NA
## 2014-03-19       NA
## 2014-03-20       NA
## 2014-03-21       NA
## 2014-03-24       NA
## 2014-03-25       NA
## 2014-03-26       NA
## 2014-03-27       NA
## 2014-03-28       NA
## 2014-03-31       NA
## 2014-04-01       NA
## 2014-04-02       NA
## 2014-04-03       NA
## 2014-04-07       NA
## 2014-04-08       NA
## 2014-04-09       NA
## 2014-04-10       NA
## 2014-04-11       NA
## 2014-04-14       NA
## 2014-04-15       NA
## 2014-04-16       NA
## 2014-04-17       NA
## 2014-04-18       NA
## 2014-04-21       NA
## 2014-04-22       NA
## 2014-04-23       NA
## 2014-04-24       NA
## 2014-04-25       NA
## 2014-04-28       NA
## 2014-04-29       NA
## 2014-04-30       NA
## 2014-05-02       NA
## 2014-05-05       NA
## 2014-05-06       NA
## 2014-05-07       NA
## 2014-05-08       NA
## 2014-05-09       NA
## 2014-05-12       NA
## 2014-05-13       NA
## 2014-05-14       NA
## 2014-05-15       NA
## 2014-05-16       NA
## 2014-05-19       NA
## 2014-05-20 33.37589
## 2014-05-21 33.36467

分別看日期、價錢。

bt.prep(data1, align='keep.all')
names(data1)
## [1] "prices"          "dates"           "weight"          "symbolnames"    
## [5] "execution.price"
data1$dates
##    [1] "2014-01-02" "2014-01-03" "2014-01-06" "2014-01-07" "2014-01-08"
##    [6] "2014-01-09" "2014-01-10" "2014-01-13" "2014-01-14" "2014-01-15"
##   [11] "2014-01-16" "2014-01-17" "2014-01-20" "2014-01-21" "2014-01-22"
##   [16] "2014-01-23" "2014-01-24" "2014-01-27" "2014-02-05" "2014-02-06"
##   [21] "2014-02-07" "2014-02-10" "2014-02-11" "2014-02-12" "2014-02-13"
##   [26] "2014-02-14" "2014-02-17" "2014-02-18" "2014-02-19" "2014-02-20"
##   [31] "2014-02-21" "2014-02-24" "2014-02-25" "2014-02-26" "2014-02-27"
##   [36] "2014-03-03" "2014-03-04" "2014-03-05" "2014-03-06" "2014-03-07"
##   [41] "2014-03-10" "2014-03-11" "2014-03-12" "2014-03-13" "2014-03-14"
##   [46] "2014-03-17" "2014-03-18" "2014-03-19" "2014-03-20" "2014-03-21"
##   [51] "2014-03-24" "2014-03-25" "2014-03-26" "2014-03-27" "2014-03-28"
##   [56] "2014-03-31" "2014-04-01" "2014-04-02" "2014-04-03" "2014-04-07"
##   [61] "2014-04-08" "2014-04-09" "2014-04-10" "2014-04-11" "2014-04-14"
##   [66] "2014-04-15" "2014-04-16" "2014-04-17" "2014-04-18" "2014-04-21"
##   [71] "2014-04-22" "2014-04-23" "2014-04-24" "2014-04-25" "2014-04-28"
##   [76] "2014-04-29" "2014-04-30" "2014-05-02" "2014-05-05" "2014-05-06"
##   [81] "2014-05-07" "2014-05-08" "2014-05-09" "2014-05-12" "2014-05-13"
##   [86] "2014-05-14" "2014-05-15" "2014-05-16" "2014-05-19" "2014-05-20"
##   [91] "2014-05-21" "2014-05-22" "2014-05-23" "2014-05-26" "2014-05-27"
##   [96] "2014-05-28" "2014-05-29" "2014-05-30" "2014-06-03" "2014-06-04"
##  [101] "2014-06-05" "2014-06-06" "2014-06-09" "2014-06-10" "2014-06-11"
##  [106] "2014-06-12" "2014-06-13" "2014-06-16" "2014-06-17" "2014-06-18"
##  [111] "2014-06-19" "2014-06-20" "2014-06-23" "2014-06-24" "2014-06-25"
##  [116] "2014-06-26" "2014-06-27" "2014-06-30" "2014-07-01" "2014-07-02"
##  [121] "2014-07-03" "2014-07-04" "2014-07-07" "2014-07-08" "2014-07-09"
##  [126] "2014-07-10" "2014-07-11" "2014-07-14" "2014-07-15" "2014-07-16"
##  [131] "2014-07-17" "2014-07-18" "2014-07-21" "2014-07-22" "2014-07-24"
##  [136] "2014-07-25" "2014-07-28" "2014-07-29" "2014-07-30" "2014-07-31"
##  [141] "2014-08-01" "2014-08-04" "2014-08-05" "2014-08-06" "2014-08-07"
##  [146] "2014-08-08" "2014-08-11" "2014-08-12" "2014-08-13" "2014-08-14"
##  [151] "2014-08-15" "2014-08-18" "2014-08-19" "2014-08-20" "2014-08-21"
##  [156] "2014-08-22" "2014-08-25" "2014-08-26" "2014-08-27" "2014-08-28"
##  [161] "2014-08-29" "2014-09-01" "2014-09-02" "2014-09-03" "2014-09-04"
##  [166] "2014-09-05" "2014-09-09" "2014-09-10" "2014-09-11" "2014-09-12"
##  [171] "2014-09-15" "2014-09-16" "2014-09-17" "2014-09-18" "2014-09-19"
##  [176] "2014-09-22" "2014-09-23" "2014-09-24" "2014-09-25" "2014-09-26"
##  [181] "2014-09-29" "2014-09-30" "2014-10-01" "2014-10-02" "2014-10-03"
##  [186] "2014-10-06" "2014-10-07" "2014-10-08" "2014-10-09" "2014-10-13"
##  [191] "2014-10-14" "2014-10-15" "2014-10-16" "2014-10-17" "2014-10-20"
##  [196] "2014-10-21" "2014-10-22" "2014-10-23" "2014-10-24" "2014-10-27"
##  [201] "2014-10-28" "2014-10-29" "2014-10-30" "2014-10-31" "2014-11-03"
##  [206] "2014-11-04" "2014-11-05" "2014-11-06" "2014-11-07" "2014-11-10"
##  [211] "2014-11-11" "2014-11-12" "2014-11-13" "2014-11-14" "2014-11-17"
##  [216] "2014-11-18" "2014-11-19" "2014-11-20" "2014-11-21" "2014-11-24"
##  [221] "2014-11-25" "2014-11-26" "2014-11-27" "2014-11-28" "2014-12-01"
##  [226] "2014-12-02" "2014-12-03" "2014-12-04" "2014-12-05" "2014-12-08"
##  [231] "2014-12-09" "2014-12-10" "2014-12-11" "2014-12-12" "2014-12-15"
##  [236] "2014-12-16" "2014-12-17" "2014-12-18" "2014-12-19" "2014-12-22"
##  [241] "2014-12-23" "2014-12-24" "2014-12-25" "2014-12-26" "2014-12-27"
##  [246] "2014-12-29" "2014-12-30" "2014-12-31" "2015-01-05" "2015-01-06"
##  [251] "2015-01-07" "2015-01-08" "2015-01-09" "2015-01-12" "2015-01-13"
##  [256] "2015-01-14" "2015-01-15" "2015-01-16" "2015-01-19" "2015-01-20"
##  [261] "2015-01-21" "2015-01-22" "2015-01-23" "2015-01-26" "2015-01-27"
##  [266] "2015-01-28" "2015-01-29" "2015-01-30" "2015-02-02" "2015-02-03"
##  [271] "2015-02-04" "2015-02-05" "2015-02-06" "2015-02-09" "2015-02-10"
##  [276] "2015-02-11" "2015-02-12" "2015-02-13" "2015-02-24" "2015-02-25"
##  [281] "2015-02-26" "2015-03-02" "2015-03-03" "2015-03-04" "2015-03-05"
##  [286] "2015-03-06" "2015-03-09" "2015-03-10" "2015-03-11" "2015-03-12"
##  [291] "2015-03-13" "2015-03-16" "2015-03-17" "2015-03-18" "2015-03-19"
##  [296] "2015-03-20" "2015-03-23" "2015-03-24" "2015-03-25" "2015-03-26"
##  [301] "2015-03-27" "2015-03-30" "2015-03-31" "2015-04-01" "2015-04-02"
##  [306] "2015-04-07" "2015-04-08" "2015-04-09" "2015-04-10" "2015-04-13"
##  [311] "2015-04-14" "2015-04-15" "2015-04-16" "2015-04-17" "2015-04-20"
##  [316] "2015-04-21" "2015-04-22" "2015-04-23" "2015-04-24" "2015-04-27"
##  [321] "2015-04-28" "2015-04-29" "2015-04-30" "2015-05-04" "2015-05-05"
##  [326] "2015-05-06" "2015-05-07" "2015-05-08" "2015-05-11" "2015-05-12"
##  [331] "2015-05-13" "2015-05-14" "2015-05-15" "2015-05-18" "2015-05-19"
##  [336] "2015-05-20" "2015-05-21" "2015-05-22" "2015-05-25" "2015-05-26"
##  [341] "2015-05-27" "2015-05-28" "2015-05-29" "2015-06-01" "2015-06-02"
##  [346] "2015-06-03" "2015-06-04" "2015-06-05" "2015-06-08" "2015-06-09"
##  [351] "2015-06-10" "2015-06-11" "2015-06-12" "2015-06-15" "2015-06-16"
##  [356] "2015-06-17" "2015-06-18" "2015-06-22" "2015-06-23" "2015-06-24"
##  [361] "2015-06-25" "2015-06-26" "2015-06-29" "2015-06-30" "2015-07-01"
##  [366] "2015-07-02" "2015-07-03" "2015-07-06" "2015-07-07" "2015-07-08"
##  [371] "2015-07-09" "2015-07-13" "2015-07-14" "2015-07-15" "2015-07-16"
##  [376] "2015-07-17" "2015-07-20" "2015-07-21" "2015-07-22" "2015-07-23"
##  [381] "2015-07-24" "2015-07-27" "2015-07-28" "2015-07-29" "2015-07-30"
##  [386] "2015-07-31" "2015-08-03" "2015-08-04" "2015-08-05" "2015-08-06"
##  [391] "2015-08-07" "2015-08-10" "2015-08-11" "2015-08-12" "2015-08-13"
##  [396] "2015-08-14" "2015-08-17" "2015-08-18" "2015-08-19" "2015-08-20"
##  [401] "2015-08-21" "2015-08-24" "2015-08-25" "2015-08-26" "2015-08-27"
##  [406] "2015-08-28" "2015-08-31" "2015-09-01" "2015-09-02" "2015-09-03"
##  [411] "2015-09-04" "2015-09-07" "2015-09-08" "2015-09-09" "2015-09-10"
##  [416] "2015-09-11" "2015-09-14" "2015-09-15" "2015-09-16" "2015-09-17"
##  [421] "2015-09-18" "2015-09-21" "2015-09-22" "2015-09-23" "2015-09-24"
##  [426] "2015-09-25" "2015-09-30" "2015-10-01" "2015-10-02" "2015-10-05"
##  [431] "2015-10-06" "2015-10-07" "2015-10-08" "2015-10-12" "2015-10-13"
##  [436] "2015-10-14" "2015-10-15" "2015-10-16" "2015-10-19" "2015-10-20"
##  [441] "2015-10-21" "2015-10-22" "2015-10-23" "2015-10-26" "2015-10-27"
##  [446] "2015-10-28" "2015-10-29" "2015-10-30" "2015-11-02" "2015-11-03"
##  [451] "2015-11-04" "2015-11-05" "2015-11-06" "2015-11-09" "2015-11-10"
##  [456] "2015-11-11" "2015-11-12" "2015-11-13" "2015-11-16" "2015-11-17"
##  [461] "2015-11-18" "2015-11-19" "2015-11-20" "2015-11-23" "2015-11-24"
##  [466] "2015-11-25" "2015-11-26" "2015-11-27" "2015-11-30" "2015-12-01"
##  [471] "2015-12-02" "2015-12-03" "2015-12-04" "2015-12-07" "2015-12-08"
##  [476] "2015-12-09" "2015-12-10" "2015-12-11" "2015-12-14" "2015-12-15"
##  [481] "2015-12-16" "2015-12-17" "2015-12-18" "2015-12-21" "2015-12-22"
##  [486] "2015-12-23" "2015-12-24" "2015-12-25" "2015-12-28" "2015-12-29"
##  [491] "2015-12-30" "2015-12-31" "2016-01-04" "2016-01-05" "2016-01-06"
##  [496] "2016-01-07" "2016-01-08" "2016-01-11" "2016-01-12" "2016-01-13"
##  [501] "2016-01-14" "2016-01-15" "2016-01-18" "2016-01-19" "2016-01-20"
##  [506] "2016-01-21" "2016-01-22" "2016-01-25" "2016-01-26" "2016-01-27"
##  [511] "2016-01-28" "2016-01-29" "2016-01-30" "2016-02-01" "2016-02-02"
##  [516] "2016-02-03" "2016-02-15" "2016-02-16" "2016-02-17" "2016-02-18"
##  [521] "2016-02-19" "2016-02-22" "2016-02-23" "2016-02-24" "2016-02-25"
##  [526] "2016-02-26" "2016-03-01" "2016-03-02" "2016-03-03" "2016-03-04"
##  [531] "2016-03-07" "2016-03-08" "2016-03-09" "2016-03-10" "2016-03-11"
##  [536] "2016-03-14" "2016-03-15" "2016-03-16" "2016-03-17" "2016-03-18"
##  [541] "2016-03-21" "2016-03-22" "2016-03-23" "2016-03-24" "2016-03-25"
##  [546] "2016-03-28" "2016-03-29" "2016-03-30" "2016-03-31" "2016-04-01"
##  [551] "2016-04-06" "2016-04-07" "2016-04-08" "2016-04-11" "2016-04-12"
##  [556] "2016-04-13" "2016-04-14" "2016-04-15" "2016-04-18" "2016-04-19"
##  [561] "2016-04-20" "2016-04-21" "2016-04-22" "2016-04-25" "2016-04-26"
##  [566] "2016-04-27" "2016-04-28" "2016-04-29" "2016-05-03" "2016-05-04"
##  [571] "2016-05-05" "2016-05-06" "2016-05-09" "2016-05-10" "2016-05-11"
##  [576] "2016-05-12" "2016-05-13" "2016-05-16" "2016-05-17" "2016-05-18"
##  [581] "2016-05-19" "2016-05-20" "2016-05-23" "2016-05-24" "2016-05-25"
##  [586] "2016-05-26" "2016-05-27" "2016-05-30" "2016-05-31" "2016-06-01"
##  [591] "2016-06-02" "2016-06-03" "2016-06-04" "2016-06-06" "2016-06-07"
##  [596] "2016-06-08" "2016-06-13" "2016-06-14" "2016-06-15" "2016-06-16"
##  [601] "2016-06-17" "2016-06-20" "2016-06-21" "2016-06-22" "2016-06-23"
##  [606] "2016-06-24" "2016-06-27" "2016-06-28" "2016-06-29" "2016-06-30"
##  [611] "2016-07-01" "2016-07-04" "2016-07-05" "2016-07-06" "2016-07-07"
##  [616] "2016-07-11" "2016-07-12" "2016-07-13" "2016-07-14" "2016-07-15"
##  [621] "2016-07-18" "2016-07-19" "2016-07-20" "2016-07-21" "2016-07-22"
##  [626] "2016-07-25" "2016-07-26" "2016-07-27" "2016-07-28" "2016-07-29"
##  [631] "2016-08-01" "2016-08-02" "2016-08-03" "2016-08-04" "2016-08-05"
##  [636] "2016-08-08" "2016-08-09" "2016-08-10" "2016-08-11" "2016-08-12"
##  [641] "2016-08-15" "2016-08-16" "2016-08-17" "2016-08-18" "2016-08-19"
##  [646] "2016-08-22" "2016-08-23" "2016-08-24" "2016-08-25" "2016-08-26"
##  [651] "2016-08-29" "2016-08-30" "2016-08-31" "2016-09-01" "2016-09-02"
##  [656] "2016-09-05" "2016-09-06" "2016-09-07" "2016-09-08" "2016-09-09"
##  [661] "2016-09-10" "2016-09-12" "2016-09-13" "2016-09-14" "2016-09-19"
##  [666] "2016-09-20" "2016-09-21" "2016-09-22" "2016-09-23" "2016-09-26"
##  [671] "2016-09-29" "2016-09-30" "2016-10-03" "2016-10-04" "2016-10-05"
##  [676] "2016-10-06" "2016-10-07" "2016-10-11" "2016-10-12" "2016-10-13"
##  [681] "2016-10-14" "2016-10-17" "2016-10-18" "2016-10-19" "2016-10-20"
##  [686] "2016-10-21" "2016-10-24" "2016-10-25" "2016-10-26" "2016-10-27"
##  [691] "2016-10-28" "2016-10-31" "2016-11-01" "2016-11-02" "2016-11-03"
##  [696] "2016-11-04" "2016-11-07" "2016-11-08" "2016-11-09" "2016-11-10"
##  [701] "2016-11-11" "2016-11-14" "2016-11-15" "2016-11-16" "2016-11-17"
##  [706] "2016-11-18" "2016-11-21" "2016-11-22" "2016-11-23" "2016-11-24"
##  [711] "2016-11-25" "2016-11-28" "2016-11-29" "2016-11-30" "2016-12-01"
##  [716] "2016-12-02" "2016-12-05" "2016-12-06" "2016-12-07" "2016-12-08"
##  [721] "2016-12-09" "2016-12-12" "2016-12-13" "2016-12-14" "2016-12-15"
##  [726] "2016-12-16" "2016-12-19" "2016-12-20" "2016-12-21" "2016-12-22"
##  [731] "2016-12-23" "2016-12-26" "2016-12-27" "2016-12-28" "2016-12-29"
##  [736] "2016-12-30" "2017-01-03" "2017-01-04" "2017-01-05" "2017-01-06"
##  [741] "2017-01-09" "2017-01-10" "2017-01-11" "2017-01-12" "2017-01-13"
##  [746] "2017-01-16" "2017-01-17" "2017-01-18" "2017-01-19" "2017-01-20"
##  [751] "2017-01-23" "2017-01-24" "2017-02-02" "2017-02-03" "2017-02-06"
##  [756] "2017-02-07" "2017-02-08" "2017-02-09" "2017-02-10" "2017-02-13"
##  [761] "2017-02-14" "2017-02-15" "2017-02-16" "2017-02-17" "2017-02-18"
##  [766] "2017-02-20" "2017-02-21" "2017-02-22" "2017-02-23" "2017-02-24"
##  [771] "2017-03-01" "2017-03-02" "2017-03-03" "2017-03-06" "2017-03-07"
##  [776] "2017-03-08" "2017-03-09" "2017-03-10" "2017-03-13" "2017-03-14"
##  [781] "2017-03-15" "2017-03-16" "2017-03-17" "2017-03-20" "2017-03-21"
##  [786] "2017-03-22" "2017-03-23" "2017-03-24" "2017-03-27" "2017-03-28"
##  [791] "2017-03-29" "2017-03-30" "2017-03-31" "2017-04-05" "2017-04-06"
##  [796] "2017-04-07" "2017-04-10" "2017-04-11" "2017-04-12" "2017-04-13"
##  [801] "2017-04-14" "2017-04-17" "2017-04-18" "2017-04-19" "2017-04-20"
##  [806] "2017-04-21" "2017-04-24" "2017-04-25" "2017-04-26" "2017-04-27"
##  [811] "2017-04-28" "2017-05-02" "2017-05-03" "2017-05-04" "2017-05-05"
##  [816] "2017-05-08" "2017-05-09" "2017-05-10" "2017-05-11" "2017-05-12"
##  [821] "2017-05-15" "2017-05-16" "2017-05-17" "2017-05-18" "2017-05-19"
##  [826] "2017-05-22" "2017-05-23" "2017-05-24" "2017-05-25" "2017-05-26"
##  [831] "2017-05-31" "2017-06-01" "2017-06-02" "2017-06-03" "2017-06-05"
##  [836] "2017-06-06" "2017-06-07" "2017-06-08" "2017-06-09" "2017-06-12"
##  [841] "2017-06-13" "2017-06-14" "2017-06-15" "2017-06-16" "2017-06-19"
##  [846] "2017-06-20" "2017-06-21" "2017-06-22" "2017-06-23" "2017-06-26"
##  [851] "2017-06-27" "2017-06-28" "2017-06-29" "2017-06-30" "2017-07-03"
##  [856] "2017-07-04" "2017-07-05" "2017-07-06" "2017-07-07" "2017-07-10"
##  [861] "2017-07-11" "2017-07-12" "2017-07-13" "2017-07-14" "2017-07-17"
##  [866] "2017-07-18" "2017-07-19" "2017-07-20" "2017-07-21" "2017-07-24"
##  [871] "2017-07-25" "2017-07-26" "2017-07-27" "2017-07-28" "2017-07-31"
##  [876] "2017-08-01" "2017-08-02" "2017-08-03" "2017-08-04" "2017-08-07"
##  [881] "2017-08-08" "2017-08-09" "2017-08-10" "2017-08-11" "2017-08-14"
##  [886] "2017-08-15" "2017-08-16" "2017-08-17" "2017-08-18" "2017-08-21"
##  [891] "2017-08-22" "2017-08-23" "2017-08-24" "2017-08-25" "2017-08-28"
##  [896] "2017-08-29" "2017-08-30" "2017-08-31" "2017-09-01" "2017-09-04"
##  [901] "2017-09-05" "2017-09-06" "2017-09-07" "2017-09-08" "2017-09-11"
##  [906] "2017-09-12" "2017-09-13" "2017-09-14" "2017-09-15" "2017-09-18"
##  [911] "2017-09-19" "2017-09-20" "2017-09-21" "2017-09-22" "2017-09-25"
##  [916] "2017-09-26" "2017-09-27" "2017-09-28" "2017-09-29" "2017-09-30"
##  [921] "2017-10-02" "2017-10-03" "2017-10-05" "2017-10-06" "2017-10-11"
##  [926] "2017-10-12" "2017-10-13" "2017-10-16" "2017-10-17" "2017-10-18"
##  [931] "2017-10-19" "2017-10-20" "2017-10-23" "2017-10-24" "2017-10-25"
##  [936] "2017-10-26" "2017-10-27" "2017-10-30" "2017-10-31" "2017-11-01"
##  [941] "2017-11-02" "2017-11-03" "2017-11-06" "2017-11-07" "2017-11-08"
##  [946] "2017-11-09" "2017-11-10" "2017-11-13" "2017-11-14" "2017-11-15"
##  [951] "2017-11-16" "2017-11-17" "2017-11-20" "2017-11-21" "2017-11-22"
##  [956] "2017-11-23" "2017-11-24" "2017-11-27" "2017-11-28" "2017-11-29"
##  [961] "2017-11-30" "2017-12-01" "2017-12-04" "2017-12-05" "2017-12-06"
##  [966] "2017-12-07" "2017-12-08" "2017-12-11" "2017-12-12" "2017-12-13"
##  [971] "2017-12-14" "2017-12-15" "2017-12-18" "2017-12-19" "2017-12-20"
##  [976] "2017-12-21" "2017-12-22" "2017-12-25" "2017-12-26" "2017-12-27"
##  [981] "2017-12-28" "2017-12-29" "2018-01-02" "2018-01-03" "2018-01-04"
##  [986] "2018-01-05" "2018-01-08" "2018-01-09" "2018-01-10" "2018-01-11"
##  [991] "2018-01-12" "2018-01-15" "2018-01-16" "2018-01-17" "2018-01-18"
##  [996] "2018-01-19" "2018-01-22" "2018-01-23" "2018-01-24" "2018-01-25"
## [1001] "2018-01-26" "2018-01-29" "2018-01-30" "2018-01-31" "2018-02-01"
## [1006] "2018-02-02" "2018-02-05" "2018-02-06" "2018-02-07" "2018-02-08"
## [1011] "2018-02-09" "2018-02-12" "2018-02-21" "2018-02-22" "2018-02-23"
## [1016] "2018-02-26" "2018-02-27" "2018-03-01" "2018-03-02" "2018-03-05"
## [1021] "2018-03-06" "2018-03-07" "2018-03-08" "2018-03-09" "2018-03-12"
## [1026] "2018-03-13" "2018-03-14" "2018-03-15" "2018-03-16" "2018-03-19"
## [1031] "2018-03-20" "2018-03-21" "2018-03-22" "2018-03-23" "2018-03-26"
## [1036] "2018-03-27" "2018-03-28" "2018-03-29" "2018-03-30" "2018-03-31"
## [1041] "2018-04-02" "2018-04-03" "2018-04-09" "2018-04-10" "2018-04-11"
## [1046] "2018-04-12" "2018-04-13" "2018-04-16" "2018-04-17" "2018-04-18"
## [1051] "2018-04-19" "2018-04-20" "2018-04-23" "2018-04-24" "2018-04-25"
## [1056] "2018-04-26" "2018-04-27" "2018-04-30" "2018-05-02" "2018-05-03"
## [1061] "2018-05-04" "2018-05-07" "2018-05-08" "2018-05-09" "2018-05-10"
## [1066] "2018-05-11" "2018-05-14" "2018-05-15" "2018-05-16" "2018-05-17"
## [1071] "2018-05-18" "2018-05-21" "2018-05-22" "2018-05-23" "2018-05-24"
## [1076] "2018-05-25" "2018-05-28" "2018-05-29" "2018-05-30" "2018-05-31"
## [1081] "2018-06-01" "2018-06-04" "2018-06-05" "2018-06-06" "2018-06-07"
## [1086] "2018-06-08" "2018-06-11" "2018-06-12" "2018-06-13" "2018-06-14"
## [1091] "2018-06-15" "2018-06-19" "2018-06-20" "2018-06-21" "2018-06-22"
## [1096] "2018-06-25" "2018-06-26" "2018-06-27" "2018-06-28" "2018-06-29"
## [1101] "2018-07-02" "2018-07-03" "2018-07-04" "2018-07-05" "2018-07-06"
## [1106] "2018-07-09" "2018-07-10" "2018-07-11" "2018-07-12" "2018-07-13"
## [1111] "2018-07-16" "2018-07-17" "2018-07-18" "2018-07-19" "2018-07-20"
## [1116] "2018-07-23" "2018-07-24" "2018-07-25" "2018-07-26" "2018-07-27"
## [1121] "2018-07-30" "2018-07-31" "2018-08-01" "2018-08-02" "2018-08-03"
## [1126] "2018-08-06" "2018-08-07" "2018-08-08" "2018-08-09" "2018-08-10"
## [1131] "2018-08-13" "2018-08-14" "2018-08-15" "2018-08-16" "2018-08-17"
## [1136] "2018-08-20" "2018-08-21" "2018-08-22" "2018-08-23" "2018-08-24"
## [1141] "2018-08-27" "2018-08-28" "2018-08-29" "2018-08-30" "2018-08-31"
## [1146] "2018-09-03" "2018-09-04" "2018-09-05" "2018-09-06" "2018-09-07"
## [1151] "2018-09-10" "2018-09-11" "2018-09-12" "2018-09-13" "2018-09-14"
## [1156] "2018-09-17" "2018-09-18" "2018-09-19" "2018-09-20" "2018-09-21"
## [1161] "2018-09-25" "2018-09-26" "2018-09-27" "2018-09-28" "2018-10-01"
## [1166] "2018-10-02" "2018-10-03" "2018-10-04" "2018-10-05" "2018-10-08"
## [1171] "2018-10-09" "2018-10-11" "2018-10-12" "2018-10-15" "2018-10-16"
## [1176] "2018-10-17" "2018-10-18" "2018-10-19" "2018-10-22" "2018-10-23"
## [1181] "2018-10-24" "2018-10-25" "2018-10-26" "2018-10-29" "2018-10-30"
## [1186] "2018-10-31" "2018-11-01" "2018-11-02" "2018-11-05" "2018-11-06"
## [1191] "2018-11-07" "2018-11-08" "2018-11-09" "2018-11-12" "2018-11-13"
## [1196] "2018-11-14" "2018-11-15" "2018-11-16" "2018-11-19" "2018-11-20"
## [1201] "2018-11-21" "2018-11-22" "2018-11-23" "2018-11-26" "2018-11-27"
## [1206] "2018-11-28" "2018-11-29" "2018-11-30" "2018-12-03" "2018-12-04"
## [1211] "2018-12-05" "2018-12-06" "2018-12-07" "2018-12-10" "2018-12-11"
## [1216] "2018-12-12" "2018-12-13" "2018-12-14" "2018-12-17" "2018-12-18"
## [1221] "2018-12-19" "2018-12-20" "2018-12-21" "2018-12-22" "2018-12-24"
## [1226] "2018-12-25" "2018-12-26" "2018-12-27" "2018-12-28"
data1$prices
##            prices
## 2014-01-02     NA
## 2014-01-03     NA
## 2014-01-06     NA
## 2014-01-07     NA
## 2014-01-08     NA
## 2014-01-09     NA
## 2014-01-10     NA
## 2014-01-13     NA
## 2014-01-14     NA
## 2014-01-15     NA
## 2014-01-16     NA
## 2014-01-17     NA
## 2014-01-20     NA
## 2014-01-21     NA
## 2014-01-22     NA
## 2014-01-23     NA
## 2014-01-24     NA
## 2014-01-27     NA
## 2014-02-05     NA
## 2014-02-06     NA
## 2014-02-07     NA
## 2014-02-10     NA
## 2014-02-11     NA
## 2014-02-12     NA
## 2014-02-13     NA
## 2014-02-14     NA
## 2014-02-17     NA
## 2014-02-18     NA
## 2014-02-19     NA
## 2014-02-20     NA
## 2014-02-21     NA
## 2014-02-24     NA
## 2014-02-25     NA
## 2014-02-26     NA
## 2014-02-27     NA
## 2014-03-03     NA
## 2014-03-04     NA
## 2014-03-05     NA
## 2014-03-06     NA
## 2014-03-07     NA
## 2014-03-10     NA
## 2014-03-11     NA
## 2014-03-12     NA
## 2014-03-13     NA
## 2014-03-14     NA
## 2014-03-17     NA
## 2014-03-18     NA
## 2014-03-19     NA
## 2014-03-20     NA
## 2014-03-21     NA
## 2014-03-24     NA
## 2014-03-25     NA
## 2014-03-26     NA
## 2014-03-27     NA
## 2014-03-28     NA
## 2014-03-31     NA
## 2014-04-01     NA
## 2014-04-02     NA
## 2014-04-03     NA
## 2014-04-07     NA
## 2014-04-08     NA
## 2014-04-09     NA
## 2014-04-10     NA
## 2014-04-11     NA
## 2014-04-14     NA
## 2014-04-15     NA
## 2014-04-16     NA
## 2014-04-17     NA
## 2014-04-18     NA
## 2014-04-21     NA
## 2014-04-22     NA
## 2014-04-23     NA
## 2014-04-24     NA
## 2014-04-25     NA
## 2014-04-28     NA
## 2014-04-29     NA
## 2014-04-30     NA
## 2014-05-02     NA
## 2014-05-05     NA
## 2014-05-06     NA
## 2014-05-07     NA
## 2014-05-08     NA
## 2014-05-09     NA
## 2014-05-12     NA
## 2014-05-13     NA
## 2014-05-14     NA
## 2014-05-15     NA
## 2014-05-16     NA
## 2014-05-19     NA
## 2014-05-20     NA
## 2014-05-21     NA
## 2014-05-22     NA
## 2014-05-23     NA
## 2014-05-26     NA
## 2014-05-27     NA
## 2014-05-28     NA
## 2014-05-29     NA
## 2014-05-30     NA
## 2014-06-03     NA
## 2014-06-04     NA
## 2014-06-05     NA
## 2014-06-06     NA
## 2014-06-09     NA
## 2014-06-10     NA
## 2014-06-11     NA
## 2014-06-12     NA
## 2014-06-13     NA
## 2014-06-16     NA
## 2014-06-17     NA
## 2014-06-18     NA
## 2014-06-19     NA
## 2014-06-20     NA
## 2014-06-23     NA
## 2014-06-24     NA
## 2014-06-25     NA
## 2014-06-26     NA
## 2014-06-27     NA
## 2014-06-30     NA
## 2014-07-01     NA
## 2014-07-02     NA
## 2014-07-03     NA
## 2014-07-04     NA
## 2014-07-07     NA
## 2014-07-08     NA
## 2014-07-09     NA
## 2014-07-10     NA
## 2014-07-11     NA
## 2014-07-14     NA
## 2014-07-15     NA
## 2014-07-16     NA
## 2014-07-17     NA
## 2014-07-18     NA
## 2014-07-21     NA
## 2014-07-22     NA
## 2014-07-24     NA
## 2014-07-25     NA
## 2014-07-28     NA
## 2014-07-29     NA
## 2014-07-30     NA
## 2014-07-31     NA
## 2014-08-01     NA
## 2014-08-04     NA
## 2014-08-05     NA
## 2014-08-06     NA
## 2014-08-07     NA
## 2014-08-08     NA
## 2014-08-11     NA
## 2014-08-12     NA
## 2014-08-13     NA
## 2014-08-14     NA
## 2014-08-15     NA
## 2014-08-18     NA
## 2014-08-19     NA
## 2014-08-20     NA
## 2014-08-21     NA
## 2014-08-22     NA
## 2014-08-25     NA
## 2014-08-26     NA
## 2014-08-27     NA
## 2014-08-28     NA
## 2014-08-29     NA
## 2014-09-01     NA
## 2014-09-02     NA
## 2014-09-03     NA
## 2014-09-04     NA
## 2014-09-05     NA
## 2014-09-09     NA
## 2014-09-10     NA
## 2014-09-11     NA
## 2014-09-12     NA
## 2014-09-15     NA
## 2014-09-16     NA
## 2014-09-17     NA
## 2014-09-18     NA
## 2014-09-19     NA
## 2014-09-22     NA
## 2014-09-23     NA
## 2014-09-24     NA
## 2014-09-25     NA
## 2014-09-26     NA
## 2014-09-29     NA
## 2014-09-30     NA
## 2014-10-01     NA
## 2014-10-02     NA
## 2014-10-03     NA
## 2014-10-06     NA
## 2014-10-07     NA
## 2014-10-08     NA
## 2014-10-09     NA
## 2014-10-13     NA
## 2014-10-14     NA
## 2014-10-15     NA
## 2014-10-16     NA
## 2014-10-17     NA
## 2014-10-20     NA
## 2014-10-21     NA
## 2014-10-22     NA
## 2014-10-23     NA
## 2014-10-24     NA
## 2014-10-27     NA
## 2014-10-28     NA
## 2014-10-29     NA
## 2014-10-30     NA
## 2014-10-31     NA
## 2014-11-03     NA
## 2014-11-04     NA
## 2014-11-05     NA
## 2014-11-06     NA
## 2014-11-07     NA
## 2014-11-10     NA
## 2014-11-11     NA
## 2014-11-12     NA
## 2014-11-13     NA
## 2014-11-14     NA
## 2014-11-17     NA
## 2014-11-18     NA
## 2014-11-19     NA
## 2014-11-20     NA
## 2014-11-21     NA
## 2014-11-24     NA
## 2014-11-25     NA
## 2014-11-26     NA
## 2014-11-27     NA
## 2014-11-28     NA
## 2014-12-01     NA
## 2014-12-02     NA
## 2014-12-03     NA
## 2014-12-04     NA
## 2014-12-05     NA
## 2014-12-08     NA
## 2014-12-09     NA
## 2014-12-10     NA
## 2014-12-11     NA
## 2014-12-12     NA
## 2014-12-15     NA
## 2014-12-16     NA
## 2014-12-17     NA
## 2014-12-18     NA
## 2014-12-19     NA
## 2014-12-22     NA
## 2014-12-23     NA
## 2014-12-24     NA
## 2014-12-25     NA
## 2014-12-26     NA
## 2014-12-27     NA
## 2014-12-29     NA
## 2014-12-30     NA
## 2014-12-31     NA
## 2015-01-05     NA
## 2015-01-06     NA
## 2015-01-07     NA
## 2015-01-08     NA
## 2015-01-09     NA
## 2015-01-12     NA
## 2015-01-13     NA
## 2015-01-14     NA
## 2015-01-15     NA
## 2015-01-16     NA
## 2015-01-19     NA
## 2015-01-20     NA
## 2015-01-21     NA
## 2015-01-22     NA
## 2015-01-23     NA
## 2015-01-26     NA
## 2015-01-27     NA
## 2015-01-28     NA
## 2015-01-29     NA
## 2015-01-30     NA
## 2015-02-02     NA
## 2015-02-03     NA
## 2015-02-04     NA
## 2015-02-05     NA
## 2015-02-06     NA
## 2015-02-09     NA
## 2015-02-10     NA
## 2015-02-11     NA
## 2015-02-12     NA
## 2015-02-13     NA
## 2015-02-24     NA
## 2015-02-25     NA
## 2015-02-26     NA
## 2015-03-02     NA
## 2015-03-03     NA
## 2015-03-04     NA
## 2015-03-05     NA
## 2015-03-06     NA
## 2015-03-09     NA
## 2015-03-10     NA
## 2015-03-11     NA
## 2015-03-12     NA
## 2015-03-13     NA
## 2015-03-16     NA
## 2015-03-17     NA
## 2015-03-18     NA
## 2015-03-19     NA
## 2015-03-20     NA
## 2015-03-23     NA
## 2015-03-24     NA
## 2015-03-25     NA
## 2015-03-26     NA
## 2015-03-27     NA
## 2015-03-30     NA
## 2015-03-31     NA
## 2015-04-01     NA
## 2015-04-02     NA
## 2015-04-07     NA
## 2015-04-08     NA
## 2015-04-09     NA
## 2015-04-10     NA
## 2015-04-13     NA
## 2015-04-14     NA
## 2015-04-15     NA
## 2015-04-16     NA
## 2015-04-17     NA
## 2015-04-20     NA
## 2015-04-21     NA
## 2015-04-22     NA
## 2015-04-23     NA
## 2015-04-24     NA
## 2015-04-27     NA
## 2015-04-28     NA
## 2015-04-29     NA
## 2015-04-30     NA
## 2015-05-04     NA
## 2015-05-05     NA
## 2015-05-06     NA
## 2015-05-07     NA
## 2015-05-08     NA
## 2015-05-11     NA
## 2015-05-12     NA
## 2015-05-13     NA
## 2015-05-14     NA
## 2015-05-15     NA
## 2015-05-18     NA
## 2015-05-19     NA
## 2015-05-20     NA
## 2015-05-21     NA
## 2015-05-22     NA
## 2015-05-25     NA
## 2015-05-26     NA
## 2015-05-27     NA
## 2015-05-28     NA
## 2015-05-29     NA
## 2015-06-01     NA
## 2015-06-02     NA
## 2015-06-03     NA
## 2015-06-04     NA
## 2015-06-05     NA
## 2015-06-08     NA
## 2015-06-09     NA
## 2015-06-10     NA
## 2015-06-11     NA
## 2015-06-12     NA
## 2015-06-15     NA
## 2015-06-16     NA
## 2015-06-17     NA
## 2015-06-18     NA
## 2015-06-22     NA
## 2015-06-23     NA
## 2015-06-24     NA
## 2015-06-25     NA
## 2015-06-26     NA
## 2015-06-29     NA
## 2015-06-30     NA
## 2015-07-01     NA
## 2015-07-02     NA
## 2015-07-03     NA
## 2015-07-06     NA
## 2015-07-07     NA
## 2015-07-08     NA
## 2015-07-09     NA
## 2015-07-13     NA
## 2015-07-14     NA
## 2015-07-15     NA
## 2015-07-16     NA
## 2015-07-17     NA
## 2015-07-20     NA
## 2015-07-21     NA
## 2015-07-22     NA
## 2015-07-23     NA
## 2015-07-24     NA
## 2015-07-27     NA
## 2015-07-28     NA
## 2015-07-29     NA
## 2015-07-30     NA
## 2015-07-31     NA
## 2015-08-03     NA
## 2015-08-04     NA
## 2015-08-05     NA
## 2015-08-06     NA
## 2015-08-07     NA
## 2015-08-10     NA
## 2015-08-11     NA
## 2015-08-12     NA
## 2015-08-13     NA
## 2015-08-14     NA
## 2015-08-17     NA
## 2015-08-18     NA
## 2015-08-19     NA
## 2015-08-20     NA
## 2015-08-21     NA
## 2015-08-24     NA
## 2015-08-25     NA
## 2015-08-26     NA
## 2015-08-27     NA
## 2015-08-28     NA
## 2015-08-31     NA
## 2015-09-01     NA
## 2015-09-02     NA
## 2015-09-03     NA
## 2015-09-04     NA
## 2015-09-07     NA
## 2015-09-08     NA
## 2015-09-09     NA
## 2015-09-10     NA
## 2015-09-11     NA
## 2015-09-14     NA
## 2015-09-15     NA
## 2015-09-16     NA
## 2015-09-17     NA
## 2015-09-18     NA
## 2015-09-21     NA
## 2015-09-22     NA
## 2015-09-23     NA
## 2015-09-24     NA
## 2015-09-25     NA
## 2015-09-30     NA
## 2015-10-01     NA
## 2015-10-02     NA
## 2015-10-05     NA
## 2015-10-06     NA
## 2015-10-07     NA
## 2015-10-08     NA
## 2015-10-12     NA
## 2015-10-13     NA
## 2015-10-14     NA
## 2015-10-15     NA
## 2015-10-16     NA
## 2015-10-19     NA
## 2015-10-20     NA
## 2015-10-21     NA
## 2015-10-22     NA
## 2015-10-23     NA
## 2015-10-26     NA
## 2015-10-27     NA
## 2015-10-28     NA
## 2015-10-29     NA
## 2015-10-30     NA
## 2015-11-02     NA
## 2015-11-03     NA
## 2015-11-04     NA
## 2015-11-05     NA
## 2015-11-06     NA
## 2015-11-09     NA
## 2015-11-10     NA
## 2015-11-11     NA
## 2015-11-12     NA
## 2015-11-13     NA
## 2015-11-16     NA
## 2015-11-17     NA
## 2015-11-18     NA
## 2015-11-19     NA
## 2015-11-20     NA
## 2015-11-23     NA
## 2015-11-24     NA
## 2015-11-25     NA
## 2015-11-26     NA
## 2015-11-27     NA
## 2015-11-30     NA
## 2015-12-01     NA
## 2015-12-02     NA
## 2015-12-03     NA
## 2015-12-04     NA
## 2015-12-07     NA
## 2015-12-08     NA
## 2015-12-09     NA
## 2015-12-10     NA
## 2015-12-11     NA
## 2015-12-14     NA
## 2015-12-15     NA
## 2015-12-16     NA
## 2015-12-17     NA
## 2015-12-18     NA
## 2015-12-21     NA
## 2015-12-22     NA
## 2015-12-23     NA
## 2015-12-24     NA
## 2015-12-25     NA
## 2015-12-28     NA
## 2015-12-29     NA
## 2015-12-30     NA
## 2015-12-31     NA
## 2016-01-04     NA
## 2016-01-05     NA
## 2016-01-06     NA
## 2016-01-07     NA
## 2016-01-08     NA
## 2016-01-11     NA
## 2016-01-12     NA
## 2016-01-13     NA
## 2016-01-14     NA
## 2016-01-15     NA
## 2016-01-18     NA
## 2016-01-19     NA
## 2016-01-20     NA
## 2016-01-21     NA
## 2016-01-22     NA
## 2016-01-25     NA
## 2016-01-26     NA
## 2016-01-27     NA
## 2016-01-28     NA
## 2016-01-29     NA
## 2016-01-30     NA
## 2016-02-01     NA
## 2016-02-02     NA
## 2016-02-03     NA
## 2016-02-15     NA
## 2016-02-16     NA
## 2016-02-17     NA
## 2016-02-18     NA
## 2016-02-19     NA
## 2016-02-22     NA
## 2016-02-23     NA
## 2016-02-24     NA
## 2016-02-25     NA
## 2016-02-26     NA
## 2016-03-01     NA
## 2016-03-02     NA
## 2016-03-03     NA
## 2016-03-04     NA
## 2016-03-07     NA
## 2016-03-08     NA
## 2016-03-09     NA
## 2016-03-10     NA
## 2016-03-11     NA
## 2016-03-14     NA
## 2016-03-15     NA
## 2016-03-16     NA
## 2016-03-17     NA
## 2016-03-18     NA
## 2016-03-21     NA
## 2016-03-22     NA
## 2016-03-23     NA
## 2016-03-24     NA
## 2016-03-25     NA
## 2016-03-28     NA
## 2016-03-29     NA
## 2016-03-30     NA
## 2016-03-31     NA
## 2016-04-01     NA
## 2016-04-06     NA
## 2016-04-07     NA
## 2016-04-08     NA
## 2016-04-11     NA
## 2016-04-12     NA
## 2016-04-13     NA
## 2016-04-14     NA
## 2016-04-15     NA
## 2016-04-18     NA
## 2016-04-19     NA
## 2016-04-20     NA
## 2016-04-21     NA
## 2016-04-22     NA
## 2016-04-25     NA
## 2016-04-26     NA
## 2016-04-27     NA
## 2016-04-28     NA
## 2016-04-29     NA
## 2016-05-03     NA
## 2016-05-04     NA
## 2016-05-05     NA
## 2016-05-06     NA
## 2016-05-09     NA
## 2016-05-10     NA
## 2016-05-11     NA
## 2016-05-12     NA
## 2016-05-13     NA
## 2016-05-16     NA
## 2016-05-17     NA
## 2016-05-18     NA
## 2016-05-19     NA
## 2016-05-20     NA
## 2016-05-23     NA
## 2016-05-24     NA
## 2016-05-25     NA
## 2016-05-26     NA
## 2016-05-27     NA
## 2016-05-30     NA
## 2016-05-31     NA
## 2016-06-01     NA
## 2016-06-02     NA
## 2016-06-03     NA
## 2016-06-04     NA
## 2016-06-06     NA
## 2016-06-07     NA
## 2016-06-08     NA
## 2016-06-13     NA
## 2016-06-14     NA
## 2016-06-15     NA
## 2016-06-16     NA
## 2016-06-17     NA
## 2016-06-20     NA
## 2016-06-21     NA
## 2016-06-22     NA
## 2016-06-23     NA
## 2016-06-24     NA
## 2016-06-27     NA
## 2016-06-28     NA
## 2016-06-29     NA
## 2016-06-30     NA
## 2016-07-01     NA
## 2016-07-04     NA
## 2016-07-05     NA
## 2016-07-06     NA
## 2016-07-07     NA
## 2016-07-11     NA
## 2016-07-12     NA
## 2016-07-13     NA
## 2016-07-14     NA
## 2016-07-15     NA
## 2016-07-18     NA
## 2016-07-19     NA
## 2016-07-20     NA
## 2016-07-21     NA
## 2016-07-22     NA
## 2016-07-25     NA
## 2016-07-26     NA
## 2016-07-27     NA
## 2016-07-28     NA
## 2016-07-29     NA
## 2016-08-01     NA
## 2016-08-02     NA
## 2016-08-03     NA
## 2016-08-04     NA
## 2016-08-05     NA
## 2016-08-08     NA
## 2016-08-09     NA
## 2016-08-10     NA
## 2016-08-11     NA
## 2016-08-12     NA
## 2016-08-15     NA
## 2016-08-16     NA
## 2016-08-17     NA
## 2016-08-18     NA
## 2016-08-19     NA
## 2016-08-22     NA
## 2016-08-23     NA
## 2016-08-24     NA
## 2016-08-25     NA
## 2016-08-26     NA
## 2016-08-29     NA
## 2016-08-30     NA
## 2016-08-31     NA
## 2016-09-01     NA
## 2016-09-02     NA
## 2016-09-05     NA
## 2016-09-06     NA
## 2016-09-07     NA
## 2016-09-08     NA
## 2016-09-09     NA
## 2016-09-10     NA
## 2016-09-12     NA
## 2016-09-13     NA
## 2016-09-14     NA
## 2016-09-19     NA
## 2016-09-20     NA
## 2016-09-21     NA
## 2016-09-22     NA
## 2016-09-23     NA
## 2016-09-26     NA
## 2016-09-29     NA
## 2016-09-30     NA
## 2016-10-03     NA
## 2016-10-04     NA
## 2016-10-05     NA
## 2016-10-06     NA
## 2016-10-07     NA
## 2016-10-11     NA
## 2016-10-12     NA
## 2016-10-13     NA
## 2016-10-14     NA
## 2016-10-17     NA
## 2016-10-18     NA
## 2016-10-19     NA
## 2016-10-20     NA
## 2016-10-21     NA
## 2016-10-24     NA
## 2016-10-25     NA
## 2016-10-26     NA
## 2016-10-27     NA
## 2016-10-28     NA
## 2016-10-31     NA
## 2016-11-01     NA
## 2016-11-02     NA
## 2016-11-03     NA
## 2016-11-04     NA
## 2016-11-07     NA
## 2016-11-08     NA
## 2016-11-09     NA
## 2016-11-10     NA
## 2016-11-11     NA
## 2016-11-14     NA
## 2016-11-15     NA
## 2016-11-16     NA
## 2016-11-17     NA
## 2016-11-18     NA
## 2016-11-21     NA
## 2016-11-22     NA
## 2016-11-23     NA
## 2016-11-24     NA
## 2016-11-25     NA
## 2016-11-28     NA
## 2016-11-29     NA
## 2016-11-30     NA
## 2016-12-01     NA
## 2016-12-02     NA
## 2016-12-05     NA
## 2016-12-06     NA
## 2016-12-07     NA
## 2016-12-08     NA
## 2016-12-09     NA
## 2016-12-12     NA
## 2016-12-13     NA
## 2016-12-14     NA
## 2016-12-15     NA
## 2016-12-16     NA
## 2016-12-19     NA
## 2016-12-20     NA
## 2016-12-21     NA
## 2016-12-22     NA
## 2016-12-23     NA
## 2016-12-26     NA
## 2016-12-27     NA
## 2016-12-28     NA
## 2016-12-29     NA
## 2016-12-30     NA
## 2017-01-03     NA
## 2017-01-04     NA
## 2017-01-05     NA
## 2017-01-06     NA
## 2017-01-09     NA
## 2017-01-10     NA
## 2017-01-11     NA
## 2017-01-12     NA
## 2017-01-13     NA
## 2017-01-16     NA
## 2017-01-17     NA
## 2017-01-18     NA
## 2017-01-19     NA
## 2017-01-20     NA
## 2017-01-23     NA
## 2017-01-24     NA
## 2017-02-02     NA
## 2017-02-03     NA
## 2017-02-06     NA
## 2017-02-07     NA
## 2017-02-08     NA
## 2017-02-09     NA
## 2017-02-10     NA
## 2017-02-13     NA
## 2017-02-14     NA
## 2017-02-15     NA
## 2017-02-16     NA
## 2017-02-17     NA
## 2017-02-18     NA
## 2017-02-20     NA
## 2017-02-21     NA
## 2017-02-22     NA
## 2017-02-23     NA
## 2017-02-24     NA
## 2017-03-01     NA
## 2017-03-02     NA
## 2017-03-03     NA
## 2017-03-06     NA
## 2017-03-07     NA
## 2017-03-08     NA
## 2017-03-09     NA
## 2017-03-10     NA
## 2017-03-13     NA
## 2017-03-14     NA
## 2017-03-15     NA
## 2017-03-16     NA
## 2017-03-17     NA
## 2017-03-20     NA
## 2017-03-21     NA
## 2017-03-22     NA
## 2017-03-23     NA
## 2017-03-24     NA
## 2017-03-27     NA
## 2017-03-28     NA
## 2017-03-29     NA
## 2017-03-30     NA
## 2017-03-31     NA
## 2017-04-05     NA
## 2017-04-06     NA
## 2017-04-07     NA
## 2017-04-10     NA
## 2017-04-11     NA
## 2017-04-12     NA
## 2017-04-13     NA
## 2017-04-14     NA
## 2017-04-17     NA
## 2017-04-18     NA
## 2017-04-19     NA
## 2017-04-20     NA
## 2017-04-21     NA
## 2017-04-24     NA
## 2017-04-25     NA
## 2017-04-26     NA
## 2017-04-27     NA
## 2017-04-28     NA
## 2017-05-02     NA
## 2017-05-03     NA
## 2017-05-04     NA
## 2017-05-05     NA
## 2017-05-08     NA
## 2017-05-09     NA
## 2017-05-10     NA
## 2017-05-11     NA
## 2017-05-12     NA
## 2017-05-15     NA
## 2017-05-16     NA
## 2017-05-17     NA
## 2017-05-18     NA
## 2017-05-19     NA
## 2017-05-22     NA
## 2017-05-23     NA
## 2017-05-24     NA
## 2017-05-25     NA
## 2017-05-26     NA
## 2017-05-31     NA
## 2017-06-01     NA
## 2017-06-02     NA
## 2017-06-03     NA
## 2017-06-05     NA
## 2017-06-06     NA
## 2017-06-07     NA
## 2017-06-08     NA
## 2017-06-09     NA
## 2017-06-12     NA
## 2017-06-13     NA
## 2017-06-14     NA
## 2017-06-15     NA
## 2017-06-16     NA
## 2017-06-19     NA
## 2017-06-20     NA
## 2017-06-21     NA
## 2017-06-22     NA
## 2017-06-23     NA
## 2017-06-26     NA
## 2017-06-27     NA
## 2017-06-28     NA
## 2017-06-29     NA
## 2017-06-30     NA
## 2017-07-03     NA
## 2017-07-04     NA
## 2017-07-05     NA
## 2017-07-06     NA
## 2017-07-07     NA
## 2017-07-10     NA
## 2017-07-11     NA
## 2017-07-12     NA
## 2017-07-13     NA
## 2017-07-14     NA
## 2017-07-17     NA
## 2017-07-18     NA
## 2017-07-19     NA
## 2017-07-20     NA
## 2017-07-21     NA
## 2017-07-24     NA
## 2017-07-25     NA
## 2017-07-26     NA
## 2017-07-27     NA
## 2017-07-28     NA
## 2017-07-31     NA
## 2017-08-01     NA
## 2017-08-02     NA
## 2017-08-03     NA
## 2017-08-04     NA
## 2017-08-07     NA
## 2017-08-08     NA
## 2017-08-09     NA
## 2017-08-10     NA
## 2017-08-11     NA
## 2017-08-14     NA
## 2017-08-15     NA
## 2017-08-16     NA
## 2017-08-17     NA
## 2017-08-18     NA
## 2017-08-21     NA
## 2017-08-22     NA
## 2017-08-23     NA
## 2017-08-24     NA
## 2017-08-25     NA
## 2017-08-28     NA
## 2017-08-29     NA
## 2017-08-30     NA
## 2017-08-31     NA
## 2017-09-01     NA
## 2017-09-04     NA
## 2017-09-05     NA
## 2017-09-06     NA
## 2017-09-07     NA
## 2017-09-08     NA
## 2017-09-11     NA
## 2017-09-12     NA
## 2017-09-13     NA
## 2017-09-14     NA
## 2017-09-15     NA
## 2017-09-18     NA
## 2017-09-19     NA
## 2017-09-20     NA
## 2017-09-21     NA
## 2017-09-22     NA
## 2017-09-25     NA
## 2017-09-26     NA
## 2017-09-27     NA
## 2017-09-28     NA
## 2017-09-29     NA
## 2017-09-30     NA
## 2017-10-02     NA
## 2017-10-03     NA
## 2017-10-05     NA
## 2017-10-06     NA
## 2017-10-11     NA
## 2017-10-12     NA
## 2017-10-13     NA
## 2017-10-16     NA
## 2017-10-17     NA
## 2017-10-18     NA
## 2017-10-19     NA
## 2017-10-20     NA
## 2017-10-23     NA
## 2017-10-24     NA
## 2017-10-25     NA
## 2017-10-26     NA
## 2017-10-27     NA
## 2017-10-30     NA
## 2017-10-31     NA
## 2017-11-01     NA
## 2017-11-02     NA
## 2017-11-03     NA
## 2017-11-06     NA
## 2017-11-07     NA
## 2017-11-08     NA
## 2017-11-09     NA
## 2017-11-10     NA
## 2017-11-13     NA
## 2017-11-14     NA
## 2017-11-15     NA
## 2017-11-16     NA
## 2017-11-17     NA
## 2017-11-20     NA
## 2017-11-21     NA
## 2017-11-22     NA
## 2017-11-23     NA
## 2017-11-24     NA
## 2017-11-27     NA
## 2017-11-28     NA
## 2017-11-29     NA
## 2017-11-30     NA
## 2017-12-01     NA
## 2017-12-04     NA
## 2017-12-05     NA
## 2017-12-06     NA
## 2017-12-07     NA
## 2017-12-08     NA
## 2017-12-11     NA
## 2017-12-12     NA
## 2017-12-13     NA
## 2017-12-14     NA
## 2017-12-15     NA
## 2017-12-18     NA
## 2017-12-19     NA
## 2017-12-20     NA
## 2017-12-21     NA
## 2017-12-22     NA
## 2017-12-25     NA
## 2017-12-26     NA
## 2017-12-27     NA
## 2017-12-28     NA
## 2017-12-29     NA
## 2018-01-02     NA
## 2018-01-03     NA
## 2018-01-04     NA
## 2018-01-05     NA
## 2018-01-08     NA
## 2018-01-09     NA
## 2018-01-10     NA
## 2018-01-11     NA
## 2018-01-12     NA
## 2018-01-15     NA
## 2018-01-16     NA
## 2018-01-17     NA
## 2018-01-18     NA
## 2018-01-19     NA
## 2018-01-22     NA
## 2018-01-23     NA
## 2018-01-24     NA
## 2018-01-25     NA
## 2018-01-26     NA
## 2018-01-29     NA
## 2018-01-30     NA
## 2018-01-31     NA
## 2018-02-01     NA
## 2018-02-02     NA
## 2018-02-05     NA
## 2018-02-06     NA
## 2018-02-07     NA
## 2018-02-08     NA
## 2018-02-09     NA
## 2018-02-12     NA
## 2018-02-21     NA
## 2018-02-22     NA
## 2018-02-23     NA
## 2018-02-26     NA
## 2018-02-27     NA
## 2018-03-01     NA
## 2018-03-02     NA
## 2018-03-05     NA
## 2018-03-06     NA
## 2018-03-07     NA
## 2018-03-08     NA
## 2018-03-09     NA
## 2018-03-12     NA
## 2018-03-13     NA
## 2018-03-14     NA
## 2018-03-15     NA
## 2018-03-16     NA
## 2018-03-19     NA
## 2018-03-20     NA
## 2018-03-21     NA
## 2018-03-22     NA
## 2018-03-23     NA
## 2018-03-26     NA
## 2018-03-27     NA
## 2018-03-28     NA
## 2018-03-29     NA
## 2018-03-30     NA
## 2018-03-31     NA
## 2018-04-02     NA
## 2018-04-03     NA
## 2018-04-09     NA
## 2018-04-10     NA
## 2018-04-11     NA
## 2018-04-12     NA
## 2018-04-13     NA
## 2018-04-16     NA
## 2018-04-17     NA
## 2018-04-18     NA
## 2018-04-19     NA
## 2018-04-20     NA
## 2018-04-23     NA
## 2018-04-24     NA
## 2018-04-25     NA
## 2018-04-26     NA
## 2018-04-27     NA
## 2018-04-30     NA
## 2018-05-02     NA
## 2018-05-03     NA
## 2018-05-04     NA
## 2018-05-07     NA
## 2018-05-08     NA
## 2018-05-09     NA
## 2018-05-10     NA
## 2018-05-11     NA
## 2018-05-14     NA
## 2018-05-15     NA
## 2018-05-16     NA
## 2018-05-17     NA
## 2018-05-18     NA
## 2018-05-21     NA
## 2018-05-22     NA
## 2018-05-23     NA
## 2018-05-24     NA
## 2018-05-25     NA
## 2018-05-28     NA
## 2018-05-29     NA
## 2018-05-30     NA
## 2018-05-31     NA
## 2018-06-01     NA
## 2018-06-04     NA
## 2018-06-05     NA
## 2018-06-06     NA
## 2018-06-07     NA
## 2018-06-08     NA
## 2018-06-11     NA
## 2018-06-12     NA
## 2018-06-13     NA
## 2018-06-14     NA
## 2018-06-15     NA
## 2018-06-19     NA
## 2018-06-20     NA
## 2018-06-21     NA
## 2018-06-22     NA
## 2018-06-25     NA
## 2018-06-26     NA
## 2018-06-27     NA
## 2018-06-28     NA
## 2018-06-29     NA
## 2018-07-02     NA
## 2018-07-03     NA
## 2018-07-04     NA
## 2018-07-05     NA
## 2018-07-06     NA
## 2018-07-09     NA
## 2018-07-10     NA
## 2018-07-11     NA
## 2018-07-12     NA
## 2018-07-13     NA
## 2018-07-16     NA
## 2018-07-17     NA
## 2018-07-18     NA
## 2018-07-19     NA
## 2018-07-20     NA
## 2018-07-23     NA
## 2018-07-24     NA
## 2018-07-25     NA
## 2018-07-26     NA
## 2018-07-27     NA
## 2018-07-30     NA
## 2018-07-31     NA
## 2018-08-01     NA
## 2018-08-02     NA
## 2018-08-03     NA
## 2018-08-06     NA
## 2018-08-07     NA
## 2018-08-08     NA
## 2018-08-09     NA
## 2018-08-10     NA
## 2018-08-13     NA
## 2018-08-14     NA
## 2018-08-15     NA
## 2018-08-16     NA
## 2018-08-17     NA
## 2018-08-20     NA
## 2018-08-21     NA
## 2018-08-22     NA
## 2018-08-23     NA
## 2018-08-24     NA
## 2018-08-27     NA
## 2018-08-28     NA
## 2018-08-29     NA
## 2018-08-30     NA
## 2018-08-31     NA
## 2018-09-03     NA
## 2018-09-04     NA
## 2018-09-05     NA
## 2018-09-06     NA
## 2018-09-07     NA
## 2018-09-10     NA
## 2018-09-11     NA
## 2018-09-12     NA
## 2018-09-13     NA
## 2018-09-14     NA
## 2018-09-17     NA
## 2018-09-18     NA
## 2018-09-19     NA
## 2018-09-20     NA
## 2018-09-21     NA
## 2018-09-25     NA
## 2018-09-26     NA
## 2018-09-27     NA
## 2018-09-28     NA
## 2018-10-01     NA
## 2018-10-02     NA
## 2018-10-03     NA
## 2018-10-04     NA
## 2018-10-05     NA
## 2018-10-08     NA
## 2018-10-09     NA
## 2018-10-11     NA
## 2018-10-12     NA
## 2018-10-15     NA
## 2018-10-16     NA
## 2018-10-17     NA
## 2018-10-18     NA
## 2018-10-19     NA
## 2018-10-22     NA
## 2018-10-23     NA
## 2018-10-24     NA
## 2018-10-25     NA
## 2018-10-26     NA
## 2018-10-29     NA
## 2018-10-30     NA
## 2018-10-31     NA
## 2018-11-01     NA
## 2018-11-02     NA
## 2018-11-05     NA
## 2018-11-06     NA
## 2018-11-07     NA
## 2018-11-08     NA
## 2018-11-09     NA
## 2018-11-12     NA
## 2018-11-13     NA
## 2018-11-14     NA
## 2018-11-15     NA
## 2018-11-16     NA
## 2018-11-19     NA
## 2018-11-20     NA
## 2018-11-21     NA
## 2018-11-22     NA
## 2018-11-23     NA
## 2018-11-26     NA
## 2018-11-27     NA
## 2018-11-28     NA
## 2018-11-29     NA
## 2018-11-30     NA
## 2018-12-03     NA
## 2018-12-04     NA
## 2018-12-05     NA
## 2018-12-06     NA
## 2018-12-07     NA
## 2018-12-10     NA
## 2018-12-11     NA
## 2018-12-12     NA
## 2018-12-13     NA
## 2018-12-14     NA
## 2018-12-17     NA
## 2018-12-18     NA
## 2018-12-19     NA
## 2018-12-20     NA
## 2018-12-21     NA
## 2018-12-22     NA
## 2018-12-24     NA
## 2018-12-25     NA
## 2018-12-26     NA
## 2018-12-27     NA
## 2018-12-28     NA
data1$prices<-prices

class(data1$dates)
## [1] "Date"
data1$execution.price = prices
data1$weight[] = 1
buy.hold.1101 <- bt.run.share(data1, clean.signal=F, trade.summary = TRUE)
## Latest weights :
##            prices
## 2018-12-28    100
## 
## Performance summary :
##  CAGR    Best    Worst   
##  1.7 6.9 -8.1    
buy.hold.1101 <-bt.run(data1)
## Latest weights :
##            prices
## 2018-12-28    100
## 
## Performance summary :
##  CAGR    Best    Worst   
##  1.7 6.9 -8.1    

讀取sma 90天的資料。

sma1101<-SMA(prices, 90)
head(sma1101, 91)
##                 SMA
## 2014-01-02       NA
## 2014-01-03       NA
## 2014-01-06       NA
## 2014-01-07       NA
## 2014-01-08       NA
## 2014-01-09       NA
## 2014-01-10       NA
## 2014-01-13       NA
## 2014-01-14       NA
## 2014-01-15       NA
## 2014-01-16       NA
## 2014-01-17       NA
## 2014-01-20       NA
## 2014-01-21       NA
## 2014-01-22       NA
## 2014-01-23       NA
## 2014-01-24       NA
## 2014-01-27       NA
## 2014-02-05       NA
## 2014-02-06       NA
## 2014-02-07       NA
## 2014-02-10       NA
## 2014-02-11       NA
## 2014-02-12       NA
## 2014-02-13       NA
## 2014-02-14       NA
## 2014-02-17       NA
## 2014-02-18       NA
## 2014-02-19       NA
## 2014-02-20       NA
## 2014-02-21       NA
## 2014-02-24       NA
## 2014-02-25       NA
## 2014-02-26       NA
## 2014-02-27       NA
## 2014-03-03       NA
## 2014-03-04       NA
## 2014-03-05       NA
## 2014-03-06       NA
## 2014-03-07       NA
## 2014-03-10       NA
## 2014-03-11       NA
## 2014-03-12       NA
## 2014-03-13       NA
## 2014-03-14       NA
## 2014-03-17       NA
## 2014-03-18       NA
## 2014-03-19       NA
## 2014-03-20       NA
## 2014-03-21       NA
## 2014-03-24       NA
## 2014-03-25       NA
## 2014-03-26       NA
## 2014-03-27       NA
## 2014-03-28       NA
## 2014-03-31       NA
## 2014-04-01       NA
## 2014-04-02       NA
## 2014-04-03       NA
## 2014-04-07       NA
## 2014-04-08       NA
## 2014-04-09       NA
## 2014-04-10       NA
## 2014-04-11       NA
## 2014-04-14       NA
## 2014-04-15       NA
## 2014-04-16       NA
## 2014-04-17       NA
## 2014-04-18       NA
## 2014-04-21       NA
## 2014-04-22       NA
## 2014-04-23       NA
## 2014-04-24       NA
## 2014-04-25       NA
## 2014-04-28       NA
## 2014-04-29       NA
## 2014-04-30       NA
## 2014-05-02       NA
## 2014-05-05       NA
## 2014-05-06       NA
## 2014-05-07       NA
## 2014-05-08       NA
## 2014-05-09       NA
## 2014-05-12       NA
## 2014-05-13       NA
## 2014-05-14       NA
## 2014-05-15       NA
## 2014-05-16       NA
## 2014-05-19       NA
## 2014-05-20 33.37589
## 2014-05-21 33.36467
data1$weight[] <- iif(prices >= sma1101, 1, 0)
sma90.1101 <- bt.run(data1, trade.summary=T)
## Latest weights :
##            prices
## 2018-12-28      0
## 
## Performance summary :
##  CAGR    Best    Worst   
##  0.6 6.7 -8.1    
data1$weight[] <- iif(prices >= sma1101, 1, -1)
sma90.1101.short <- bt.run(data1, trade.summary=T)
## Latest weights :
##            prices
## 2018-12-28   -100
## 
## Performance summary :
##  CAGR    Best    Worst   
##  -2.9    6.7 -8.1    
models<-list("SMA1101"= sma90.1101, 
             "SMA1101_short" = sma90.1101.short, 
             "BH 1101" = buy.hold.1101)

第一、二張圖:

黑色線為SMA1101 1.03,紅色線為SMA1101_short 0.86,綠色線為BH 1101 1.09。並顯示出表格。

strategy.performance.snapshoot(models, T)

## NULL

第三張圖:

顯示出Sharpe、DVR、Cagr、MaxDD四個的長條圖。

strategy.performance.snapshoot(models, control=list(comparison=T), sort.performance=T)

第四張圖:

顯示為表格。

plotbt.strategy.sidebyside(models, return.table=T)

##            SMA1101                 SMA1101_short          
## Period     "一月2014 - 十二月2018" "一月2014 - 十二月2018"
## Cagr       "0.65"                  "-2.87"                
## Sharpe     "0.13"                  "-0.01"                
## DVR        "0.01"                  "0"                    
## Volatility "17.56"                 "23.83"                
## MaxDD      "-29.23"                "-31.99"               
## AvgDD      "-6.54"                 "-9.65"                
## VaR        "-1.81"                 "-2.36"                
## CVaR       "-2.71"                 "-3.34"                
## Exposure   "49.15"                 "99.92"                
##            BH 1101                
## Period     "一月2014 - 十二月2018"
## Cagr       "1.68"                 
## Sharpe     "0.19"                 
## DVR        "0.01"                 
## Volatility "23.83"                
## MaxDD      "-45.04"               
## AvgDD      "-7.78"                
## VaR        "-2.35"                
## CVaR       "-3.28"                
## Exposure   "99.92"
library(ggplot2)
## Warning: package 'ggplot2' was built under R version 3.5.3
all.1101<-merge.xts(sma90.1101$equity, 
                    sma90.1101.short$equity, 
                    buy.hold.1101$equity)
colnames(all.1101)<-c("sma1101", "sma1101 short", "BH")
head(all.1101)
##            sma1101 sma1101 short        BH
## 2014-01-02       1      1.000000 1.0000000
## 2014-01-03       1      1.018620 0.9813797
## 2014-01-06       1      1.040482 0.9603175
## 2014-01-07       1      1.027253 0.9725275
## 2014-01-08       1      1.033056 0.9670330
## 2014-01-09       1      1.056535 0.9450549
all.1101.long<-fortify(all.1101, melt=T)
head(all.1101.long)
##        Index  Series Value
## 1 2014-01-02 sma1101     1
## 2 2014-01-03 sma1101     1
## 3 2014-01-06 sma1101     1
## 4 2014-01-07 sma1101     1
## 5 2014-01-08 sma1101     1
## 6 2014-01-09 sma1101     1

圖的標題為Cumulative returns of 1101s。

X軸為year,Y軸為cumulative returns。

粉紅色線為sma1101,綠色線為sma1101 short,藍色線為BH。

title = "Cumulative returns of 1101s"
p = ggplot(all.1101.long, aes(x = Index, y = Value)) +
  geom_line(aes(linetype = Series, color = Series)) +
  #geom_point(aes(shape = Series))+
  xlab("year") + ylab("cumulative returns")+
  ggtitle(title)
p

1216

讀取1216的資料。

library(xts)
data1<-new.env()
data1$prices<-tw20.all.1$'1216'
prices<-data1$prices
sma1216<-SMA(prices, 90)
head(sma1216, 91)
##                 SMA
## 2014-01-02       NA
## 2014-01-03       NA
## 2014-01-06       NA
## 2014-01-07       NA
## 2014-01-08       NA
## 2014-01-09       NA
## 2014-01-10       NA
## 2014-01-13       NA
## 2014-01-14       NA
## 2014-01-15       NA
## 2014-01-16       NA
## 2014-01-17       NA
## 2014-01-20       NA
## 2014-01-21       NA
## 2014-01-22       NA
## 2014-01-23       NA
## 2014-01-24       NA
## 2014-01-27       NA
## 2014-02-05       NA
## 2014-02-06       NA
## 2014-02-07       NA
## 2014-02-10       NA
## 2014-02-11       NA
## 2014-02-12       NA
## 2014-02-13       NA
## 2014-02-14       NA
## 2014-02-17       NA
## 2014-02-18       NA
## 2014-02-19       NA
## 2014-02-20       NA
## 2014-02-21       NA
## 2014-02-24       NA
## 2014-02-25       NA
## 2014-02-26       NA
## 2014-02-27       NA
## 2014-03-03       NA
## 2014-03-04       NA
## 2014-03-05       NA
## 2014-03-06       NA
## 2014-03-07       NA
## 2014-03-10       NA
## 2014-03-11       NA
## 2014-03-12       NA
## 2014-03-13       NA
## 2014-03-14       NA
## 2014-03-17       NA
## 2014-03-18       NA
## 2014-03-19       NA
## 2014-03-20       NA
## 2014-03-21       NA
## 2014-03-24       NA
## 2014-03-25       NA
## 2014-03-26       NA
## 2014-03-27       NA
## 2014-03-28       NA
## 2014-03-31       NA
## 2014-04-01       NA
## 2014-04-02       NA
## 2014-04-03       NA
## 2014-04-07       NA
## 2014-04-08       NA
## 2014-04-09       NA
## 2014-04-10       NA
## 2014-04-11       NA
## 2014-04-14       NA
## 2014-04-15       NA
## 2014-04-16       NA
## 2014-04-17       NA
## 2014-04-18       NA
## 2014-04-21       NA
## 2014-04-22       NA
## 2014-04-23       NA
## 2014-04-24       NA
## 2014-04-25       NA
## 2014-04-28       NA
## 2014-04-29       NA
## 2014-04-30       NA
## 2014-05-02       NA
## 2014-05-05       NA
## 2014-05-06       NA
## 2014-05-07       NA
## 2014-05-08       NA
## 2014-05-09       NA
## 2014-05-12       NA
## 2014-05-13       NA
## 2014-05-14       NA
## 2014-05-15       NA
## 2014-05-16       NA
## 2014-05-19       NA
## 2014-05-20 38.13300
## 2014-05-21 38.11222

分別看日期、價錢。

bt.prep(data1, align='keep.all')
names(data1)
## [1] "prices"          "dates"           "weight"          "symbolnames"    
## [5] "execution.price"
data1$dates
##    [1] "2014-01-02" "2014-01-03" "2014-01-06" "2014-01-07" "2014-01-08"
##    [6] "2014-01-09" "2014-01-10" "2014-01-13" "2014-01-14" "2014-01-15"
##   [11] "2014-01-16" "2014-01-17" "2014-01-20" "2014-01-21" "2014-01-22"
##   [16] "2014-01-23" "2014-01-24" "2014-01-27" "2014-02-05" "2014-02-06"
##   [21] "2014-02-07" "2014-02-10" "2014-02-11" "2014-02-12" "2014-02-13"
##   [26] "2014-02-14" "2014-02-17" "2014-02-18" "2014-02-19" "2014-02-20"
##   [31] "2014-02-21" "2014-02-24" "2014-02-25" "2014-02-26" "2014-02-27"
##   [36] "2014-03-03" "2014-03-04" "2014-03-05" "2014-03-06" "2014-03-07"
##   [41] "2014-03-10" "2014-03-11" "2014-03-12" "2014-03-13" "2014-03-14"
##   [46] "2014-03-17" "2014-03-18" "2014-03-19" "2014-03-20" "2014-03-21"
##   [51] "2014-03-24" "2014-03-25" "2014-03-26" "2014-03-27" "2014-03-28"
##   [56] "2014-03-31" "2014-04-01" "2014-04-02" "2014-04-03" "2014-04-07"
##   [61] "2014-04-08" "2014-04-09" "2014-04-10" "2014-04-11" "2014-04-14"
##   [66] "2014-04-15" "2014-04-16" "2014-04-17" "2014-04-18" "2014-04-21"
##   [71] "2014-04-22" "2014-04-23" "2014-04-24" "2014-04-25" "2014-04-28"
##   [76] "2014-04-29" "2014-04-30" "2014-05-02" "2014-05-05" "2014-05-06"
##   [81] "2014-05-07" "2014-05-08" "2014-05-09" "2014-05-12" "2014-05-13"
##   [86] "2014-05-14" "2014-05-15" "2014-05-16" "2014-05-19" "2014-05-20"
##   [91] "2014-05-21" "2014-05-22" "2014-05-23" "2014-05-26" "2014-05-27"
##   [96] "2014-05-28" "2014-05-29" "2014-05-30" "2014-06-03" "2014-06-04"
##  [101] "2014-06-05" "2014-06-06" "2014-06-09" "2014-06-10" "2014-06-11"
##  [106] "2014-06-12" "2014-06-13" "2014-06-16" "2014-06-17" "2014-06-18"
##  [111] "2014-06-19" "2014-06-20" "2014-06-23" "2014-06-24" "2014-06-25"
##  [116] "2014-06-26" "2014-06-27" "2014-06-30" "2014-07-01" "2014-07-02"
##  [121] "2014-07-03" "2014-07-04" "2014-07-07" "2014-07-08" "2014-07-09"
##  [126] "2014-07-10" "2014-07-11" "2014-07-14" "2014-07-15" "2014-07-16"
##  [131] "2014-07-17" "2014-07-18" "2014-07-21" "2014-07-22" "2014-07-24"
##  [136] "2014-07-25" "2014-07-28" "2014-07-29" "2014-07-30" "2014-07-31"
##  [141] "2014-08-01" "2014-08-04" "2014-08-05" "2014-08-06" "2014-08-07"
##  [146] "2014-08-08" "2014-08-11" "2014-08-12" "2014-08-13" "2014-08-14"
##  [151] "2014-08-15" "2014-08-18" "2014-08-19" "2014-08-20" "2014-08-21"
##  [156] "2014-08-22" "2014-08-25" "2014-08-26" "2014-08-27" "2014-08-28"
##  [161] "2014-08-29" "2014-09-01" "2014-09-02" "2014-09-03" "2014-09-04"
##  [166] "2014-09-05" "2014-09-09" "2014-09-10" "2014-09-11" "2014-09-12"
##  [171] "2014-09-15" "2014-09-16" "2014-09-17" "2014-09-18" "2014-09-19"
##  [176] "2014-09-22" "2014-09-23" "2014-09-24" "2014-09-25" "2014-09-26"
##  [181] "2014-09-29" "2014-09-30" "2014-10-01" "2014-10-02" "2014-10-03"
##  [186] "2014-10-06" "2014-10-07" "2014-10-08" "2014-10-09" "2014-10-13"
##  [191] "2014-10-14" "2014-10-15" "2014-10-16" "2014-10-17" "2014-10-20"
##  [196] "2014-10-21" "2014-10-22" "2014-10-23" "2014-10-24" "2014-10-27"
##  [201] "2014-10-28" "2014-10-29" "2014-10-30" "2014-10-31" "2014-11-03"
##  [206] "2014-11-04" "2014-11-05" "2014-11-06" "2014-11-07" "2014-11-10"
##  [211] "2014-11-11" "2014-11-12" "2014-11-13" "2014-11-14" "2014-11-17"
##  [216] "2014-11-18" "2014-11-19" "2014-11-20" "2014-11-21" "2014-11-24"
##  [221] "2014-11-25" "2014-11-26" "2014-11-27" "2014-11-28" "2014-12-01"
##  [226] "2014-12-02" "2014-12-03" "2014-12-04" "2014-12-05" "2014-12-08"
##  [231] "2014-12-09" "2014-12-10" "2014-12-11" "2014-12-12" "2014-12-15"
##  [236] "2014-12-16" "2014-12-17" "2014-12-18" "2014-12-19" "2014-12-22"
##  [241] "2014-12-23" "2014-12-24" "2014-12-25" "2014-12-26" "2014-12-27"
##  [246] "2014-12-29" "2014-12-30" "2014-12-31" "2015-01-05" "2015-01-06"
##  [251] "2015-01-07" "2015-01-08" "2015-01-09" "2015-01-12" "2015-01-13"
##  [256] "2015-01-14" "2015-01-15" "2015-01-16" "2015-01-19" "2015-01-20"
##  [261] "2015-01-21" "2015-01-22" "2015-01-23" "2015-01-26" "2015-01-27"
##  [266] "2015-01-28" "2015-01-29" "2015-01-30" "2015-02-02" "2015-02-03"
##  [271] "2015-02-04" "2015-02-05" "2015-02-06" "2015-02-09" "2015-02-10"
##  [276] "2015-02-11" "2015-02-12" "2015-02-13" "2015-02-24" "2015-02-25"
##  [281] "2015-02-26" "2015-03-02" "2015-03-03" "2015-03-04" "2015-03-05"
##  [286] "2015-03-06" "2015-03-09" "2015-03-10" "2015-03-11" "2015-03-12"
##  [291] "2015-03-13" "2015-03-16" "2015-03-17" "2015-03-18" "2015-03-19"
##  [296] "2015-03-20" "2015-03-23" "2015-03-24" "2015-03-25" "2015-03-26"
##  [301] "2015-03-27" "2015-03-30" "2015-03-31" "2015-04-01" "2015-04-02"
##  [306] "2015-04-07" "2015-04-08" "2015-04-09" "2015-04-10" "2015-04-13"
##  [311] "2015-04-14" "2015-04-15" "2015-04-16" "2015-04-17" "2015-04-20"
##  [316] "2015-04-21" "2015-04-22" "2015-04-23" "2015-04-24" "2015-04-27"
##  [321] "2015-04-28" "2015-04-29" "2015-04-30" "2015-05-04" "2015-05-05"
##  [326] "2015-05-06" "2015-05-07" "2015-05-08" "2015-05-11" "2015-05-12"
##  [331] "2015-05-13" "2015-05-14" "2015-05-15" "2015-05-18" "2015-05-19"
##  [336] "2015-05-20" "2015-05-21" "2015-05-22" "2015-05-25" "2015-05-26"
##  [341] "2015-05-27" "2015-05-28" "2015-05-29" "2015-06-01" "2015-06-02"
##  [346] "2015-06-03" "2015-06-04" "2015-06-05" "2015-06-08" "2015-06-09"
##  [351] "2015-06-10" "2015-06-11" "2015-06-12" "2015-06-15" "2015-06-16"
##  [356] "2015-06-17" "2015-06-18" "2015-06-22" "2015-06-23" "2015-06-24"
##  [361] "2015-06-25" "2015-06-26" "2015-06-29" "2015-06-30" "2015-07-01"
##  [366] "2015-07-02" "2015-07-03" "2015-07-06" "2015-07-07" "2015-07-08"
##  [371] "2015-07-09" "2015-07-13" "2015-07-14" "2015-07-15" "2015-07-16"
##  [376] "2015-07-17" "2015-07-20" "2015-07-21" "2015-07-22" "2015-07-23"
##  [381] "2015-07-24" "2015-07-27" "2015-07-28" "2015-07-29" "2015-07-30"
##  [386] "2015-07-31" "2015-08-03" "2015-08-04" "2015-08-05" "2015-08-06"
##  [391] "2015-08-07" "2015-08-10" "2015-08-11" "2015-08-12" "2015-08-13"
##  [396] "2015-08-14" "2015-08-17" "2015-08-18" "2015-08-19" "2015-08-20"
##  [401] "2015-08-21" "2015-08-24" "2015-08-25" "2015-08-26" "2015-08-27"
##  [406] "2015-08-28" "2015-08-31" "2015-09-01" "2015-09-02" "2015-09-03"
##  [411] "2015-09-04" "2015-09-07" "2015-09-08" "2015-09-09" "2015-09-10"
##  [416] "2015-09-11" "2015-09-14" "2015-09-15" "2015-09-16" "2015-09-17"
##  [421] "2015-09-18" "2015-09-21" "2015-09-22" "2015-09-23" "2015-09-24"
##  [426] "2015-09-25" "2015-09-30" "2015-10-01" "2015-10-02" "2015-10-05"
##  [431] "2015-10-06" "2015-10-07" "2015-10-08" "2015-10-12" "2015-10-13"
##  [436] "2015-10-14" "2015-10-15" "2015-10-16" "2015-10-19" "2015-10-20"
##  [441] "2015-10-21" "2015-10-22" "2015-10-23" "2015-10-26" "2015-10-27"
##  [446] "2015-10-28" "2015-10-29" "2015-10-30" "2015-11-02" "2015-11-03"
##  [451] "2015-11-04" "2015-11-05" "2015-11-06" "2015-11-09" "2015-11-10"
##  [456] "2015-11-11" "2015-11-12" "2015-11-13" "2015-11-16" "2015-11-17"
##  [461] "2015-11-18" "2015-11-19" "2015-11-20" "2015-11-23" "2015-11-24"
##  [466] "2015-11-25" "2015-11-26" "2015-11-27" "2015-11-30" "2015-12-01"
##  [471] "2015-12-02" "2015-12-03" "2015-12-04" "2015-12-07" "2015-12-08"
##  [476] "2015-12-09" "2015-12-10" "2015-12-11" "2015-12-14" "2015-12-15"
##  [481] "2015-12-16" "2015-12-17" "2015-12-18" "2015-12-21" "2015-12-22"
##  [486] "2015-12-23" "2015-12-24" "2015-12-25" "2015-12-28" "2015-12-29"
##  [491] "2015-12-30" "2015-12-31" "2016-01-04" "2016-01-05" "2016-01-06"
##  [496] "2016-01-07" "2016-01-08" "2016-01-11" "2016-01-12" "2016-01-13"
##  [501] "2016-01-14" "2016-01-15" "2016-01-18" "2016-01-19" "2016-01-20"
##  [506] "2016-01-21" "2016-01-22" "2016-01-25" "2016-01-26" "2016-01-27"
##  [511] "2016-01-28" "2016-01-29" "2016-01-30" "2016-02-01" "2016-02-02"
##  [516] "2016-02-03" "2016-02-15" "2016-02-16" "2016-02-17" "2016-02-18"
##  [521] "2016-02-19" "2016-02-22" "2016-02-23" "2016-02-24" "2016-02-25"
##  [526] "2016-02-26" "2016-03-01" "2016-03-02" "2016-03-03" "2016-03-04"
##  [531] "2016-03-07" "2016-03-08" "2016-03-09" "2016-03-10" "2016-03-11"
##  [536] "2016-03-14" "2016-03-15" "2016-03-16" "2016-03-17" "2016-03-18"
##  [541] "2016-03-21" "2016-03-22" "2016-03-23" "2016-03-24" "2016-03-25"
##  [546] "2016-03-28" "2016-03-29" "2016-03-30" "2016-03-31" "2016-04-01"
##  [551] "2016-04-06" "2016-04-07" "2016-04-08" "2016-04-11" "2016-04-12"
##  [556] "2016-04-13" "2016-04-14" "2016-04-15" "2016-04-18" "2016-04-19"
##  [561] "2016-04-20" "2016-04-21" "2016-04-22" "2016-04-25" "2016-04-26"
##  [566] "2016-04-27" "2016-04-28" "2016-04-29" "2016-05-03" "2016-05-04"
##  [571] "2016-05-05" "2016-05-06" "2016-05-09" "2016-05-10" "2016-05-11"
##  [576] "2016-05-12" "2016-05-13" "2016-05-16" "2016-05-17" "2016-05-18"
##  [581] "2016-05-19" "2016-05-20" "2016-05-23" "2016-05-24" "2016-05-25"
##  [586] "2016-05-26" "2016-05-27" "2016-05-30" "2016-05-31" "2016-06-01"
##  [591] "2016-06-02" "2016-06-03" "2016-06-04" "2016-06-06" "2016-06-07"
##  [596] "2016-06-08" "2016-06-13" "2016-06-14" "2016-06-15" "2016-06-16"
##  [601] "2016-06-17" "2016-06-20" "2016-06-21" "2016-06-22" "2016-06-23"
##  [606] "2016-06-24" "2016-06-27" "2016-06-28" "2016-06-29" "2016-06-30"
##  [611] "2016-07-01" "2016-07-04" "2016-07-05" "2016-07-06" "2016-07-07"
##  [616] "2016-07-11" "2016-07-12" "2016-07-13" "2016-07-14" "2016-07-15"
##  [621] "2016-07-18" "2016-07-19" "2016-07-20" "2016-07-21" "2016-07-22"
##  [626] "2016-07-25" "2016-07-26" "2016-07-27" "2016-07-28" "2016-07-29"
##  [631] "2016-08-01" "2016-08-02" "2016-08-03" "2016-08-04" "2016-08-05"
##  [636] "2016-08-08" "2016-08-09" "2016-08-10" "2016-08-11" "2016-08-12"
##  [641] "2016-08-15" "2016-08-16" "2016-08-17" "2016-08-18" "2016-08-19"
##  [646] "2016-08-22" "2016-08-23" "2016-08-24" "2016-08-25" "2016-08-26"
##  [651] "2016-08-29" "2016-08-30" "2016-08-31" "2016-09-01" "2016-09-02"
##  [656] "2016-09-05" "2016-09-06" "2016-09-07" "2016-09-08" "2016-09-09"
##  [661] "2016-09-10" "2016-09-12" "2016-09-13" "2016-09-14" "2016-09-19"
##  [666] "2016-09-20" "2016-09-21" "2016-09-22" "2016-09-23" "2016-09-26"
##  [671] "2016-09-29" "2016-09-30" "2016-10-03" "2016-10-04" "2016-10-05"
##  [676] "2016-10-06" "2016-10-07" "2016-10-11" "2016-10-12" "2016-10-13"
##  [681] "2016-10-14" "2016-10-17" "2016-10-18" "2016-10-19" "2016-10-20"
##  [686] "2016-10-21" "2016-10-24" "2016-10-25" "2016-10-26" "2016-10-27"
##  [691] "2016-10-28" "2016-10-31" "2016-11-01" "2016-11-02" "2016-11-03"
##  [696] "2016-11-04" "2016-11-07" "2016-11-08" "2016-11-09" "2016-11-10"
##  [701] "2016-11-11" "2016-11-14" "2016-11-15" "2016-11-16" "2016-11-17"
##  [706] "2016-11-18" "2016-11-21" "2016-11-22" "2016-11-23" "2016-11-24"
##  [711] "2016-11-25" "2016-11-28" "2016-11-29" "2016-11-30" "2016-12-01"
##  [716] "2016-12-02" "2016-12-05" "2016-12-06" "2016-12-07" "2016-12-08"
##  [721] "2016-12-09" "2016-12-12" "2016-12-13" "2016-12-14" "2016-12-15"
##  [726] "2016-12-16" "2016-12-19" "2016-12-20" "2016-12-21" "2016-12-22"
##  [731] "2016-12-23" "2016-12-26" "2016-12-27" "2016-12-28" "2016-12-29"
##  [736] "2016-12-30" "2017-01-03" "2017-01-04" "2017-01-05" "2017-01-06"
##  [741] "2017-01-09" "2017-01-10" "2017-01-11" "2017-01-12" "2017-01-13"
##  [746] "2017-01-16" "2017-01-17" "2017-01-18" "2017-01-19" "2017-01-20"
##  [751] "2017-01-23" "2017-01-24" "2017-02-02" "2017-02-03" "2017-02-06"
##  [756] "2017-02-07" "2017-02-08" "2017-02-09" "2017-02-10" "2017-02-13"
##  [761] "2017-02-14" "2017-02-15" "2017-02-16" "2017-02-17" "2017-02-18"
##  [766] "2017-02-20" "2017-02-21" "2017-02-22" "2017-02-23" "2017-02-24"
##  [771] "2017-03-01" "2017-03-02" "2017-03-03" "2017-03-06" "2017-03-07"
##  [776] "2017-03-08" "2017-03-09" "2017-03-10" "2017-03-13" "2017-03-14"
##  [781] "2017-03-15" "2017-03-16" "2017-03-17" "2017-03-20" "2017-03-21"
##  [786] "2017-03-22" "2017-03-23" "2017-03-24" "2017-03-27" "2017-03-28"
##  [791] "2017-03-29" "2017-03-30" "2017-03-31" "2017-04-05" "2017-04-06"
##  [796] "2017-04-07" "2017-04-10" "2017-04-11" "2017-04-12" "2017-04-13"
##  [801] "2017-04-14" "2017-04-17" "2017-04-18" "2017-04-19" "2017-04-20"
##  [806] "2017-04-21" "2017-04-24" "2017-04-25" "2017-04-26" "2017-04-27"
##  [811] "2017-04-28" "2017-05-02" "2017-05-03" "2017-05-04" "2017-05-05"
##  [816] "2017-05-08" "2017-05-09" "2017-05-10" "2017-05-11" "2017-05-12"
##  [821] "2017-05-15" "2017-05-16" "2017-05-17" "2017-05-18" "2017-05-19"
##  [826] "2017-05-22" "2017-05-23" "2017-05-24" "2017-05-25" "2017-05-26"
##  [831] "2017-05-31" "2017-06-01" "2017-06-02" "2017-06-03" "2017-06-05"
##  [836] "2017-06-06" "2017-06-07" "2017-06-08" "2017-06-09" "2017-06-12"
##  [841] "2017-06-13" "2017-06-14" "2017-06-15" "2017-06-16" "2017-06-19"
##  [846] "2017-06-20" "2017-06-21" "2017-06-22" "2017-06-23" "2017-06-26"
##  [851] "2017-06-27" "2017-06-28" "2017-06-29" "2017-06-30" "2017-07-03"
##  [856] "2017-07-04" "2017-07-05" "2017-07-06" "2017-07-07" "2017-07-10"
##  [861] "2017-07-11" "2017-07-12" "2017-07-13" "2017-07-14" "2017-07-17"
##  [866] "2017-07-18" "2017-07-19" "2017-07-20" "2017-07-21" "2017-07-24"
##  [871] "2017-07-25" "2017-07-26" "2017-07-27" "2017-07-28" "2017-07-31"
##  [876] "2017-08-01" "2017-08-02" "2017-08-03" "2017-08-04" "2017-08-07"
##  [881] "2017-08-08" "2017-08-09" "2017-08-10" "2017-08-11" "2017-08-14"
##  [886] "2017-08-15" "2017-08-16" "2017-08-17" "2017-08-18" "2017-08-21"
##  [891] "2017-08-22" "2017-08-23" "2017-08-24" "2017-08-25" "2017-08-28"
##  [896] "2017-08-29" "2017-08-30" "2017-08-31" "2017-09-01" "2017-09-04"
##  [901] "2017-09-05" "2017-09-06" "2017-09-07" "2017-09-08" "2017-09-11"
##  [906] "2017-09-12" "2017-09-13" "2017-09-14" "2017-09-15" "2017-09-18"
##  [911] "2017-09-19" "2017-09-20" "2017-09-21" "2017-09-22" "2017-09-25"
##  [916] "2017-09-26" "2017-09-27" "2017-09-28" "2017-09-29" "2017-09-30"
##  [921] "2017-10-02" "2017-10-03" "2017-10-05" "2017-10-06" "2017-10-11"
##  [926] "2017-10-12" "2017-10-13" "2017-10-16" "2017-10-17" "2017-10-18"
##  [931] "2017-10-19" "2017-10-20" "2017-10-23" "2017-10-24" "2017-10-25"
##  [936] "2017-10-26" "2017-10-27" "2017-10-30" "2017-10-31" "2017-11-01"
##  [941] "2017-11-02" "2017-11-03" "2017-11-06" "2017-11-07" "2017-11-08"
##  [946] "2017-11-09" "2017-11-10" "2017-11-13" "2017-11-14" "2017-11-15"
##  [951] "2017-11-16" "2017-11-17" "2017-11-20" "2017-11-21" "2017-11-22"
##  [956] "2017-11-23" "2017-11-24" "2017-11-27" "2017-11-28" "2017-11-29"
##  [961] "2017-11-30" "2017-12-01" "2017-12-04" "2017-12-05" "2017-12-06"
##  [966] "2017-12-07" "2017-12-08" "2017-12-11" "2017-12-12" "2017-12-13"
##  [971] "2017-12-14" "2017-12-15" "2017-12-18" "2017-12-19" "2017-12-20"
##  [976] "2017-12-21" "2017-12-22" "2017-12-25" "2017-12-26" "2017-12-27"
##  [981] "2017-12-28" "2017-12-29" "2018-01-02" "2018-01-03" "2018-01-04"
##  [986] "2018-01-05" "2018-01-08" "2018-01-09" "2018-01-10" "2018-01-11"
##  [991] "2018-01-12" "2018-01-15" "2018-01-16" "2018-01-17" "2018-01-18"
##  [996] "2018-01-19" "2018-01-22" "2018-01-23" "2018-01-24" "2018-01-25"
## [1001] "2018-01-26" "2018-01-29" "2018-01-30" "2018-01-31" "2018-02-01"
## [1006] "2018-02-02" "2018-02-05" "2018-02-06" "2018-02-07" "2018-02-08"
## [1011] "2018-02-09" "2018-02-12" "2018-02-21" "2018-02-22" "2018-02-23"
## [1016] "2018-02-26" "2018-02-27" "2018-03-01" "2018-03-02" "2018-03-05"
## [1021] "2018-03-06" "2018-03-07" "2018-03-08" "2018-03-09" "2018-03-12"
## [1026] "2018-03-13" "2018-03-14" "2018-03-15" "2018-03-16" "2018-03-19"
## [1031] "2018-03-20" "2018-03-21" "2018-03-22" "2018-03-23" "2018-03-26"
## [1036] "2018-03-27" "2018-03-28" "2018-03-29" "2018-03-30" "2018-03-31"
## [1041] "2018-04-02" "2018-04-03" "2018-04-09" "2018-04-10" "2018-04-11"
## [1046] "2018-04-12" "2018-04-13" "2018-04-16" "2018-04-17" "2018-04-18"
## [1051] "2018-04-19" "2018-04-20" "2018-04-23" "2018-04-24" "2018-04-25"
## [1056] "2018-04-26" "2018-04-27" "2018-04-30" "2018-05-02" "2018-05-03"
## [1061] "2018-05-04" "2018-05-07" "2018-05-08" "2018-05-09" "2018-05-10"
## [1066] "2018-05-11" "2018-05-14" "2018-05-15" "2018-05-16" "2018-05-17"
## [1071] "2018-05-18" "2018-05-21" "2018-05-22" "2018-05-23" "2018-05-24"
## [1076] "2018-05-25" "2018-05-28" "2018-05-29" "2018-05-30" "2018-05-31"
## [1081] "2018-06-01" "2018-06-04" "2018-06-05" "2018-06-06" "2018-06-07"
## [1086] "2018-06-08" "2018-06-11" "2018-06-12" "2018-06-13" "2018-06-14"
## [1091] "2018-06-15" "2018-06-19" "2018-06-20" "2018-06-21" "2018-06-22"
## [1096] "2018-06-25" "2018-06-26" "2018-06-27" "2018-06-28" "2018-06-29"
## [1101] "2018-07-02" "2018-07-03" "2018-07-04" "2018-07-05" "2018-07-06"
## [1106] "2018-07-09" "2018-07-10" "2018-07-11" "2018-07-12" "2018-07-13"
## [1111] "2018-07-16" "2018-07-17" "2018-07-18" "2018-07-19" "2018-07-20"
## [1116] "2018-07-23" "2018-07-24" "2018-07-25" "2018-07-26" "2018-07-27"
## [1121] "2018-07-30" "2018-07-31" "2018-08-01" "2018-08-02" "2018-08-03"
## [1126] "2018-08-06" "2018-08-07" "2018-08-08" "2018-08-09" "2018-08-10"
## [1131] "2018-08-13" "2018-08-14" "2018-08-15" "2018-08-16" "2018-08-17"
## [1136] "2018-08-20" "2018-08-21" "2018-08-22" "2018-08-23" "2018-08-24"
## [1141] "2018-08-27" "2018-08-28" "2018-08-29" "2018-08-30" "2018-08-31"
## [1146] "2018-09-03" "2018-09-04" "2018-09-05" "2018-09-06" "2018-09-07"
## [1151] "2018-09-10" "2018-09-11" "2018-09-12" "2018-09-13" "2018-09-14"
## [1156] "2018-09-17" "2018-09-18" "2018-09-19" "2018-09-20" "2018-09-21"
## [1161] "2018-09-25" "2018-09-26" "2018-09-27" "2018-09-28" "2018-10-01"
## [1166] "2018-10-02" "2018-10-03" "2018-10-04" "2018-10-05" "2018-10-08"
## [1171] "2018-10-09" "2018-10-11" "2018-10-12" "2018-10-15" "2018-10-16"
## [1176] "2018-10-17" "2018-10-18" "2018-10-19" "2018-10-22" "2018-10-23"
## [1181] "2018-10-24" "2018-10-25" "2018-10-26" "2018-10-29" "2018-10-30"
## [1186] "2018-10-31" "2018-11-01" "2018-11-02" "2018-11-05" "2018-11-06"
## [1191] "2018-11-07" "2018-11-08" "2018-11-09" "2018-11-12" "2018-11-13"
## [1196] "2018-11-14" "2018-11-15" "2018-11-16" "2018-11-19" "2018-11-20"
## [1201] "2018-11-21" "2018-11-22" "2018-11-23" "2018-11-26" "2018-11-27"
## [1206] "2018-11-28" "2018-11-29" "2018-11-30" "2018-12-03" "2018-12-04"
## [1211] "2018-12-05" "2018-12-06" "2018-12-07" "2018-12-10" "2018-12-11"
## [1216] "2018-12-12" "2018-12-13" "2018-12-14" "2018-12-17" "2018-12-18"
## [1221] "2018-12-19" "2018-12-20" "2018-12-21" "2018-12-22" "2018-12-24"
## [1226] "2018-12-25" "2018-12-26" "2018-12-27" "2018-12-28"
data1$prices
##            prices
## 2014-01-02     NA
## 2014-01-03     NA
## 2014-01-06     NA
## 2014-01-07     NA
## 2014-01-08     NA
## 2014-01-09     NA
## 2014-01-10     NA
## 2014-01-13     NA
## 2014-01-14     NA
## 2014-01-15     NA
## 2014-01-16     NA
## 2014-01-17     NA
## 2014-01-20     NA
## 2014-01-21     NA
## 2014-01-22     NA
## 2014-01-23     NA
## 2014-01-24     NA
## 2014-01-27     NA
## 2014-02-05     NA
## 2014-02-06     NA
## 2014-02-07     NA
## 2014-02-10     NA
## 2014-02-11     NA
## 2014-02-12     NA
## 2014-02-13     NA
## 2014-02-14     NA
## 2014-02-17     NA
## 2014-02-18     NA
## 2014-02-19     NA
## 2014-02-20     NA
## 2014-02-21     NA
## 2014-02-24     NA
## 2014-02-25     NA
## 2014-02-26     NA
## 2014-02-27     NA
## 2014-03-03     NA
## 2014-03-04     NA
## 2014-03-05     NA
## 2014-03-06     NA
## 2014-03-07     NA
## 2014-03-10     NA
## 2014-03-11     NA
## 2014-03-12     NA
## 2014-03-13     NA
## 2014-03-14     NA
## 2014-03-17     NA
## 2014-03-18     NA
## 2014-03-19     NA
## 2014-03-20     NA
## 2014-03-21     NA
## 2014-03-24     NA
## 2014-03-25     NA
## 2014-03-26     NA
## 2014-03-27     NA
## 2014-03-28     NA
## 2014-03-31     NA
## 2014-04-01     NA
## 2014-04-02     NA
## 2014-04-03     NA
## 2014-04-07     NA
## 2014-04-08     NA
## 2014-04-09     NA
## 2014-04-10     NA
## 2014-04-11     NA
## 2014-04-14     NA
## 2014-04-15     NA
## 2014-04-16     NA
## 2014-04-17     NA
## 2014-04-18     NA
## 2014-04-21     NA
## 2014-04-22     NA
## 2014-04-23     NA
## 2014-04-24     NA
## 2014-04-25     NA
## 2014-04-28     NA
## 2014-04-29     NA
## 2014-04-30     NA
## 2014-05-02     NA
## 2014-05-05     NA
## 2014-05-06     NA
## 2014-05-07     NA
## 2014-05-08     NA
## 2014-05-09     NA
## 2014-05-12     NA
## 2014-05-13     NA
## 2014-05-14     NA
## 2014-05-15     NA
## 2014-05-16     NA
## 2014-05-19     NA
## 2014-05-20     NA
## 2014-05-21     NA
## 2014-05-22     NA
## 2014-05-23     NA
## 2014-05-26     NA
## 2014-05-27     NA
## 2014-05-28     NA
## 2014-05-29     NA
## 2014-05-30     NA
## 2014-06-03     NA
## 2014-06-04     NA
## 2014-06-05     NA
## 2014-06-06     NA
## 2014-06-09     NA
## 2014-06-10     NA
## 2014-06-11     NA
## 2014-06-12     NA
## 2014-06-13     NA
## 2014-06-16     NA
## 2014-06-17     NA
## 2014-06-18     NA
## 2014-06-19     NA
## 2014-06-20     NA
## 2014-06-23     NA
## 2014-06-24     NA
## 2014-06-25     NA
## 2014-06-26     NA
## 2014-06-27     NA
## 2014-06-30     NA
## 2014-07-01     NA
## 2014-07-02     NA
## 2014-07-03     NA
## 2014-07-04     NA
## 2014-07-07     NA
## 2014-07-08     NA
## 2014-07-09     NA
## 2014-07-10     NA
## 2014-07-11     NA
## 2014-07-14     NA
## 2014-07-15     NA
## 2014-07-16     NA
## 2014-07-17     NA
## 2014-07-18     NA
## 2014-07-21     NA
## 2014-07-22     NA
## 2014-07-24     NA
## 2014-07-25     NA
## 2014-07-28     NA
## 2014-07-29     NA
## 2014-07-30     NA
## 2014-07-31     NA
## 2014-08-01     NA
## 2014-08-04     NA
## 2014-08-05     NA
## 2014-08-06     NA
## 2014-08-07     NA
## 2014-08-08     NA
## 2014-08-11     NA
## 2014-08-12     NA
## 2014-08-13     NA
## 2014-08-14     NA
## 2014-08-15     NA
## 2014-08-18     NA
## 2014-08-19     NA
## 2014-08-20     NA
## 2014-08-21     NA
## 2014-08-22     NA
## 2014-08-25     NA
## 2014-08-26     NA
## 2014-08-27     NA
## 2014-08-28     NA
## 2014-08-29     NA
## 2014-09-01     NA
## 2014-09-02     NA
## 2014-09-03     NA
## 2014-09-04     NA
## 2014-09-05     NA
## 2014-09-09     NA
## 2014-09-10     NA
## 2014-09-11     NA
## 2014-09-12     NA
## 2014-09-15     NA
## 2014-09-16     NA
## 2014-09-17     NA
## 2014-09-18     NA
## 2014-09-19     NA
## 2014-09-22     NA
## 2014-09-23     NA
## 2014-09-24     NA
## 2014-09-25     NA
## 2014-09-26     NA
## 2014-09-29     NA
## 2014-09-30     NA
## 2014-10-01     NA
## 2014-10-02     NA
## 2014-10-03     NA
## 2014-10-06     NA
## 2014-10-07     NA
## 2014-10-08     NA
## 2014-10-09     NA
## 2014-10-13     NA
## 2014-10-14     NA
## 2014-10-15     NA
## 2014-10-16     NA
## 2014-10-17     NA
## 2014-10-20     NA
## 2014-10-21     NA
## 2014-10-22     NA
## 2014-10-23     NA
## 2014-10-24     NA
## 2014-10-27     NA
## 2014-10-28     NA
## 2014-10-29     NA
## 2014-10-30     NA
## 2014-10-31     NA
## 2014-11-03     NA
## 2014-11-04     NA
## 2014-11-05     NA
## 2014-11-06     NA
## 2014-11-07     NA
## 2014-11-10     NA
## 2014-11-11     NA
## 2014-11-12     NA
## 2014-11-13     NA
## 2014-11-14     NA
## 2014-11-17     NA
## 2014-11-18     NA
## 2014-11-19     NA
## 2014-11-20     NA
## 2014-11-21     NA
## 2014-11-24     NA
## 2014-11-25     NA
## 2014-11-26     NA
## 2014-11-27     NA
## 2014-11-28     NA
## 2014-12-01     NA
## 2014-12-02     NA
## 2014-12-03     NA
## 2014-12-04     NA
## 2014-12-05     NA
## 2014-12-08     NA
## 2014-12-09     NA
## 2014-12-10     NA
## 2014-12-11     NA
## 2014-12-12     NA
## 2014-12-15     NA
## 2014-12-16     NA
## 2014-12-17     NA
## 2014-12-18     NA
## 2014-12-19     NA
## 2014-12-22     NA
## 2014-12-23     NA
## 2014-12-24     NA
## 2014-12-25     NA
## 2014-12-26     NA
## 2014-12-27     NA
## 2014-12-29     NA
## 2014-12-30     NA
## 2014-12-31     NA
## 2015-01-05     NA
## 2015-01-06     NA
## 2015-01-07     NA
## 2015-01-08     NA
## 2015-01-09     NA
## 2015-01-12     NA
## 2015-01-13     NA
## 2015-01-14     NA
## 2015-01-15     NA
## 2015-01-16     NA
## 2015-01-19     NA
## 2015-01-20     NA
## 2015-01-21     NA
## 2015-01-22     NA
## 2015-01-23     NA
## 2015-01-26     NA
## 2015-01-27     NA
## 2015-01-28     NA
## 2015-01-29     NA
## 2015-01-30     NA
## 2015-02-02     NA
## 2015-02-03     NA
## 2015-02-04     NA
## 2015-02-05     NA
## 2015-02-06     NA
## 2015-02-09     NA
## 2015-02-10     NA
## 2015-02-11     NA
## 2015-02-12     NA
## 2015-02-13     NA
## 2015-02-24     NA
## 2015-02-25     NA
## 2015-02-26     NA
## 2015-03-02     NA
## 2015-03-03     NA
## 2015-03-04     NA
## 2015-03-05     NA
## 2015-03-06     NA
## 2015-03-09     NA
## 2015-03-10     NA
## 2015-03-11     NA
## 2015-03-12     NA
## 2015-03-13     NA
## 2015-03-16     NA
## 2015-03-17     NA
## 2015-03-18     NA
## 2015-03-19     NA
## 2015-03-20     NA
## 2015-03-23     NA
## 2015-03-24     NA
## 2015-03-25     NA
## 2015-03-26     NA
## 2015-03-27     NA
## 2015-03-30     NA
## 2015-03-31     NA
## 2015-04-01     NA
## 2015-04-02     NA
## 2015-04-07     NA
## 2015-04-08     NA
## 2015-04-09     NA
## 2015-04-10     NA
## 2015-04-13     NA
## 2015-04-14     NA
## 2015-04-15     NA
## 2015-04-16     NA
## 2015-04-17     NA
## 2015-04-20     NA
## 2015-04-21     NA
## 2015-04-22     NA
## 2015-04-23     NA
## 2015-04-24     NA
## 2015-04-27     NA
## 2015-04-28     NA
## 2015-04-29     NA
## 2015-04-30     NA
## 2015-05-04     NA
## 2015-05-05     NA
## 2015-05-06     NA
## 2015-05-07     NA
## 2015-05-08     NA
## 2015-05-11     NA
## 2015-05-12     NA
## 2015-05-13     NA
## 2015-05-14     NA
## 2015-05-15     NA
## 2015-05-18     NA
## 2015-05-19     NA
## 2015-05-20     NA
## 2015-05-21     NA
## 2015-05-22     NA
## 2015-05-25     NA
## 2015-05-26     NA
## 2015-05-27     NA
## 2015-05-28     NA
## 2015-05-29     NA
## 2015-06-01     NA
## 2015-06-02     NA
## 2015-06-03     NA
## 2015-06-04     NA
## 2015-06-05     NA
## 2015-06-08     NA
## 2015-06-09     NA
## 2015-06-10     NA
## 2015-06-11     NA
## 2015-06-12     NA
## 2015-06-15     NA
## 2015-06-16     NA
## 2015-06-17     NA
## 2015-06-18     NA
## 2015-06-22     NA
## 2015-06-23     NA
## 2015-06-24     NA
## 2015-06-25     NA
## 2015-06-26     NA
## 2015-06-29     NA
## 2015-06-30     NA
## 2015-07-01     NA
## 2015-07-02     NA
## 2015-07-03     NA
## 2015-07-06     NA
## 2015-07-07     NA
## 2015-07-08     NA
## 2015-07-09     NA
## 2015-07-13     NA
## 2015-07-14     NA
## 2015-07-15     NA
## 2015-07-16     NA
## 2015-07-17     NA
## 2015-07-20     NA
## 2015-07-21     NA
## 2015-07-22     NA
## 2015-07-23     NA
## 2015-07-24     NA
## 2015-07-27     NA
## 2015-07-28     NA
## 2015-07-29     NA
## 2015-07-30     NA
## 2015-07-31     NA
## 2015-08-03     NA
## 2015-08-04     NA
## 2015-08-05     NA
## 2015-08-06     NA
## 2015-08-07