I am getting an error when calling updatePortf().  I narrowed it down to the 
following few statement, and still see the same error.  I had SPY data in 
memory already using getsymbols().

Any hint on where I need to look for bug next?

thanks,

LJ

> symbols=c("SPY")
> rm(list=ls(envir=.blotter),envir=.blotter)
> initPortf(name='default', symbols=symbols, initDate=initDate)
[1] "default"
> initAcct(name='default', portfolios='default', initDate=initDate, 
> initEq=initEq)
[1] "default"
> updatePortf(Portfolio='default', Dates=CurrentDate, prefer="Adjusted")
Error in lag.xts(TmpPeriods$Pos.Value, 1) : 
  abs(k) must be less than nrow(x)
> traceback()
5: .Call("lag_xts", x, as.integer(k), as.logical(na.pad), PACKAGE = "xts")
4: lag.xts(TmpPeriods$Pos.Value, 1)
3: lag(TmpPeriods$Pos.Value, 1)
2: .updatePosPL(Portfolio = pname, Symbol = as.character(symbol), 
       Dates = Dates, Prices = Prices, ... = ...)
1: updatePortf(Portfolio = "default", Dates = CurrentDate, prefer = "Adjusted")
                                          
                                          
        [[alternative HTML version deleted]]

_______________________________________________
[email protected] 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.

Reply via email to