The "longtrend" and "turtles" demos appear to be broken by recent changes to xts and quantmod (regarding timezone issues with Date-classed indexes). I don't have time to work on a fix at the moment, but wanted to answer in case others might investigate and work on a patch.
Best, -- Joshua Ulrich | about.me/joshuaulrich FOSS Trading | www.fosstrading.com R/Finance 2013: Applied Finance with R | www.RinFinance.com On Fri, May 10, 2013 at 4:47 PM, Mark Knecht <markkne...@gmail.com> wrote: > Hi, > I'm struggling to get any of the demos in the blotter package to > work. Using a command such as: > > demo(longtrend, package="blotter") > > it runs along for a second and then fails with this message: > > + # Calculate P&L and resulting equity with blotter > + updatePortf(ltportfolio, Dates = CurrentDate) > + updateAcct(ltaccount, Dates = CurrentDate) > + updateEndEq(ltaccount, Dates = CurrentDate) > + } # End dates loop > . > [1] "1998-10-30 00:00:00 GSPC 91 @ 1098.67" > Error in lag.xts(TmpPeriods$Pos.Value, 1) : > abs(k) must be less than nrow(x) > In addition: Warning messages: > 1: In rm("account.longtrend", "portfolio.longtrend", pos = .blotter) : > object 'account.longtrend' not found > 2: In rm("account.longtrend", "portfolio.longtrend", pos = .blotter) : > object 'portfolio.longtrend' not found > 3: In rm("ltaccount", "ltportfolio", "ClosePrice", "CurrentDate", "equity", : > object 'ltaccount' not found > 4: In rm("ltaccount", "ltportfolio", "ClosePrice", "CurrentDate", "equity", : > object 'ltportfolio' not found > 5: In rm("ltaccount", "ltportfolio", "ClosePrice", "CurrentDate", "equity", : > object 'GSPC' not found > 6: In download.file(paste(yahoo.URL, "s=", Symbols.name, "&a=", from.m, : > downloaded length 236151 != reported length 200 > > I suspect I'm just not running it correctly but don't know what I'm > doing wrong. > > I've generally had trouble with all demos having to do with > blotter. Are they still working or are they no longer maintained? > > The quantstrat demos, at least the couple I've tried, do seem to work. > > This is R-2.15.3 running in RStudio=0.97.336/ > > Thanks, > Mark > > _______________________________________________ > R-SIG-Finance@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-sig-finance > -- Subscriber-posting only. If you want to post, subscribe first. > -- Also note that this is not the r-help list where general R questions > should go. _______________________________________________ R-SIG-Finance@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions should go.