我已经训练了一个简单的模型,现在尝试使用quantstrat
对它进行回测。我仍然知道quantstrat
的工作方式,所以我知道我在代码中犯了一些错误。该模型非常简单(测试准确性为54%),但我只是将其应用于quantstrat
软件包中的quantstrat
进行教育。
数据如下:
open high low close volume adjusted direction returns
2018-11-23 1030.00 1037.590 1022.399 1023.88 691500 1023.88 1 -0.013232313
2018-11-26 1038.35 1049.310 1033.910 1048.62 1850400 1048.62 0 0.024162978
2018-11-27 1041.00 1057.580 1038.490 1044.41 1803200 1044.41 0 -0.004014763
2018-11-28 1048.76 1086.840 1035.760 1086.23 2475400 1086.23 0 0.040041693
2018-11-29 1076.08 1094.245 1076.000 1088.30 1468900 1088.30 0 0.001905737
2018-11-30 1089.07 1095.570 1077.880 1094.43 2580200 1094.43 0 0.005632642
sma rsi momentum roc pred
2018-11-23 1041.794 42.72473 -31.93005 -0.03910309 1
2018-11-26 1040.041 51.77642 -44.77002 -0.01219856 0
2018-11-27 1040.619 47.50633 -37.98999 0.02364954 0
2018-11-28 1045.637 48.46232 20.07996 0.05727916 0
2018-11-29 1050.101 51.31756 49.67004 0.04769691 0
2018-11-30 1053.073 56.61429 58.38000 0.06663439 0
表中的许多信息不再有用。我尝试应用的策略是当列pred
= 0时,加仓。当pred
列= 1时,请平仓,并在每个期间结束时平仓。 (在这种情况下,我每天都有数据,但是时间段可能是几小时,几周,几个月等)。
问题:
在add.signal
和add.rule
中哪里出了问题。
如何添加规则以在每个期间结束时平仓?
代码:
require(quantstrat)
require(PerformanceAnalytics)
library(e1071)
mean(test$pred == test$direction)
initDate="2007-01-01"
from <- "2017-07-09"
to <- "2018-12-01"
init_equity <- 1
adjustment <- TRUE
currency('USD')
Sys.setenv(TZ="UTC")
symbols <- 'GOOG'
GOOG <- test
currency('USD')
Sys.setenv(TZ="UTC")
stock("GOOG", currency="USD", multiplier=1)
symbols <- c("GOOG")
strategy.st <- portfolio.st <- account.st <- "SVMstrat"
rm.strat(strategy.st)
rm.strat(portfolio.st)
rm.strat(account.st)
initPortf(name = portfolio.st,
symbols = symbols,
initDate = initDate,
currency = 'USD')
initAcct(name = account.st,
portfolios = portfolio.st,
initDate = initDate,
currency = 'USD',
initEq = init_equity)
initOrders(portfolio.st,
symbols = symbols,
initDate = initDate)
strategy(strategy.st, store = TRUE)
########### Adding to the strategy
add.signal(strategy.st,
name = "sigThreshold",
arguments = list(column = "pred",
threshold = 0.5,
relationship = "gte",
cross = TRUE),
label = "longEntry")
add.signal(strategy.st,
name = "sigThreshold",
arguments = list(column = "pred",
threshold = 0.5,
relationship = "lte",
cross = TRUE),
label = "longExit")
applySignals(strategy = strategy.st, mktdata=GOOG)
###################################################
add.rule(strategy.st,
name="ruleSignal",
arguments=list(sigcol="longEntry",
sigval=TRUE,
orderqty = 100,
ordertype="market",
orderside="long",
replace=FALSE,
TxnFees = -10,
prefer="Open"),
type="enter",
path.dep=TRUE)
add.rule(strategy.st,
name="ruleSignal",
arguments=list(sigcol="longExit",
sigval=TRUE,
orderqty = 100,
ordertype="market",
orderside="long",
replace=FALSE,
TxnFees = -10,
prefer="Open"),
type="exit",
path.dep=TRUE)
applyStrategy(strategy=strategy.st,portfolios=portfolio.st)
updatePortf(portfolio.st)
dateRange <- time(getPortfolio(portfolio.st)$summary)[-1]
updateAcct(portfolio.st,dateRange)
updateEndEq(account.st)
chart.Posn(portfolio.st, 'GOOG')
数据:
test <- structure(c(1156.97998, 1144.589966, 1159.890015, 1185, 1189.390015,
1172.219971, 1196.560059, 1191, 1186.959961, 1181.01001, 1262.589966,
1239.130005, 1251, 1271, 1228.01001, 1220.01001, 1228, 1205.900024,
1229.619995, 1225, 1237, 1240.469971, 1249.900024, 1243, 1236.97998,
1235.189941, 1229.26001, 1224.72998, 1202.030029, 1205.02002,
1208, 1200, 1207.140015, 1208.819946, 1227.599976, 1241.290039,
1237.449951, 1244.22998, 1234.97998, 1204.27002, 1193.800049,
1186.300049, 1158.670044, 1172.189941, 1161.630005, 1172.719971,
1170.73999, 1179.099976, 1170.140015, 1157.089966, 1164.97998,
1179.98999, 1192, 1157.170044, 1176.150024, 1185.150024, 1186.72998,
1191.869995, 1199.890015, 1190.959961, 1205, 1195.329956, 1167.5,
1150.109985, 1146.150024, 1131.079956, 1072.939941, 1108, 1108.910034,
1104.589966, 1126.459961, 1121.839966, 1093.369995, 1103.060059,
1080.890015, 1104.25, 1071.790039, 1037.030029, 1082.469971,
1008.460022, 1059.810059, 1075.800049, 1073.72998, 1055, 1039.47998,
1069, 1091.380005, 1073.98999, 1061.390015, 1043.290039, 1050,
1044.709961, 1059.410034, 1057.199951, 1000, 1036.76001, 1030,
1038.349976, 1041, 1048.76001, 1076.079956, 1089.069946, 1159.589966,
1164.290039, 1184.410034, 1195.416992, 1191, 1203.040039, 1204.5,
1200, 1196.859985, 1206.48999, 1266, 1265.859985, 1269.770996,
1273.890015, 1234.916016, 1227.588013, 1233.469971, 1229.880005,
1230, 1226.088013, 1251.170044, 1256.5, 1255.541992, 1245.694946,
1249.272949, 1245.869995, 1235.23999, 1226, 1209.02002, 1211,
1217.26001, 1211.839966, 1221.280029, 1221.650024, 1243.089966,
1242.545044, 1250.660034, 1253.63501, 1238.660034, 1212.98999,
1199.01001, 1186.300049, 1175.26001, 1174.540039, 1178.680054,
1178.609985, 1178.609985, 1180.425049, 1177.23999, 1176.079956,
1173.209961, 1189.890015, 1192.209961, 1178, 1186.880005, 1194.22998,
1202.099976, 1195.410034, 1209.900024, 1209.959961, 1206.410034,
1197.51001, 1173.5, 1168, 1154.349976, 1132.170044, 1106.400024,
1115, 1113.446045, 1124.219971, 1128.98999, 1121.839966, 1110.359985,
1112.22998, 1107.890015, 1106.119995, 1110.97998, 1106.530029,
1097.040039, 1037.48999, 1091.939941, 1083.974976, 1082.974976,
1058.469971, 1064.344971, 1095.459961, 1093.27002, 1075.560059,
1062.119995, 1056.60498, 1054.563965, 1071.849976, 1067, 1060.790039,
1031.73999, 1048.560059, 1037.589966, 1049.310059, 1057.579956,
1086.839966, 1094.244995, 1095.569946, 1149.589966, 1141, 1155.935059,
1180, 1179.280029, 1170.599976, 1190.339966, 1183.319946, 1184.219971,
1181, 1235.560059, 1239.130005, 1249.02002, 1231, 1211.469971,
1205.599976, 1210.209961, 1204.790039, 1215.060059, 1215.796997,
1236.170044, 1238.008057, 1246.01001, 1232, 1233.640991, 1225.109985,
1209.51001, 1202.550049, 1188.23999, 1194.625977, 1200.354004,
1199, 1204.23999, 1206.359009, 1225.715942, 1228.689941, 1236.359009,
1232.589966, 1211.285034, 1192.5, 1162, 1152, 1157.214966, 1160.109985,
1156.23999, 1158.359985, 1162.849976, 1168.329956, 1154.030029,
1157.089966, 1154.579956, 1173.359985, 1166.040039, 1146.910034,
1168, 1174.765015, 1183.630005, 1184.5, 1190.300049, 1186.630005,
1193.829956, 1155.57605, 1145.119995, 1127.364014, 1137.572021,
1081.130005, 1068.27002, 1086.401978, 1089, 1102.5, 1102.189941,
1077.089966, 1087.75, 1091, 1070, 1048.73999, 1069.550049, 1034.089966,
995.830017, 1000.75, 1057, 1062.459961, 1054.609985, 1021.23999,
1038.069946, 1065.900024, 1072.204956, 1053.109985, 1031, 1031.150024,
1031, 1031.780029, 1048.97998, 1016.26001, 996.02002, 1033.469971,
1022.398987, 1033.910034, 1038.48999, 1035.76001, 1076, 1077.880005,
1152.839966, 1153.900024, 1183.47998, 1188.819946, 1183.859985,
1198.800049, 1195.880005, 1186.959961, 1184.910034, 1205.5, 1248.079956,
1263.699951, 1268.329956, 1238.5, 1219.73999, 1217.26001, 1220.01001,
1226.150024, 1223.709961, 1224.77002, 1242.219971, 1245.609985,
1249.099976, 1237.609985, 1235.01001, 1242.099976, 1214.380005,
1206.48999, 1200.959961, 1207.77002, 1201.619995, 1207.329956,
1205.380005, 1220.650024, 1241.819946, 1231.150024, 1249.300049,
1239.119995, 1218.189941, 1197, 1186.47998, 1171.439941, 1164.829956,
1164.640015, 1177.359985, 1162.819946, 1175.329956, 1172.530029,
1156.050049, 1161.219971, 1171.089966, 1186.869995, 1166.089966,
1173.369995, 1184.650024, 1180.48999, 1194.640015, 1193.469971,
1195.310059, 1200.109985, 1202.949951, 1168.189941, 1157.349976,
1148.969971, 1138.819946, 1081.219971, 1079.319946, 1110.079956,
1092.25, 1121.280029, 1115.689941, 1087.969971, 1096.459961,
1101.160034, 1103.689941, 1050.709961, 1095.569946, 1071.469971,
1020.080017, 1036.209961, 1076.77002, 1070, 1057.790039, 1040.089966,
1055.810059, 1093.390015, 1082.400024, 1066.150024, 1038.630005,
1036.050049, 1043.660034, 1064.709961, 1061.48999, 1020, 1025.76001,
1037.609985, 1023.880005, 1048.619995, 1044.410034, 1086.22998,
1088.300049, 1094.430054, 798400, 1120000, 1251900, 1221900,
1055700, 1610400, 1393600, 1276700, 1247400, 2619200, 3318200,
2127800, 2405600, 2130600, 1849900, 1644700, 1567200, 1531300,
1089600, 1081700, 1494000, 1370300, 841800, 1108700, 958100,
1348100, 1828800, 1343200, 1389600, 870800, 1205600, 887400,
992600, 946600, 1156300, 1304000, 1298900, 1331400, 1816400,
1831000, 2061300, 1888500, 1401300, 1115400, 1209300, 1295500,
1431200, 944000, 1306500, 1203600, 1191400, 1210000, 4405600,
1271000, 977700, 1462300, 1260800, 1380600, 1357600, 1687900,
1256200, 2209500, 1184300, 1932400, 1308700, 2675700, 2949000,
2101300, 1372400, 1928500, 1467200, 2094500, 1267600, 1514200,
1848700, 1982400, 2545800, 4187600, 3880700, 3212700, 2529800,
1482000, 1839000, 2441400, 1233300, 2058400, 1488200, 1343200,
1471800, 1513700, 1565900, 1836100, 1658100, 1858600, 2449100,
1534300, 691500, 1850400, 1803200, 2475400, 1468900, 2580200,
1152.839966, 1153.900024, 1183.47998, 1188.819946, 1183.859985,
1198.800049, 1195.880005, 1186.959961, 1184.910034, 1205.5, 1248.079956,
1263.699951, 1268.329956, 1238.5, 1219.73999, 1217.26001, 1220.01001,
1226.150024, 1223.709961, 1224.77002, 1242.219971, 1245.609985,
1249.099976, 1237.609985, 1235.01001, 1242.099976, 1214.380005,
1206.48999, 1200.959961, 1207.77002, 1201.619995, 1207.329956,
1205.380005, 1220.650024, 1241.819946, 1231.150024, 1249.300049,
1239.119995, 1218.189941, 1197, 1186.47998, 1171.439941, 1164.829956,
1164.640015, 1177.359985, 1162.819946, 1175.329956, 1172.530029,
1156.050049, 1161.219971, 1171.089966, 1186.869995, 1166.089966,
1173.369995, 1184.650024, 1180.48999, 1194.640015, 1193.469971,
1195.310059, 1200.109985, 1202.949951, 1168.189941, 1157.349976,
1148.969971, 1138.819946, 1081.219971, 1079.319946, 1110.079956,
1092.25, 1121.280029, 1115.689941, 1087.969971, 1096.459961,
1101.160034, 1103.689941, 1050.709961, 1095.569946, 1071.469971,
1020.080017, 1036.209961, 1076.77002, 1070, 1057.790039, 1040.089966,
1055.810059, 1093.390015, 1082.400024, 1066.150024, 1038.630005,
1036.050049, 1043.660034, 1064.709961, 1061.48999, 1020, 1025.76001,
1037.609985, 1023.880005, 1048.619995, 1044.410034, 1086.22998,
1088.300049, 1094.430054, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0,
0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1,
0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0,
0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0,
1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0,
1, 0, 0, 0, 0, 0, -0.00104855331105314, 0.000919518780805317,
0.0256347650444282, 0.00451208815547521, -0.00417217175459472,
0.012619789662035, -0.00243580570624413, -0.00745897913060267,
-0.00172703972109811, 0.0173768179939304, 0.03532140688511, 0.0125152198181764,
0.00366384836553646, -0.0235190818121779, -0.0151473637464675,
-0.0020332038141998, 0.00225917222073213, 0.00503275706729656,
-0.00199001994229053, 0.000866266545001881, 0.0142475327735407,
0.00272899653776371, 0.0028018328706636, -0.00919861598011906,
-0.00210080318639327, 0.00574081662706516, -0.0223170207999425,
-0.00649715490004299, -0.00458356807419513, 0.00567051294060583,
-0.0050920497264868, 0.00475188580729302, -0.00161509369523183,
0.0126682199278725, 0.0173431545355052, -0.00859216509959326,
0.0147423341154074, -0.00814860609999057, -0.0168910630806179,
-0.017394611699556, -0.0087886549707602, -0.0126761843887159,
-0.00564261535624044, -0.000163063285779752, 0.0109218040219923,
-0.0123496969365746, 0.0107583379894998, -0.00238224762817163,
-0.0140550600772716, 0.00447205724741084, 0.00849967727604639,
0.0134746513574004, -0.0175082604561083, 0.00624311091962526,
0.00961336070298957, -0.00351161432973557, 0.0119865692380838,
-0.000979411358491888, 0.00154179664734944, 0.00401563256651238,
0.00236642144094823, -0.0288956410622938, -0.00927928294838842,
-0.00724068360804975, -0.00883402112865139, -0.050578649594534,
-0.00175729735942876, 0.0284994362552065, -0.0160618664481138,
0.026578190890364, -0.00498545221124236, -0.0248455856607925,
0.00780351501080179, 0.0042865888105148, 0.00229749257318224,
-0.0480025938734183, 0.0426949269209413, -0.0219976598372297,
-0.0479621038301595, 0.0158124301340961, 0.0391427032421665,
-0.00628734072666692, -0.0114111785046729, -0.016733068328695,
0.0151141665758556, 0.0355934816870314, -0.0100512999471647,
-0.0150129338873702, -0.0258125201711763, -0.00248399910225972,
0.00734519052177562, 0.0201693332256125, -0.00302427056940058,
-0.0390865579429535, 0.00564706862745101, 0.0115523854356538,
-0.0132323129099419, 0.024162977965372, -0.00401476323174632,
0.0400416930502221, 0.00190573730988342, 0.00563264240007388,
1125.3989991, 1128.9430054, 1136.8930054, 1144.3530029, 1151.173999,
1158.3080078, 1167.6070068, 1173.8760009, 1178.3499999, 1183.494995,
1193.018994, 1203.9989867, 1212.4839843, 1217.4519897, 1221.0399902,
1222.8859863, 1225.2989868, 1229.2179931, 1233.0979858, 1235.0249878,
1234.4389893, 1232.6299927, 1230.7069947, 1230.6179932, 1232.1449952,
1234.6289918, 1234.0659913, 1232.0999879, 1229.8249879, 1228.1249879,
1224.0649903, 1220.2369874, 1215.8649903, 1214.1689942, 1214.8499878,
1213.7549926, 1217.246997, 1220.5099975, 1222.2329955, 1221.1559935,
1219.641992, 1216.0529905, 1211.9979856, 1206.3969847, 1199.9509886,
1193.1179808, 1185.7209715, 1179.0619749, 1172.8479857, 1169.2699828,
1167.7309814, 1169.2739868, 1169.3999878, 1170.2729858, 1171.0019897,
1172.7689941, 1174.7, 1176.7939942, 1180.7199952, 1184.6089966,
1187.7949951, 1185.9269897, 1185.0529907, 1182.6129883, 1178.0299805,
1168.1029786, 1156.5709717, 1148.2319702, 1137.9259643, 1130.0429687,
1121.3169677, 1113.2949707, 1107.2059692, 1102.4249755, 1098.911975,
1095.860974, 1097.485974, 1093.6249755, 1086.4079772, 1077.9009704,
1074.0089783, 1072.2119812, 1068.344989, 1062.2379822, 1057.449994,
1061.7179994, 1060.4010072, 1059.8690125, 1061.7240113, 1061.7080201,
1058.3970215, 1057.8680176, 1058.2380127, 1056.2290161, 1053.2240112,
1047.6460082, 1041.7940063, 1040.0410034, 1040.6190063, 1045.6369994,
1050.1010009, 1053.0730102, 45.4718259236287, 45.2372613787558,
56.9881807801438, 58.8717301068573, 68.2039283244873, 73.5215112680329,
78.8594307629251, 73.0335410836162, 71.845824268758, 73.323376014074,
89.1748677280385, 88.8275948061702, 88.079358554904, 72.9197089804835,
66.5774741060939, 65.5905607795046, 60.3560855296636, 60.5351059532554,
61.4085229097936, 58.076745639994, 63.2173375817626, 67.2733875032827,
68.7459719049055, 59.9037653356146, 44.6491666372171, 40.4929666577831,
30.2655738215587, 36.0522832244009, 40.7505784647263, 45.517250253278,
41.5835266382263, 41.3526668380199, 41.539756712543, 48.3189167794286,
49.8415866657383, 44.5858982397584, 50.0675010891207, 50.5139938354098,
44.9097955003298, 37.4247186375495, 41.3952548987526, 39.6467050713014,
39.3953595896288, 36.8289128008105, 42.8772642627352, 37.5760511024063,
42.0791664435174, 36.4236440580649, 25.1434697637668, 29.0666072154372,
25.3668839063101, 34.1040319281821, 34.1351918720353, 42.138526061446,
49.3942545777117, 53.2282422165058, 60.0907410718325, 59.6946479180297,
56.5126081396889, 64.5584522103826, 61.6638469740838, 48.5567687748239,
50.4491176695018, 45.8595330253583, 39.1134283844586, 22.2017732449298,
24.6509068125481, 33.7409449463083, 27.0354908046699, 36.9033514343542,
31.849732552439, 28.384694400023, 30.2843907497844, 30.2566110685775,
30.1702095862, 28.1229085893699, 39.7891005017724, 37.8236546439287,
33.4844836408483, 42.9231744072258, 49.6425369989148, 43.9761986844232,
44.7318583977582, 37.1424843378588, 40.8120228103859, 50.807226927847,
47.9214803669887, 44.995279725301, 41.3197867616665, 47.7401787161256,
40.9599257198947, 48.8101085201251, 58.7773921954413, 46.8976151314924,
38.7370234461344, 43.0052200556536, 42.7247275761847, 51.7764243779359,
47.5063348907638, 48.4623219235214, 51.3175593621287, 56.6142900584089,
-4.82006799999999, -1.57995600000004, 58.6699210000002, 70.3599850000001,
79.880005, 84.580078, 80.229981, 59.5, 82.020019, 81.2299800000001,
107.909912, 109.649902, 115.48999, 84.599976, 36.26001, 28.4400639999999,
36.1500249999999, 27.3499750000001, 27.829956, 37.8100589999999,
57.309937, 40.1099850000001, 1.02001999999993, -26.089966, -33.3199460000001,
3.59997599999997, -5.35998500000005, -10.7700199999999, -19.0500489999999,
-18.3800040000001, -22.089966, -17.4400639999999, -36.839966,
-24.959961, -7.2800299999999, -6.45996100000002, 14.290039, -2.97998099999995,
3.80993600000011, -9.48999000000003, -14.479981, -36.3300789999998,
-36.790039, -42.6899410000001, -28.0200199999999, -57.830078,
-66.48999, -58.619995, -93.25, -77.900024, -47.0999750000001,
-10.130005, -20.3900140000001, 1.93005399999993, 19.820068, 15.8499750000001,
17.2800299999999, 30.6500249999999, 19.9801029999999, 27.579956,
46.8999020000001, 6.9699700000001, -13.73999, -37.900024, -27.2700199999999,
-92.150024, -105.330078, -70.410034, -102.390015, -72.189942,
-79.6201179999998, -112.140014, -106.48999, -67.0299070000001,
-53.6600349999999, -98.26001, -43.25, -9.75, -59.2399290000001,
-73.869995, -15.4799800000001, -51.280029, -57.8999020000001,
-47.880005, -40.6499020000001, -7.77001900000005, -21.2899170000001,
15.440063, -56.9399410000001, -35.419922, 23.580017, 28.5, -15.2800299999999,
-50, -32.030029, -2.47998099999995, -31.9300539999999, -44.7700199999999,
-37.98999, 20.079956, 49.670044, 58.380005, 0.0222611532791754,
0.0452135091331929, 0.0513252799641881, 0.0417837604179434, 0.025502736394083,
0.039092663599452, 0.0357347902099496, 0.00293614990186253, -0.00329432207453095,
0.0181141450822189, 0.0402852378681278, 0.0551615667800078, 0.0663056560265511,
0.0442341189174087, 0.0117432944413327, -0.025003895701337, -0.0351848233779339,
-0.0338218411236912, -0.0120137739039121, 0.00411537451562882,
0.0202976386336982, 0.0207662940930682, 0.0185440740696787, 0.0112948922357141,
0.00832598771420034, -9.66018891714882e-05, -0.0253916951198745,
-0.0347079634534282, -0.0300608837885816, -0.0223033747170538,
-0.0331328340436947, -0.00582238916306288, -0.00092043524789176,
0.0162623189210285, 0.0278023013942841, 0.0242780692234357, 0.0341721602379419,
0.0276065721476719, -0.00201742129018712, -0.0367595754116454,
-0.0369577878306506, -0.0643497227781094, -0.0618263303728748,
-0.0449540628540124, -0.0165437954424839, -0.0201428806167474,
0.00331521089287889, 0.0065887162483893, -0.00740297497164288,
-0.0138034795252402, 0.00708686703803085, 0.0097706638268491,
-0.00550758934150863, 0.0148708818967105, 0.0199762409613848,
0.0079946880333539, 0.00652531170373116, 0.0232087632715174,
0.0185256691345472, 0.012965814191138, 0.0188472345861976, -0.0223894054190623,
-0.0307321178168358, -0.0395397517017582, -0.0524206155642792,
-0.106686826243081, -0.0791243287288781, -0.041700843048468,
-0.0506260747757752, -0.0155216754472765, 0.0313829883191348,
0.00798238469401547, -0.0123452722292345, 0.00812441164353306,
-0.0158118578835529, -0.0600069056977848, 0.00696117861714018,
-0.0230552625927682, -0.0764831282344325, -0.0630892695041085,
0.0244997487533043, -0.0236160780123607, -0.0128496474489905,
0.0194261429225948, 0.0187385123731847, 0.0153171376045522, 0.0115221715735752,
0.00787218840953852, -0.00140467331860261, -0.0188928482186341,
-0.0465491768740778, -0.0164783950656826, -0.0043804792361124,
-0.0180999145663217, -0.00998164151028913, -0.00581382135522279,
-0.0391030878479981, -0.0121985628088801, 0.0236495379306092,
0.0572791560421972, 0.0476969136015821, 0.0666343919981838, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0,
0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1,
1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0,
0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0), .Dim = c(102L,
13L), .Dimnames = list(NULL, c("open", "high", "low", "close",
"volume", "adjusted", "direction", "returns", "sma", "rsi", "momentum",
"roc", "pred")), index = structure(c(1531180800, 1531267200,
1531353600, 1531440000, 1531699200, 1531785600, 1531872000, 1531958400,
1532044800, 1532304000, 1532390400, 1532476800, 1532563200, 1532649600,
1532908800, 1532995200, 1533081600, 1533168000, 1533254400, 1533513600,
1533600000, 1533686400, 1533772800, 1533859200, 1534118400, 1534204800,
1534291200, 1534377600, 1534464000, 1534723200, 1534809600, 1534896000,
1534982400, 1535068800, 1535328000, 1535414400, 1535500800, 1535587200,
1535673600, 1536019200, 1536105600, 1536192000, 1536278400, 1536537600,
1536624000, 1536710400, 1536796800, 1536883200, 1537142400, 1537228800,
1537315200, 1537401600, 1537488000, 1537747200, 1537833600, 1537920000,
1538006400, 1538092800, 1538352000, 1538438400, 1538524800, 1538611200,
1538697600, 1538956800, 1539043200, 1539129600, 1539216000, 1539302400,
1539561600, 1539648000, 1539734400, 1539820800, 1539907200, 1540166400,
1540252800, 1540339200, 1540425600, 1540512000, 1540771200, 1540857600,
1540944000, 1541030400, 1541116800, 1541376000, 1541462400, 1541548800,
1541635200, 1541721600, 1541980800, 1542067200, 1542153600, 1542240000,
1542326400, 1542585600, 1542672000, 1542758400, 1542931200, 1543190400,
1543276800, 1543363200, 1543449600, 1543536000), tzone = "UTC", tclass = "Date"), class = c("xts",
"zoo"), .indexCLASS = "Date", .indexTZ = "UTC", tclass = "Date", tzone = "UTC", src = "yahoo", updated = structure(1544367929.32363, class = c("POSIXct",
"POSIXt")))