2016-01-25 51 views
2

越来越开仓交易价格我使用quantmod包我的交易,但在过去的几天里我得到了越来越开放的每日价格(SPY)的延迟,当我跑我的市场代码延迟营业时间美国东部时间上午9:30大约10分钟后,所有工作都很好,我得到的数字,但我怎么能绕过这个延迟?是因为我的代码还是其他原因? 我使用quantmod版本0.4-4。为什么会出现在使用quantmod

# rm(list = ls()) # generally considered as bad manner in an MWE 
require(quantmod) 
options(scipen=999) 
spy <- getSymbols(("SPY") , src = 'yahoo', from = '2007-01-01', auto.assign = T) 
Warning message: 
In download.file(paste(yahoo.URL, "s=", Symbols.name, "&a=", from.m, : 
    downloaded length 168806 != reported length 200 
spy<-cbind(SPY) 
q <- getQuote("SPY") # adds the current trade row 
qCols <- c("Open","High","Low","Last","Volume","Last") 
qx <- xts(q[,qCols], as.Date(q[,"Trade Time"])) 
SPY <- rbind(SPY, qx) 
Warning messages: 
    1: In rbind(deparse.level, ...) : 
     mismatched types: converting objects to numeric 
    2: In rbind(deparse.level, ...) : NAs introduced by coercion 
+0

适合我。 –

+0

你好@Pascal,你没有遇到延迟吗?对于我来说,在市场开放15分钟后,我得到了SPY的每日开盘价格。我不确定这是因为雅虎方面还是来自我的代码。 – mql4beginner

+0

没有延迟。我立即得到它。也许有些延迟。你现在试试了吗?此外,我收到任何警告。你的'quantmod'版本是什么? –

回答

相关问题