[Quantmod-commits] r618 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Dec 7 21:03:41 CET 2014


Author: bodanker
Date: 2014-12-07 21:03:41 +0100 (Sun, 07 Dec 2014)
New Revision: 618

Modified:
   pkg/R/getSymbols.R
Log:
- Fix bug #735. Thanks to Ivan Popivanov for the report.


Modified: pkg/R/getSymbols.R
===================================================================
--- pkg/R/getSymbols.R	2014-12-07 19:03:43 UTC (rev 617)
+++ pkg/R/getSymbols.R	2014-12-07 20:03:41 UTC (rev 618)
@@ -278,16 +278,7 @@
                              sep='.')
        if(adjust) {
          # Adjustment algorithm by Joshua Ulrich
-         div <- getDividends(Symbols.name, from=from, to=to, auto.assign=FALSE)
-         spl <- getSplits(Symbols.name,    from=from, to=to, auto.assign=FALSE)
-         adj <- na.omit(adjRatios(spl, div, Cl(fr)))
-
-         fr[,1] <- fr[,1] * adj[,'Split'] * adj[,'Div']  # Open
-         fr[,2] <- fr[,2] * adj[,'Split'] * adj[,'Div']  # High
-         fr[,3] <- fr[,3] * adj[,'Split'] * adj[,'Div']  # Low
-         fr[,4] <- fr[,4] * adj[,'Split'] * adj[,'Div']  # Close
-         fr[,5] <- fr[,5] * ( 1 / adj[,'Div'] )          # Volume
-         #fr <- adjustOHLC(fr, symbol.name=Symbols.name)
+         fr <- adjustOHLC(fr, symbol.name=Symbols.name)
        }
 
        fr <- convert.time.series(fr=fr,return.class=return.class)



More information about the Quantmod-commits mailing list