[Quantmod-commits] r614 - in pkg: . R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Nov 27 19:31:50 CET 2014


Author: bodanker
Date: 2014-11-27 19:31:50 +0100 (Thu, 27 Nov 2014)
New Revision: 614

Modified:
   pkg/DESCRIPTION
   pkg/NAMESPACE
   pkg/R/getSymbols.R
   pkg/R/getSymbols.skeleton.R
   pkg/man/getSymbols.FRED.Rd
   pkg/man/getSymbols.Rd
   pkg/man/getSymbols.csv.Rd
   pkg/man/getSymbols.google.Rd
   pkg/man/getSymbols.rda.Rd
   pkg/man/getSymbols.yahoo.Rd
   pkg/man/quantmod-package.Rd
   pkg/man/setTA.Rd
   pkg/man/specifyModel.Rd
Log:
- Add dependency on Defaults >= 2.0-0


Modified: pkg/DESCRIPTION
===================================================================
--- pkg/DESCRIPTION	2014-11-01 15:19:24 UTC (rev 613)
+++ pkg/DESCRIPTION	2014-11-27 18:31:50 UTC (rev 614)
@@ -4,7 +4,7 @@
 Version: 0.4-2
 Date: 2014-10-08
 Author: Jeffrey A. Ryan
-Depends: xts(>= 0.9-0), zoo, TTR(>= 0.2), methods
+Depends: xts(>= 0.9-0), zoo, TTR(>= 0.2), methods, Defaults(>= 2.0-0)
 Suggests: DBI,RMySQL,RSQLite,timeSeries,its
 Maintainer: Joshua M. Ulrich <josh.m.ulrich at gmail.com>
 Description: Specify, build, trade, and analyse quantitative financial trading strategies

Modified: pkg/NAMESPACE
===================================================================
--- pkg/NAMESPACE	2014-11-01 15:19:24 UTC (rev 613)
+++ pkg/NAMESPACE	2014-11-27 18:31:50 UTC (rev 614)
@@ -2,7 +2,7 @@
 S3method(print, quantmodEnv)
 
 # NAMESPACE file for quantmod
-import(methods, zoo, xts, TTR)
+import(methods, zoo, xts, TTR, Defaults)
 importFrom(graphics,plot)
 importFrom(stats,predict)
 importFrom(stats,lag)

Modified: pkg/R/getSymbols.R
===================================================================
--- pkg/R/getSymbols.R	2014-11-01 15:19:24 UTC (rev 613)
+++ pkg/R/getSymbols.R	2014-11-27 18:31:50 UTC (rev 614)
@@ -23,6 +23,7 @@
                 'options("getSymbols.warning4.0"=FALSE). See ?getSymbol for more details'))
         options("getSymbols.warning4.0"=FALSE) 
       }
+      importDefaults("getSymbols")
       #  to enable as-it-was behavior, set this:
       #  options(getSymbols=list(env=substitute(parent.frame(3))))
 
@@ -122,6 +123,7 @@
 #                              bb.suffix="Equity",
 #                              bb.interval="5",
 #                              ...) {
+#    importDefaults("getSymbols.Bloomberg")
 #    this.env <- environment()
 #    for(var in names(list(...))) {
 #       # import all named elements that are NON formals
@@ -217,6 +219,7 @@
          to=Sys.Date(),
          ...)
 {
+     importDefaults("getSymbols.yahoo")
      this.env <- environment()
      for(var in names(list(...))) {
         # import all named elements that are NON formals
@@ -313,6 +316,7 @@
          ...)
 {
      fix.google.bug <- TRUE
+     importDefaults("getSymbols.google")
      this.env <- environment()
      for(var in names(list(...))) {
         # import all named elements that are NON formals
@@ -382,6 +386,7 @@
                                dbname=NULL,
                                POSIX = TRUE,
                                ...) {
+     importDefaults("getSymbols.SQLite")
      this.env <- environment()
      for(var in names(list(...))) {
         # import all named elements that are NON formals
@@ -445,6 +450,7 @@
                                field.names = NULL,
                                user=NULL,password=NULL,dbname=NULL,host='localhost',port=3306,
                                ...) {
+     importDefaults("getSymbols.MySQL")
      this.env <- environment()
      for(var in names(list(...))) {
         # import all named elements that are NON formals
@@ -501,6 +507,7 @@
 # getSymbols.FRED {{{
 `getSymbols.FRED` <- function(Symbols,env,
      return.class="xts", ...) {
+     importDefaults("getSymbols.FRED")
      this.env <- environment()
      for(var in names(list(...))) {
         # import all named elements that are NON formals
@@ -543,6 +550,7 @@
          env=parent.frame(),
          verbose=FALSE,warning=TRUE,
          auto.assign=TRUE,...) {
+  importDefaults("getFX")
   if(missing(env))
     env <- parent.frame(1)
   if(is.null(env))
@@ -572,6 +580,7 @@
          base.currency="USD",env=parent.frame(),
          verbose=FALSE,warning=TRUE,
          auto.assign=TRUE,...) {
+  importDefaults("getMetals")
   if(missing(env))
     env <- parent.frame(1)
   if(is.null(env))
@@ -601,6 +610,7 @@
          return.class="xts",
          extension="csv",
          ...) {
+  importDefaults("getSymbols.csv")
   this.env <- environment()
   for(var in names(list(...))) {
     assign(var,list(...)[[var]], this.env)
@@ -668,6 +678,7 @@
          extension="rds",
          col.names=c('Open','High','Low','Close','Volume','Adjusted'),
          ...) {
+  importDefaults("getSymbols.rds")
   this.env <- environment()
   for(var in names(list(...))) {
     assign(var,list(...)[[var]], this.env)
@@ -726,6 +737,7 @@
          extension="rda",
          col.names=c('Open','High','Low','Close','Volume','Adjusted'),
          ...) {
+  importDefaults("getSymbols.rda")
   this.env <- environment()
   for(var in names(list(...))) {
     assign(var,list(...)[[var]], this.env)
@@ -786,6 +798,7 @@
 endDateTime, barSize='1 day', duration='1 M',
 useRTH = '1', whatToShow = 'TRADES', time.format = '1', ...)
 {
+  importDefaults('getSymbols.IBrokers')
   this.env <- environment()
   for(var in names(list(...))) {
     assign(var, list(...)[[var]], this.env)
@@ -859,6 +872,7 @@
          from=Sys.Date()-499,
          to=Sys.Date(),
          ...) {
+     importDefaults("getSymbols.oanda")
      if( (as.Date(to)-as.Date(from)) > 500 )
        stop("oanda.com limits data to 500 days per request", call.=FALSE)
      this.env <- environment()

Modified: pkg/R/getSymbols.skeleton.R
===================================================================
--- pkg/R/getSymbols.skeleton.R	2014-11-01 15:19:24 UTC (rev 613)
+++ pkg/R/getSymbols.skeleton.R	2014-11-27 18:31:50 UTC (rev 614)
@@ -4,6 +4,7 @@
          # additional source specific params
          return.class="zoo",
          ...) {
+  importDefaults("")
   this.env <- environment()
   for(var in names(list(...))) {
     assign(var,list(...)[[var]], this.env)

Modified: pkg/man/getSymbols.FRED.Rd
===================================================================
--- pkg/man/getSymbols.FRED.Rd	2014-11-01 15:19:24 UTC (rev 613)
+++ pkg/man/getSymbols.FRED.Rd	2014-11-27 18:31:50 UTC (rev 614)
@@ -65,6 +65,8 @@
 
 
 ## Method #2
+setDefaults(getSymbols,src='FRED')
+  # OR
 setSymbolLookup(CPIAUCNS='FRED')
 
 getSymbols('CPIAUCNS')

Modified: pkg/man/getSymbols.Rd
===================================================================
--- pkg/man/getSymbols.Rd	2014-11-01 15:19:24 UTC (rev 613)
+++ pkg/man/getSymbols.Rd	2014-11-27 18:31:50 UTC (rev 614)
@@ -131,6 +131,11 @@
 is used for your function NAME. See \code{getSymbols}
 source code.
 
+\code{setDefaults(getSymbols)} can be used to
+specify defaults for \code{getSymbols} arguments.
+\code{setDefaults(getSymbols.MySQL)} may be used for arguments
+specific to \code{getSymbols.MySQL}, etc.
+
 The \dQuote{sourcing} of data is managed internally
 through a complex lookup procedure. If \code{symbol.lookup}
 is TRUE (the default), a check is made if any symbol
@@ -138,7 +143,8 @@
 
 If not set, the process continues by checking to see if
 \code{src} has been specified by the user in the
-function call.
+function call. If not, any \code{src} defined with
+\code{setDefaults(getSymbols,src=)} is used.
 
 Finally, if none of the other source rules apply
 the default \code{getSymbols} \code{src} method is
@@ -191,7 +197,7 @@
 # loads Ford market data from yahoo (the formal default)
 getSymbols('F')       
 
-# loads symbol from MySQL database
+# loads symbol from MySQL database (set with setDefaults)
 getSymbols('DIA', verbose=TRUE, src='MySQL')                 
 
 # loads Ford as time series class ts 

Modified: pkg/man/getSymbols.csv.Rd
===================================================================
--- pkg/man/getSymbols.csv.Rd	2014-11-01 15:19:24 UTC (rev 613)
+++ pkg/man/getSymbols.csv.Rd	2014-11-27 18:31:50 UTC (rev 614)
@@ -63,6 +63,8 @@
 
 
 ## Method #2
+setDefaults(getSymbols,src='csv')
+  # OR
 setSymbolLookup(MSFT='csv')
 
 getSymbols('MSFT')

Modified: pkg/man/getSymbols.google.Rd
===================================================================
--- pkg/man/getSymbols.google.Rd	2014-11-01 15:19:24 UTC (rev 613)
+++ pkg/man/getSymbols.google.Rd	2014-11-27 18:31:50 UTC (rev 614)
@@ -76,6 +76,8 @@
 
 
 ## Method #2
+setDefaults(getSymbols,src='google')
+  # OR
 setSymbolLookup(MSFT='google')
 
 getSymbols('MSFT')

Modified: pkg/man/getSymbols.rda.Rd
===================================================================
--- pkg/man/getSymbols.rda.Rd	2014-11-01 15:19:24 UTC (rev 613)
+++ pkg/man/getSymbols.rda.Rd	2014-11-27 18:31:50 UTC (rev 614)
@@ -64,6 +64,8 @@
 
 
 ## Method #2
+setDefaults(getSymbols,src='rda')
+  # OR
 setSymbolLookup(MSFT='rda')
   # OR
 setSymbolLookup(MSFT=list(src='rda'))

Modified: pkg/man/getSymbols.yahoo.Rd
===================================================================
--- pkg/man/getSymbols.yahoo.Rd	2014-11-01 15:19:24 UTC (rev 613)
+++ pkg/man/getSymbols.yahoo.Rd	2014-11-27 18:31:50 UTC (rev 614)
@@ -67,6 +67,8 @@
 
 
 ## Method #2
+setDefaults(getSymbols,src='yahoo')
+  # OR
 setSymbolLookup(MSFT='yahoo')
 
 getSymbols('MSFT')

Modified: pkg/man/quantmod-package.Rd
===================================================================
--- pkg/man/quantmod-package.Rd	2014-11-01 15:19:24 UTC (rev 613)
+++ pkg/man/quantmod-package.Rd	2014-11-27 18:31:50 UTC (rev 614)
@@ -15,7 +15,7 @@
 Type: \tab Package\cr
 Version: \tab 0.4-2\cr
 Date: \tab 2014-10-08\cr
-Depends: \tab xts(>= 0.9-0),zoo,TTR(>= 0.2),methods\cr
+Depends: \tab xts(>= 0.9-0),zoo,TTR(>= 0.2),methods,Defaults(>=2.0-0)\cr
 Suggests: \tab DBI,RMySQL,RSQLite,timeSeries,its\cr
 LazyLoad: \tab yes\cr
 License: \tab GPL-3\cr

Modified: pkg/man/setTA.Rd
===================================================================
--- pkg/man/setTA.Rd	2014-11-01 15:19:24 UTC (rev 613)
+++ pkg/man/setTA.Rd	2014-11-27 18:31:50 UTC (rev 614)
@@ -24,8 +24,11 @@
 
 It is important to note that the \emph{current} device
 will be used to extract the list of TA arguments to apply.
-This is done with a call to \code{listTA} internally, and
-followed by calls to setDefaults of the appropriate functions.
+This is done with a call to listTA internally, and followed
+by calls to setDefaults of the appropriate functions.
+
+An additional way to set default TA arguments for subsequent
+charts is via \code{setDefaults}. See the examples.
 }
 \value{
 Called for its side-effect of setting the default
@@ -45,6 +48,13 @@
 \dontrun{
 listTA()
 setTA()
+
+# a longer way to accomplish the same
+setDefaults(chartSeries,TA=listTA())
+setDefaults(barCart,TA=listTA())
+setDefaults(candleChart,TA=listTA())
+
+setDefaults(chartSeries,TA=substitute(c(addVo(),addBBands())))
 }
 }
 \keyword{ utilities }

Modified: pkg/man/specifyModel.Rd
===================================================================
--- pkg/man/specifyModel.Rd	2014-11-01 15:19:24 UTC (rev 613)
+++ pkg/man/specifyModel.Rd	2014-11-27 18:31:50 UTC (rev 614)
@@ -38,7 +38,7 @@
 function. getSymbols retrieves each
 object specified by using information
 as to its location specified apriori 
-via \code{setSymbolLookup}.
+via \code{setDefaults} or \code{setSymbolLookup}.
 
 Internally all data is coerced to \code{zoo},\code{data.frame},
 or \code{numeric} classes.



More information about the Quantmod-commits mailing list