[R-SIG-Finance] Blotter package - problem with example.
Cedrick Johnson
cedrick at cedrickjohnson.com
Mon Mar 1 16:31:49 CET 2010
I would try update.packages instead of install....
Regards,
CJ
On 3/1/10, kafkaz <kafka at centras.lt> wrote:
>
> Could you explain, why equity goes down calling these functions:
> equity=getEndEq('acc',as.character(currentDate))
> print(paste('equity ',equity, ' date ',currentDate,' Spy ', SPY.monthly[i]))
> updatePortf(Portfolio = "prtf", Dates = as.character(currentDate))
> updateAcct("acc", Dates = as.character(currentDate))
> updateEndEq("acc", as.character(currentDate))
>
> [1] "equity 10000 date 1995-01-31 Spy 37.02"
> [1] "upAcc 1995-01-31"
> [1] "upEnd 1995-01-31"
> [1] "equity 10000 date 1995-02-28 Spy 38.54"
> [1] "upAcc 1995-02-28"
> [1] "upEnd 1995-02-28"
> [1] "equity 0 date 1995-03-31 Spy 39.64"
> [1] "upAcc 1995-03-31"
> [1] "upEnd 1995-03-31"
> [1] "equity 0 date 1995-04-28 Spy 40.81"
> [1] "upAcc 1995-04-28"
> [1] "upEnd 1995-04-28"
> [1] "equity 0 date 1995-05-31 Spy 42.43"
> [1] "upAcc 1995-05-31"
> [1] "upEnd 1995-05-31"
> [1] "equity 0 date 1995-06-30 Spy 43.29"
> [1] "upAcc 1995-06-30"
> [1] "upEnd 1995-06-30"
> [1] "equity 0 date 1995-07-31 Spy 44.68"
> [1] "upAcc 1995-07-31"
> [1] "upEnd 1995-07-31"
> [1] "equity 0 date 1995-08-31 Spy 44.88"
> [1] "upAcc 1995-08-31"
> [1] "upEnd 1995-08-31"
> [1] "equity 0 date 1995-09-29 Spy 46.77"
> [1] "upAcc 1995-09-29"
> [1] "upEnd 1995-09-29"
> [1] "equity 0 date 1995-10-31 Spy 46.64"
> [1] "buy"
> [1] "1995-10-31 SPY 0 @ 46.64"
> [1] "upAcc 1995-10-31"
> [1] "upEnd 1995-10-31"
>
> Latter on, it fails on updateEndEq("acc", as.character(currentDate))
>
> Error in if (length(c(year, month, day, hour, min, sec)) == 6 && c(year, :
> missing value where TRUE/FALSE needed
> In addition: Warning messages:
> 1: In as_numeric(YYYY) : NAs introduced by coercion
> 2: In as_numeric(YYYY) : NAs introduced by coercion
>
> Thank you.
>
> --
> View this message in context:
> http://n4.nabble.com/Blotter-package-problem-with-example-tp1018634p1573514.html
> Sent from the Rmetrics mailing list archive at Nabble.com.
>
> _______________________________________________
> R-SIG-Finance at stat.math.ethz.ch 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.
>
--
Sent from my mobile device
More information about the R-SIG-Finance
mailing list