找回密码
 注册
查看: 3991|回复: 0

R语言 tseries包 get.hist.quote()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-10-1 12:38:23 | 显示全部楼层 |阅读模式
get.hist.quote(tseries)
get.hist.quote()所属R语言包:tseries

                                        Download Historical Finance Data
                                         下载历史财务数据

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

Download historical financial data from a given data provider over the WWW.
下载的历史财务数据从一个给定的数据提供者通过WWW。


用法----------Usage----------


get.hist.quote(instrument = "^gdax", start, end,
               quote = c("Open", "High", "Low", "Close"),
               provider = c("yahoo", "oanda"), method = NULL,
               origin = "1899-12-30", compression = "d",
               retclass = c("zoo", "its", "ts"), quiet = FALSE, drop = FALSE)



参数----------Arguments----------

参数:instrument
a character string giving the name of the quote symbol to download.  See the web page of the data provider for information about the available quote symbols.
一个字符的字符串,给出的名称,下载文件的引用符号。请参阅网页的数据提供可用的引用符号信息。


参数:start
an R object specifying the date of the start of the period to download.  This must be in a form which is recognized by as.POSIXct, which includes R POSIX date/time objects, objects of class "date" (from package date) and "chron" and "dates" (from package chron), and character strings representing dates in ISO 8601 format.  Defaults to 1992-01-02.
一个R对象指定的期间的开始下载时的日期。这必须是在as.POSIXct,包括R的POSIX的日期/时间对象,对象类"date"(包date)"chron"和这是公认的一种形式"dates"(从包装chron),并在ISO 8601格式的日期字符串。默认为1992年1月2日。


参数:end
an R object specifying the end of the download period, see above.  Defaults to yesterday.
R对象指定下载期间结束,见上文。默认昨天。


参数:quote
a character string or vector indicating whether to download opening, high, low, or closing quotes, or volume.  For the default provider, this can be specified as "Open", "High", "Low", "Close", "AdjClose", and "Volume", respectively.  For the provider "oanda", this argument is ignored. Abbreviations are allowed.
字符串或向量表示是否要下载开,高,低或关闭的报价,或体积。默认提供程序,这可以被指定为"Open","High","Low","Close","AdjClose"和"Volume",分别。供应商"oanda",此参数将被忽略。缩写是允许的。


参数:provider
a character string with the name of the data provider.  Currently, "yahoo" and "oanda" are implemented.  See http://quote.yahoo.com/ and http://www.oanda.com/ for more information.
与数据供应商的名称的字符串。目前,"yahoo"和"oanda"的实施。更多信息见http://quote.yahoo.com/和http://www.oanda.com/。


参数:method
tool to be used for downloading the data.  See download.file for the available download methods and the default settings.
工具,用来下载数据。见download.file可用的下载方法和默认的设置。


参数:origin
an R object specifying the origin of the Julian dates, see above.  Defaults to 1899-12-30 (Popular spreadsheet programs internally also use Julian dates with this origin).
R对象指定的Julian日期的起源,见上面。默认1899-12-30(内部流行的电子表格程序,也可以使用这个起源与Julian日期)。


参数:compression
Governs the granularity of the retrieved data; "d" for daily, "w" for weekly or "m" for monthly.  Defaults to "d".  For the provider "oanda", this argument is ignored.
治检索到的数据的粒度; "d"每天,"w"每周或"m"每月。默认为"d"的。供应商"oanda",此参数将被忽略。


参数:retclass
character specifying which class the return value should have: can be either "zoo" (with "Date" index), "its" (with "OSIXct" index) or "ts" (with numeric index corresponding to days since origin).
可以是"zoo"("Date"指数),"its"("OSIXct"指数)或"ts"(与字符指定类的返回值应该是:日以来,origin)对应的数字索引。


参数:quiet
logical. Should status messages (if any) be suppressed?
逻辑。被抑制的状态信息(如果有的话)?


参数:drop
logical.  If TRUE the result is coerced to the lowest possible dimension.  Default is FALSE.  
逻辑。如果TRUE的结果是强制以尽可能低的尺寸。默认是FALSE。


值----------Value----------

A time series containing the data either as a "zoo" series (default), a "its" series or "ts" series. The "zoo" series is created with zoo and has an index of class "Date".  For returning an "its" series, its has to be available.  "its" series always have an index of class "OSIXct".  If a "ts" series is returned, the index is in physical time, i.e., weekends, holidays, and missing days are filled with NAs if not available.  The time scale is given in Julian dates (days since the origin).
无论是作为一个"zoo"系列(默认),一个"its"系列或"ts"系列包含数据的时间序列。 "zoo"系列与zoo和的索引类"Date"。返回"its"系列,its必须是可用的。 总是有"its"系列的指数类"OSIXct"。如果"ts"系列返回时,该指数是在物理时间,周末,假期,和失踪天都充满了NA的,如果不提供。时间尺度上Julian日期(日以来,origin)。


(作者)----------Author(s)----------


A. Trapletti



参见----------See Also----------

zoo, its, ts, as.Date, as.POSIXct, download.file; http://quote.yahoo.com/, http://www.oanda.com/
zoo,its,ts,as.Date,as.POSIXct,download.file; http://quote.yahoo.com/的,呻/ www.oanda.com/


实例----------Examples----------


con <- url("http://quote.yahoo.com")
if(!inherits(try(open(con), silent = TRUE), "try-error")) {
  close(con)
  x <- get.hist.quote(instrument = "^gspc", start = "1998-01-01",
                      quote = "Close")
  plot(x)

  x <- get.hist.quote(instrument = "ibm", quote = c("Cl", "Vol"))
  plot(x, main = "International Business Machines Corp")

  spc <- get.hist.quote(instrument = "^gspc", start = "1998-01-01",
         quote = "Close")
  ibm <- get.hist.quote(instrument = "ibm",  start = "1998-01-01",
         quote = "AdjClose")
  x <- merge(spc, ibm)
  plot(x, main = "IBM vs S&amp 500")
}

con <- url("http://www.oanda.com")
if(!inherits(try(open(con), silent = TRUE), "try-error")) {
  close(con)
  x <- get.hist.quote(instrument = "EUR/USD", provider = "oanda",
                      start = Sys.Date() - 500)
  plot(x, main = "EUR/USD")
}

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2024-11-29 04:07 , Processed in 0.061712 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表