如何让R有选择地计算某些变量的值?

时间:2017-01-16 23:27:00

标签: r

我的数据集是一个包含29个数据帧的列表,因此一个数据框如下所示:

>MergedData[[1]]
     Date        EUR.HIGH EUR.LOW EUR.CLOSE
1   2016-08-30   1.1192  1.1153    1.1161
2   2016-08-29   1.1208  1.1158    1.1189
3   2016-08-28   1.1341  1.1181    1.1198
4   2016-08-27   1.1341  1.1181    1.1198
5   2016-08-26   1.1341  1.1181    1.1198
6   2016-08-25   1.1298  1.1259    1.1285
7   2016-08-24   1.1312  1.1245    1.1264

因此,使用此列表,我在R中计算了“信号”,其值为-2,1和0.我希望R进行计算,并将它们保留在输出中,以获得值不为零的变量。这是我的信号在R中的样子:

>price.break
            EUR JPY  GBP  CHF  AUD CAD NZD SEK  
2016-02-19  NA  NA   NA   NA   NA  NA   NA  NA
2016-02-20   0  -2   0    0    -2   0   0   0   
2016-02-21   0   0   0    0     0   0   0   0   

>ma.sig

            EUR  JPY   GBP  CHF  AUD CAD  NZD SEK  
2016-02-19  NA   NA   NA   NA   NA  NA   NA  NA
2016-02-20   0   1    0    0    1   0   0   0   
2016-02-21   0   0    0    0    0   0   0   0   

由于我们已经知道JPY和AUD都返回了非零信号,我希望R计算一个如下所示的输出表:

    Currency  Deviation from MA  RSI
    JPY
    AUD

这是我试图让R做到这一点的(相当可怕的)尝试:

new.trend <- function(x)
{
  ret <- as.list(rep(NA, length(x)))
  for (i in 1:length(MergedData)){
    x <- MergedData[[i]]
    x <- xts(x[,-1], order.by=x[,1])
    ma.sig <- ma.crossover(x)
    pricebreak <- price.channel(x)

    sig.col <- col(x)[which(!ma.sig[,i]&ma.sig[,i-1)]==0)&which(!pricebreak[,i]&pricebreak[,i-1]==0)]
   sig.row <- row(x)[which(!ma.sig[,i]&ma.sig[,i-1)]==0)&which(!pricebreak[,i]&pricebreak[,i-1]==0)]

  ma20 <- SMA(x[sig.row, sig.col], n=20)
  ma50 <- SMA(x[sig.row, sig.col], n=50)  
  RSI <- RSI(x[sig.row, sig.col], n=14)
  dev20 <- x[sig.row, sig.col]-ma20[sig.row, sig.col]/x[sig.row, sig.col]*100
  dev50 <- x[sig.row, sig.col]-ma50[sig.row, sig.col]/x[sig.row, sig.col]*100
  ret[[i]] <- merge(RSI, 20dev, 50dev)
  }
  na.omit(do.call(merge,ret))
}

使用sig.col和sig.row,我希望提取确切的行/列号,以便有选择地计算我们得到非负信号的实例。我得到的错误是“错误的数字维度”,而且我有一种强烈的感觉,无论如何我正在做的事情是不正确的。

ma.crossover和pricebreak只是计算以下内容的函数:

ma.crossover<- function(MergedData){
  ma <- as.list(rep(NA, length(MergedData)))
  for(i in 1:length(MergedData)) {
    x <- MergedData[[i]]
    x <- xts(x[,-1], order.by=x[,1]) 
    ma20 <- SMA(x[,3], n=20) 
    ma50 <- SMA(x[,3], n=50)
    ma[[i]] <- sign(ma20 - ma50)
  } 

  na.omit(do.call(merge, ma))
}

##price channel
price.channel <- function(MergedData) 
{
  ret <- as.list(rep(NA, length(MergedData))) 
  for (i in 1:length(MergedData)) {
  x<- MergedData[[i]]
  x <- xts(x[,-1], order.by=x[,1])
  high <- runMax(x[,2], 20)
  low <- runMin(x[,3], 20)
  mid <- (high+low)/2
  channel <- cbind(high, mid, low)
  ret[[i]] <- merge(sign(high-x[,5]), sign(x[,5]-low)) 
  }
  na.omit(do.call(merge, ret)) 
}

我已经坚持了一段时间,因此非常感谢评论或反馈。这是我的输入样本,如果有帮助的话:

tzone = "", class = c("POSIXct", 
"POSIXt")), PHP.OPEN = c(46.385, 46.283, 46.283, 46.283, 
46.283, 46.33, 46.45, 46.45, 46.5, 46.29, 46.29, 46.29, 46.235, 
46.28, 46.225, 46.445, 46.455, 46.455, 46.455, 46.365, 46.73, 
46.85, 46.423, 46.05, 46.05, 46.05, 46.975, 46.03, 46.035, 
46.915, 47.017, 47.017, 47.017, 47.05, 46.825, 47.105, 47.12, 
47, 47, 47, 47.055, 46.015, 46.725, 46.675, 46.671, 46.671, 
46.671, 47.019, 47, 47.055, 47.033, 47, 47, 47, 46.85, 46.765, 
46.765, 46.753, 46.465, 46.465, 46.465, 46.035, 46.49, 45.93, 
46.955, 46.51, 46.51, 46.51, 46.475, 46.365, 46.31, 46.3, 
44.623, 44.623, 44.623, 46.285, 46.31, 46.073, 46.07, 46.06, 
46.06, 46.06, 45.859, 46, 45.728, 46.2, 46.452, 46.452, 46.452, 
46.53, 46.64, 46.653, 46.69, 46.614, 46.614, 46.614, 46.429, 
46.63, 46.788, 46.69, 46.714, 46.714, 46.714, 46.705, 46.465, 
46.325, 46.055, 46.55, 46.55, 46.55, 46.458, 46.53, 46.753, 
47.085, 47.085, 47.085, 47.085, 47.118, 46.595, 46.845, 46.225, 
46.66, 46.66, 46.66, 46.722, 46.64, 46.728, 46.683, 46.285, 
46.285, 46.285, 46.224, 46.04, 46.055, 46.06, 46.049, 46.049, 
46.049, 46.154, 45.903, 46.017, 46, 46.12, 46.12, 46.12, 
46.07, 46.165, 46.153, 45, 45.95, 45.95, 45.95, 45.91, 46.02, 
46.235, 46.325, 46.227, 46.227, 46.227, 46.227, 46.227, 46.16, 
46, 46.168, 46.168, 46.168, 46.357, 46.475, 46.61, 46.439, 
46.595, 46.595, 46.595, 46.653, 46.835, 46.285, 46.772, 46.861, 
46.861, 46.861, 47.02, 47.225, 47.3, 47.525, 47.076, 47.076, 
47.076, 47.62, 47.613, 47.575, 47.585, 47.552, 47.552, 47.552, 
47.51, 47.45, 47.403, 47.435, 47.45, 47.45, 47.45, 47.375, 
47.445, 47, 47.665, 47.665, 47.665, 47.665, 47.719, 47.825, 
47.67, 47.623, 47.615, 47.615, 47.615, 47.717, 47.809, 47.869, 
47.72, 47.8, 47.8, 47.8, 47.695, 47.67, 47.586, 47.635, 47.63, 
47.63, 47.63, 47.55, 47.335, 47.2, 47.233, 46.92, 46.92, 
46.92, 46.98, 46.82, 46.875, 47, 47.17, 47.17, 47.17), PHP.HIGH = c(46.535, 
46.438, 46.438, 46.438, 46.438, 46.583, 46.645, 46.59, 46.702, 
46.488, 46.488, 46.488, 46.41, 46.88, 46.88, 46.77, 46.865, 
46.865, 46.865, 46.8, 46.865, 46.975, 47.02, 47.04, 47.04, 
47.04, 47.075, 47.358, 47.487, 47.03, 47.135, 47.135, 47.135, 
47.18, 47.228, 47.24, 47.228, 47.155, 47.155, 47.155, 47.23, 
47.158, 46.96, 46.89, 47.055, 47.055, 47.055, 47.22, 47.435, 
47.49, 47.32, 47.585, 47.585, 47.585, 47.112, 47.345, 47.345, 
46.895, 47.065, 47.065, 47.065, 47.935, 47.98, 47.95, 47.183, 
46.975, 46.975, 46.975, 46.587, 46.64, 46.388, 46.445, 46.475, 
46.475, 46.475, 46.455, 46.479, 47.065, 46.222, 46.155, 46.155, 
46.155, 46.388, 46.12, 46.265, 46.45, 46.982, 46.982, 46.982, 
46.615, 46.79, 47.065, 46.825, 46.71, 46.71, 46.71, 46.788, 
46.889, 46.925, 46.86, 46.86, 46.86, 46.86, 46.947, 46.705, 
46.457, 46.655, 46.8, 46.8, 46.8, 46.715, 46.75, 47.205, 
47.385, 47.385, 47.385, 47.385, 47.245, 47.132, 47.75, 47.041, 
46.964, 46.964, 46.964, 46.878, 46.842, 46.94, 46.874, 46.68, 
46.68, 46.68, 46.46, 46.225, 46.16, 46.2, 46.25, 46.25, 46.25, 
46.306, 46.487, 46.14, 46.18, 46.266, 46.266, 46.266, 46.17, 
46.338, 46.295, 46.105, 47.02, 47.02, 47.02, 46.085, 46.262, 
46.439, 46.537, 46.463, 46.463, 46.463, 46.463, 46.463, 46.39, 
46.577, 46.379, 46.379, 46.379, 46.58, 46.925, 46.83, 46.607, 
46.795, 46.795, 46.795, 46.855, 47.025, 47.035, 46.925, 47.125, 
47.125, 47.125, 47.252, 47.307, 47.5, 47.605, 47.603, 47.603, 
47.603, 47.62, 47.717, 47.66, 47.705, 47.905, 47.905, 47.905, 
47.595, 47.695, 47.59, 47.555, 47.74, 47.74, 47.74, 47.488, 
47.632, 47.795, 47.757, 47.757, 47.757, 47.757, 47.8, 47.925, 
47.79, 47.74, 47.775, 47.775, 47.775, 47.945, 47.995, 48.005, 
47.9, 47.911, 47.911, 47.911, 47.958, 47.895, 47.755, 47.885, 
47.78, 47.78, 47.78, 47.748, 47.55, 47.46, 47.335, 47.173, 
47.173, 47.173, 47.14, 47.062, 47.188, 47.158, 47.17, 47.17, 
47.17), PHP.LOW = c(46.385, 46.283, 46.283, 46.283, 46.283, 
46.33, 46.45, 46.45, 46.5, 46.29, 46.29, 46.29, 46.235, 46.28, 
46.225, 46.445, 46.455, 46.455, 46.455, 46.365, 46.73, 46.85, 
46.423, 46.05, 46.05, 46.05, 46.975, 46.03, 46.035, 46.915, 
47.017, 47.017, 47.017, 47.05, 46.825, 47.105, 47.12, 47, 
47, 47, 47.055, 46.015, 46.725, 46.675, 46.671, 46.671, 46.671, 
47.019, 47, 47.055, 47.033, 47, 47, 47, 46.85, 46.765, 46.765, 
46.753, 46.465, 46.465, 46.465, 46.035, 46.49, 45.93, 46.955, 
46.51, 46.51, 46.51, 46.475, 46.365, 46.31, 46.3, 44.623, 
44.623, 44.623, 46.285, 46.31, 46.073, 46.07, 46.06, 46.06, 
46.06, 45.859, 46, 45.728, 46.2, 46.452, 46.452, 46.452, 
46.53, 46.64, 46.653, 46.69, 46.614, 46.614, 46.614, 46.429, 
46.63, 46.788, 46.69, 46.714, 46.714, 46.714, 46.705, 46.465, 
46.325, 46.055, 46.55, 46.55, 46.55, 46.458, 46.53, 46.753, 
47.085, 47.085, 47.085, 47.085, 47.118, 46.595, 46.845, 46.225, 
46.66, 46.66, 46.66, 46.722, 46.64, 46.728, 46.683, 46.285, 
46.285, 46.285, 46.224, 46.04, 46.055, 46.06, 46.049, 46.049, 
46.049, 46.154, 45.903, 46.017, 46, 46.12, 46.12, 46.12, 
46.07, 46.165, 46.153, 45, 45.95, 45.95, 45.95, 45.91, 46.02, 
46.235, 46.325, 46.227, 46.227, 46.227, 46.227, 46.227, 46.16, 
46, 46.168, 46.168, 46.168, 46.357, 46.475, 46.61, 46.439, 
46.595, 46.595, 46.595, 46.653, 46.835, 46.285, 46.772, 46.861, 
46.861, 46.861, 47.02, 47.225, 47.3, 47.525, 47.076, 47.076, 
47.076, 47.62, 47.613, 47.575, 47.585, 47.552, 47.552, 47.552, 
47.51, 47.45, 47.403, 47.435, 47.45, 47.45, 47.45, 47.375, 
47.445, 47, 47.665, 47.665, 47.665, 47.665, 47.719, 47.825, 
47.67, 47.623, 47.615, 47.615, 47.615, 47.717, 47.809, 47.869, 
47.72, 47.8, 47.8, 47.8, 47.695, 47.67, 47.586, 47.635, 47.63, 
47.63, 47.63, 47.55, 47.335, 47.2, 47.233, 46.92, 46.92, 
46.92, 46.98, 46.82, 46.875, 47, 47.17, 47.17, 47.17), PHP.CLOSE = c(46.46, 
46.36, 46.36, 46.36, 46.36, 46.345, 46.535, 46.45, 46.58, 
46.45, 46.45, 46.45, 46.28, 46.41, 46.88, 46.455, 46.6, 46.6, 
46.6, 46.79, 46.75, 46.85, 46.835, 46.9, 46.9, 46.9, 47.02, 
47.035, 46.961, 46.94, 47.11, 47.11, 47.11, 47.07, 47.18, 
47.14, 47.15, 47.12, 47.12, 47.12, 47.077, 46.725, 46.94, 
46.714, 46.85, 46.85, 46.85, 47.05, 47.21, 47.321, 47.31, 
47.125, 47.125, 47.125, 47, 47.03, 47.03, 46.775, 46.915, 
46.915, 46.915, 47.085, 46.965, 46.895, 47.03, 46.95, 46.95, 
46.95, 46.51, 46.475, 46.38, 46.335, 46.425, 46.425, 46.425, 
46.43, 46.43, 46.31, 46.08, 46.13, 46.13, 46.13, 46.055, 
46.01, 46.11, 46.225, 46.465, 46.465, 46.465, 46.53, 46.64, 
46.75, 46.75, 46.635, 46.635, 46.635, 46.69, 46.785, 46.92, 
46.788, 46.75, 46.75, 46.75, 46.8, 46.66, 46.42, 46.46, 46.555, 
46.555, 46.555, 46.647, 46.555, 46.757, 47.09, 47.09, 47.09, 
47.09, 47.24, 47.08, 46.89, 46.965, 46.89, 46.89, 46.89, 
46.77, 46.78, 46.76, 46.85, 46.645, 46.645, 46.645, 46.44, 
46.225, 46.093, 46.185, 46.065, 46.065, 46.065, 46.25, 46.085, 
46.018, 46.122, 46.135, 46.135, 46.135, 46.1, 46.2, 46.26, 
46.08, 46.015, 46.015, 46.015, 46.07, 46.028, 46.35, 46.34, 
46.395, 46.395, 46.395, 46.395, 46.395, 46.285, 46.33, 46.36, 
46.36, 46.36, 46.38, 46.785, 46.83, 46.595, 46.62, 46.62, 
46.62, 46.695, 46.855, 46.958, 46.92, 46.946, 46.946, 46.946, 
47.125, 47.298, 47.35, 47.558, 47.515, 47.515, 47.515, 47.62, 
47.625, 47.635, 47.619, 47.665, 47.665, 47.665, 47.55, 47.45, 
47.573, 47.45, 47.74, 47.74, 47.74, 47.45, 47.47, 47.671, 
47.665, 47.665, 47.665, 47.665, 47.775, 47.86, 47.685, 47.69, 
47.65, 47.65, 47.65, 47.743, 47.815, 47.997, 47.89, 47.805, 
47.805, 47.805, 47.935, 47.89, 47.67, 47.706, 47.745, 47.745, 
47.745, 47.64, 47.542, 47.45, 47.269, 47.158, 47.158, 47.158, 
47.01, 47.025, 46.89, 47.125, 47.17, 47.17, 47.17), PHP.LAST = c(46.46, 
46.36, 46.36, 46.36, 46.36, 46.345, 46.535, 46.45, 46.58, 
46.45, 46.45, 46.45, 46.28, 46.41, 46.88, 46.455, 46.6, 46.6, 
46.6, 46.79, 46.75, 46.85, 46.835, 46.9, 46.9, 46.9, 47.02, 
47.035, 46.961, 46.94, 47.11, 47.11, 47.11, 47.07, 47.18, 
47.14, 47.15, 47.12, 47.12, 47.12, 47.077, 46.725, 46.94, 
46.714, 46.85, 46.85, 46.85, 47.05, 47.21, 47.321, 47.31, 
47.125, 47.125, 47.125, 47, 47.03, 47.03, 46.775, 46.915, 
46.915, 46.915, 47.085, 46.965, 46.895, 47.03, 46.95, 46.95, 
46.95, 46.51, 46.475, 46.38, 46.335, 46.425, 46.425, 46.425, 
46.43, 46.43, 46.31, 46.08, 46.13, 46.13, 46.13, 46.055, 
46.01, 46.11, 46.225, 46.465, 46.465, 46.465, 46.53, 46.64, 
46.75, 46.75, 46.635, 46.635, 46.635, 46.69, 46.785, 46.92, 
46.788, 46.75, 46.75, 46.75, 46.8, 46.66, 46.42, 46.46, 46.555, 
46.555, 46.555, 46.647, 46.555, 46.757, 47.09, 47.09, 47.09, 
47.09, 47.24, 47.08, 46.89, 46.965, 46.89, 46.89, 46.89, 
46.77, 46.78, 46.76, 46.85, 46.645, 46.645, 46.645, 46.44, 
46.225, 46.093, 46.185, 46.065, 46.065, 46.065, 46.25, 46.085, 
46.018, 46.122, 46.135, 46.135, 46.135, 46.1, 46.2, 46.26, 
46.08, 46.015, 46.015, 46.015, 46.07, 46.028, 46.35, 46.34, 
46.395, 46.395, 46.395, 46.395, 46.395, 46.285, 46.33, 46.36, 
46.36, 46.36, 46.38, 46.785, 46.83, 46.595, 46.62, 46.62, 
46.62, 46.695, 46.855, 46.958, 46.92, 46.946, 46.946, 46.946, 
47.125, 47.298, 47.35, 47.558, 47.515, 47.515, 47.515, 47.62, 
47.625, 47.635, 47.619, 47.665, 47.665, 47.665, 47.55, 47.45, 
47.573, 47.45, 47.74, 47.74, 47.74, 47.45, 47.47, 47.671, 
47.665, 47.665, 47.665, 47.665, 47.775, 47.86, 47.685, 47.69, 
47.65, 47.65, 47.65, 47.743, 47.815, 47.997, 47.89, 47.805, 
47.805, 47.805, 47.935, 47.89, 47.67, 47.706, 47.745, 47.745, 
47.745, 47.64, 47.542, 47.45, 47.269, 47.158, 47.158, 47.158, 
47.01, 47.025, 46.89, 47.125, 47.17, 47.17, 47.17)), .Names = c("Date", 
"PHP.OPEN", "PHP.HIGH", "PHP.LOW", "PHP.CLOSE", "PHP.LAST"
), row.names = c(NA, -243L), class = "data.frame"), structure(list(
    Date = structure(c(1472533200, 1472446800, 1472360400, 
    1472274000, 1472187600, 1472101200, 1472014800, 1471928400, 
    1471842000, 1471755600, 1471669200, 1471582800, 1471496400, 
    1471410000, 1471323600, 1471237200, 1471150800, 1471064400, 
    1470978000, 1470891600, 1470805200, 1470718800, 1470632400, 
    1470546000, 1470459600, 1470373200, 1470286800, 1470200400, 
    1470114000, 1470027600, 1469941200, 1469854800, 1469768400, 
    1469682000, 1469595600, 1469509200, 1469422800, 1469336400, 
    1469250000, 1469163600, 1469077200, 1468990800, 1468904400, 
    1468818000, 1468731600, 1468645200, 1468558800, 1468472400, 
    1468386000, 1468299600, 1468213200, 1468126800, 1468040400, 
    1467954000, 1467867600, 1467781200, 1467694800, 1467608400, 
    1467522000, 1467435600, 1467349200, 1467262800, 1467176400, 
    1467090000, 1467003600, 1466917200, 1466830800, 1466744400, 
    1466658000, 1466571600, 1466485200, 1466398800, 1466312400, 
    1466226000, 1466139600, 1466053200, 1465966800, 1465880400, 
    1465794000, 1465707600, 1465621200, 1465534800, 1465448400, 
    1465362000, 1465275600, 1465189200, 1465102800, 1465016400, 
    1464930000, 1464843600, 1464757200, 1464670800, 1464584400, 
    1464498000, 1464411600, 1464325200, 1464238800, 1464152400, 
    1464066000, 1463979600, 1463893200, 1463806800, 1463720400, 
    1463634000, 1463547600, 1463461200, 1463374800, 1463288400, 
    1463202000, 1463115600, 1463029200, 1462942800, 1462856400, 
    1462770000, 1462683600, 1462597200, 1462510800, 1462424400, 
    1462338000, 1462251600, 1462165200, 1462078800, 1461992400, 
    1461906000, 1461819600, 1461733200, 1461646800, 1461560400, 
    1461474000, 1461387600, 1461301200, 1461214800, 1461128400, 
    1461042000, 1460955600, 1460869200, 1460782800, 1460696400, 
    1460610000, 1460523600, 1460437200, 1460350800, 1460264400, 
    1460178000, 1460091600, 1460005200, 1459918800, 1459832400, 
    1459746000, 1459659600, 1459573200, 1459486800, 1459400400, 
    1459314000, 1459227600, 1459141200, 1459054800, 1458968400, 
    1458882000, 1458795600, 1458709200, 1458622800, 1458536400, 
    1458450000, 1458363600, 1458277200, 1458190800, 1458104400, 
    1458018000, 1457931600, 1457848800, 1457762400, 1457676000, 
    1457589600, 1457503200, 1457416800, 1457330400, 1457244000, 
    1457157600, 1457071200, 1456984800, 1456898400, 1456812000, 
    1456725600, 1456639200, 1456552800, 1456466400, 1456380000, 
    1456293600, 1456207200, 1456120800, 1456034400, 1455948000, 
    1455861600, 1455775200, 1455688800, 1455602400, 1455516000, 
    1455429600, 1455343200, 1455256800, 1455170400, 1455084000, 
    1454997600, 1454911200, 1454824800, 1454738400, 1454652000, 
    1454565600, 1454479200, 1454392800, 1454306400, 1454220000, 
    1454133600, 1454047200, 1453960800, 1453874400, 1453788000, 
    1453701600, 1453615200, 1453528800, 1453442400, 1453356000, 
    1453269600, 1453183200, 1453096800, 1453010400, 1452924000, 
    1452837600, 1452751200, 1452664800, 1452578400, 1452492000, 
    1452405600, 1452319200, 1452232800, 1452146400, 1452060000, 
    1451973600, 1451887200, 1451800800, 1451714400, 1451628000
    ), tzone = "", class = c("POSIXct", "POSIXt")), THB.OPEN = c(34.53, 
    34.596, 34.506, 34.506, 34.506, 34.539, 34.573, 34.564, 
    34.607, 34.528, 34.528, 34.528, 34.531, 34.577, 34.52, 
    34.577, 34.696, 34.696, 34.696, 34.731, 34.738, 34.911, 
    34.901, 34.796, 34.796, 34.796, 34.886, 34.739, 34.74, 
    34.72, 34.8, 34.8, 34.8, 34.84, 34.951, 34.98, 34.905, 
    34.87, 34.87, 34.87, 34.95, 34.97, 34.931, 34.918, 34.907, 
    34.907, 34.907, 35.029, 35.13, 35.103, 35.049, 35.169, 
    35.169, 35.169, 35.145, 35.149, 35.012, 35.011, 35.06, 
    35.06, 35.06, 35.097, 35.175, 35.238, 35.257, 35.114, 
    35.114, 35.114, 35.146, 35.173, 35.15, 35.162, 35.225, 
    35.225, 35.225, 35.151, 35.24, 35.12, 35.16, 35.147, 
    35.147, 35.147, 35.085, 35.189, 35.217, 35.26, 35.545, 
    35.545, 35.545, 35.57, 35.64, 35.691, 35.69, 35.56, 35.56, 
    35.56, 35.571, 35.625, 35.664, 35.56, 35.622, 35.622, 
    35.622, 35.641, 35.486, 35.32, 35.341, 35.311, 35.311, 
    35.311, 35.217, 35.19, 35.193, 35.09, 35.126, 35.126, 
    35.126, 35.075, 34.99, 34.83, 34.83, 34.885, 34.885, 
    34.885, 35.007, 35.09, 35.08, 35.052, 35.02, 35.02, 35.02, 
    34.883, 34.825, 34.88, 35.01, 35.051, 35.051, 35.051, 
    35.024, 34.951, 35.005, 35.04, 35.09, 35.09, 35.09, 35.15, 
    35.214, 35.237, 35.12, 35.09, 35.09, 35.09, 35.159, 35.189, 
    35.323, 35.274, 35.265, 35.265, 35.265, 35.188, 34.917, 
    34.88, 34.85, 34.745, 34.745, 34.745, 34.77, 34.99, 35.07, 
    35.05, 35.064, 35.064, 35.064, 35.239, 35.287, 35.365, 
    35.349, 35.385, 35.385, 35.385, 35.476, 35.54, 35.588, 
    35.618, 35.63, 35.63, 35.63, 35.65, 35.69, 35.715, 35.717, 
    35.54, 35.54, 35.54, 35.537, 35.6, 35.59, 35.552, 35.228, 
    35.228, 35.228, 35.228, 35.3, 35.388, 35.495, 35.48, 
    35.48, 35.48, 35.55, 35.77, 35.579, 35.591, 35.684, 35.684, 
    35.684, 35.775, 35.77, 35.89, 35.925, 36.026, 36.026, 
    36.026, 36.235, 36.272, 36.26, 36.29, 36.28, 36.28, 36.28, 
    36.256, 36.237, 36.235, 36.25, 36.17, 36.17, 36.17, 36.226, 
    36.103, 36.08, 36.033, 36.02, 36.02, 36.02), THB.HIGH = c(34.655, 
    34.72, 34.601, 34.601, 34.601, 34.675, 34.69, 34.676, 
    34.764, 34.671, 34.671, 34.671, 34.69, 34.737, 34.65, 
    34.82, 34.86, 34.86, 34.86, 34.838, 34.967, 35.005, 35.065, 
    34.93, 34.93, 34.93, 35.039, 34.95, 34.84, 34.91, 34.92, 
    34.92, 34.92, 34.967, 35.074, 35.086, 35.08, 35, 35, 
    35, 35.088, 35.09, 35.04, 35.03, 35.085, 35.085, 35.085, 
    35.23, 35.257, 35.206, 35.225, 35.264, 35.264, 35.264, 
    35.239, 35.281, 35.198, 35.125, 35.16, 35.16, 35.16, 
    35.228, 35.295, 35.371, 35.435, 35.546, 35.546, 35.546, 
    35.244, 35.29, 35.24, 35.284, 35.356, 35.356, 35.356, 
    35.254, 35.39, 35.303, 35.295, 35.295, 35.295, 35.295, 
    35.24, 35.241, 35.327, 35.411, 35.64, 35.64, 35.64, 35.704, 
    35.77, 35.755, 35.8, 35.701, 35.701, 35.701, 35.68, 35.795, 
    35.787, 35.706, 35.736, 35.736, 35.736, 35.8, 35.625, 
    35.557, 35.461, 35.466, 35.466, 35.466, 35.34, 35.294, 
    35.267, 35.166, 35.193, 35.193, 35.193, 35.19, 35.184, 
    34.94, 34.934, 35.009, 35.009, 35.009, 35.16, 35.195, 
    35.222, 35.17, 35.095, 35.095, 35.095, 35.095, 34.949, 
    35.02, 35.11, 35.12, 35.12, 35.12, 35.211, 35.055, 35.07, 
    35.112, 35.234, 35.234, 35.234, 35.253, 35.31, 35.39, 
    35.29, 35.175, 35.175, 35.175, 35.262, 35.365, 35.44, 
    35.408, 35.365, 35.365, 35.365, 35.395, 35.13, 34.963, 
    34.952, 34.925, 34.925, 34.925, 34.975, 35.145, 35.15, 
    35.151, 35.26, 35.26, 35.26, 35.31, 35.393, 35.47, 35.495, 
    35.46, 35.46, 35.46, 35.559, 35.656, 35.655, 35.763, 
    35.707, 35.707, 35.707, 35.714, 35.759, 35.776, 35.781, 
    35.75, 35.75, 35.75, 35.63, 35.68, 35.671, 35.69, 35.64, 
    35.64, 35.64, 35.325, 35.428, 35.539, 35.612, 35.651, 
    35.651, 35.651, 35.755, 35.87, 35.771, 35.77, 35.861, 
    35.861, 35.861, 35.885, 35.874, 36.045, 36.055, 36.253, 
    36.253, 36.253, 36.29, 36.327, 36.325, 36.382, 36.374, 
    36.374, 36.374, 36.345, 36.338, 36.375, 36.345, 36.327, 
    36.327, 36.327, 36.35, 36.257, 36.177, 36.19, 36.033, 
    36.033, 36.033), THB.LOW = c(34.53, 34.596, 34.506, 34.506, 
    34.506, 34.539, 34.573, 34.564, 34.607, 34.528, 34.528, 
    34.528, 34.531, 34.577, 34.52, 34.577, 34.696, 34.696, 
    34.696, 34.731, 34.738, 34.911, 34.901, 34.796, 34.796, 
    34.796, 34.886, 34.739, 34.74, 34.72, 34.8, 34.8, 34.8, 
    34.84, 34.951, 34.98, 34.905, 34.87, 34.87, 34.87, 34.95, 
    34.97, 34.931, 34.918, 34.907, 34.907, 34.907, 35.029, 
    35.13, 35.103, 35.049, 35.169, 35.169, 35.169, 35.145, 
    35.149, 35.012, 35.011, 35.06, 35.06, 35.06, 35.097, 
    35.175, 35.238, 35.257, 35.114, 35.114, 35.114, 35.146, 
    35.173, 35.15, 35.162, 35.225, 35.225, 35.225, 35.151, 
    35.24, 35.12, 35.16, 35.147, 35.147, 35.147, 35.085, 
    35.189, 35.217, 35.26, 35.545, 35.545, 35.545, 35.57, 
    35.64, 35.691, 35.69, 35.56, 35.56, 35.56, 35.571, 35.625, 
    35.664, 35.56, 35.622, 35.622, 35.622, 35.641, 35.486, 
    35.32, 35.341, 35.311, 35.311, 35.311, 35.217, 35.19, 
    35.193, 35.09, 35.126, 35.126, 35.126, 35.075, 34.99, 
    34.83, 34.83, 34.885, 34.885, 34.885, 35.007, 35.09, 
    35.08, 35.052, 35.02, 35.02, 35.02, 34.883, 34.825, 34.88, 
    35.01, 35.051, 35.051, 35.051, 35.024, 34.951, 35.005, 
    35.04, 35.09, 35.09, 35.09, 35.15, 35.214, 35.237, 35.12, 
    35.09, 35.09, 35.09, 35.159, 35.189, 35.323, 35.274, 
    35.265, 35.265, 35.265, 35.188, 34.917, 34.88, 34.85, 
    34.745, 34.745, 34.745, 34.77, 34.99, 35.07, 35.05, 35.064, 
    35.064, 35.064, 35.239, 35.287, 35.365, 35.349, 35.385, 
    35.385, 35.385, 35.476, 35.54, 35.588, 35.618, 35.63, 
    35.63, 35.63, 35.65, 35.69, 35.715, 35.717, 35.54, 35.54, 
    35.54, 35.537, 35.6, 35.59, 35.552, 35.228, 35.228, 35.228, 
    35.228, 35.3, 35.388, 35.495, 35.48, 35.48, 35.48, 35.55, 
    35.77, 35.579, 35.591, 35.684, 35.684, 35.684, 35.775, 
    35.77, 35.89, 35.925, 36.026, 36.026, 36.026, 36.235, 
    36.272, 36.26, 36.29, 36.28, 36.28, 36.28, 36.256, 36.237, 
    36.235, 36.25, 36.17, 36.17, 36.17, 36.226, 36.103, 36.08, 
    36.033, 36.02, 36.02, 36.02), THB.CLOSE = c(34.558, 34.601, 
    34.565, 34.565, 34.565, 34.565, 34.618, 34.64, 34.67, 
    34.635, 34.635, 34.635, 34.605, 34.7, 34.575, 34.61, 
    34.81, 34.81, 34.81, 34.76, 34.751, 34.965, 34.974, 34.822, 
    34.822, 34.822, 34.927, 34.94, 34.75, 34.77, 34.83, 34.83, 
    34.83, 34.868, 34.97, 35.01, 35.05, 34.93, 34.93, 34.93, 
    34.995, 34.989, 35.01, 35.005, 34.94, 34.94, 34.94, 35.03, 
    35.16, 35.138, 35.11, 35.25, 35.25, 35.25, 35.173, 35.214, 
    35.134, 35.048, 35.086, 35.086, 35.086, 35.138, 35.23, 
    35.29, 35.35, 35.339, 35.339, 35.339, 35.173, 35.24, 
    35.173, 35.21, 35.235, 35.235, 35.235, 35.24, 35.25, 
    35.3, 35.18, 35.26, 35.26, 35.26, 35.21, 35.21, 35.23, 
    35.28, 35.629, 35.629, 35.629, 35.61, 35.67, 35.705, 
    35.75, 35.658, 35.658, 35.658, 35.6, 35.71, 35.73, 35.66, 
    35.679, 35.679, 35.679, 35.71, 35.6, 35.49, 35.37, 35.43, 
    35.43, 35.43, 35.32, 35.27, 35.236, 35.13, 35.149, 35.149, 
    35.149, 35.179, 35.184, 34.92, 34.841, 34.92, 34.92, 
    34.92, 35.02, 35.15, 35.16, 35.11, 35.04, 35.04, 35.04, 
    35.01, 34.86, 34.91, 35.03, 35.065, 35.065, 35.065, 35.12, 
    35.036, 35.02, 35.07, 35.12, 35.12, 35.12, 35.205, 35.256, 
    35.32, 35.263, 35.105, 35.105, 35.105, 35.185, 35.235, 
    35.426, 35.36, 35.27, 35.27, 35.27, 35.35, 35.118, 34.91, 
    34.89, 34.85, 34.85, 34.85, 34.78, 35.02, 35.132, 35.08, 
    35.16, 35.16, 35.16, 35.25, 35.32, 35.425, 35.42, 35.403, 
    35.403, 35.403, 35.51, 35.57, 35.625, 35.64, 35.64, 35.64, 
    35.64, 35.68, 35.7, 35.74, 35.755, 35.745, 35.745, 35.745, 
    35.548, 35.61, 35.61, 35.65, 35.58, 35.58, 35.58, 35.245, 
    35.36, 35.489, 35.51, 35.497, 35.497, 35.497, 35.56, 
    35.841, 35.76, 35.605, 35.73, 35.73, 35.73, 35.825, 35.79, 
    35.908, 36.021, 36.037, 36.037, 36.037, 36.263, 36.3, 
    36.27, 36.32, 36.366, 36.366, 36.366, 36.313, 36.25, 
    36.33, 36.28, 36.307, 36.307, 36.307, 36.285, 36.22, 
    36.15, 36.14, 36.02, 36.02, 36.02), THB.LAST = c(34.558, 
    34.601, 34.565, 34.565, 34.565, 34.565, 34.618, 34.64, 
    34.67, 34.635, 34.635, 34.635, 34.605, 34.7, 34.575, 
    34.61, 34.81, 34.81, 34.81, 34.76, 34.751, 34.965, 34.974, 
    34.822, 34.822, 34.822, 34.927, 34.94, 34.75, 34.77, 
    34.83, 34.83, 34.83, 34.868, 34.97, 35.01, 35.05, 34.93, 
    34.93, 34.93, 34.995, 34.989, 35.01, 35.005, 34.94, 34.94, 
    34.94, 35.03, 35.16, 35.138, 35.11, 35.25, 35.25, 35.25, 
    35.173, 35.214, 35.134, 35.048, 35.086, 35.086, 35.086, 
    35.138, 35.23, 35.29, 35.35, 35.339, 35.339, 35.339, 
    35.173, 35.24, 35.173, 35.21, 35.235, 35.235, 35.235, 
    35.24, 35.25, 35.3, 35.18, 35.26, 35.26, 35.26, 35.21, 
    35.21, 35.23, 35.28, 35.629, 35.629, 35.629, 35.61, 35.67, 
    35.705, 35.75, 35.658, 35.658, 35.658, 35.6, 35.71, 35.73, 
    35.66, 35.679, 35.679, 35.679, 35.71, 35.6, 35.49, 35.37, 
    35.43, 35.43, 35.43, 35.32, 35.27, 35.236, 35.13, 35.149, 
    35.149, 35.149, 35.179, 35.184, 34.92, 34.841, 34.92, 
    34.92, 34.92, 35.02, 35.15, 35.16, 35.11, 35.04, 35.04, 
    35.04, 35.01, 34.86, 34.91, 35.03, 35.065, 35.065, 35.065, 
    35.12, 35.036, 35.02, 35.07, 35.12, 35.12, 35.12, 35.205, 
    35.256, 35.32, 35.263, 35.105, 35.105, 35.105, 35.185, 
    35.235, 35.426, 35.36, 35.27, 35.27, 35.27, 35.35, 35.118, 
    34.91, 34.89, 34.85, 34.85, 34.85, 34.78, 35.02, 35.132, 
    35.08, 35.16, 35.16, 35.16, 35.25, 35.32, 35.425, 35.42, 
    35.403, 35.403, 35.403, 35.51, 35.57, 35.625, 35.64, 
    35.64, 35.64, 35.64, 35.68, 35.7, 35.74, 35.755, 35.745, 
    35.745, 35.745, 35.548, 35.61, 35.61, 35.65, 35.58, 35.58, 
    35.58, 35.245, 35.36, 35.489, 35.51, 35.497, 35.497, 
    35.497, 35.56, 35.841, 35.76, 35.605, 35.73, 35.73, 35.73, 
    35.825, 35.79, 35.908, 36.021, 36.037, 36.037, 36.037, 
    36.263, 36.3, 36.27, 36.32, 36.366, 36.366, 36.366, 36.313, 
    36.25, 36.33, 36.28, 36.307, 36.307, 36.307, 36.285, 
    36.22, 36.15, 36.14, 36.02, 36.02, 36.02)), .Names = c("Date", 
"THB.OPEN", "THB.HIGH", "THB.LOW", "THB.CLOSE", "THB.LAST"
), row.names = c(NA, -243L), class = "data.frame"))

0 个答案:

没有答案